weft-core 0.1.1

OpenAI-compatible AI agent runtime with WASM capability plugin system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use anyhow::Result;
use std::time::Duration;

/// Check if a service is healthy by hitting its health URL.
pub async fn check_health(url: &str, timeout: Duration) -> Result<bool> {
    let client = reqwest::Client::builder().timeout(timeout).build()?;

    match client.get(url).send().await {
        Ok(resp) => Ok(resp.status().is_success()),
        Err(_) => Ok(false),
    }
}