kova-sdk 0.1.0

Async-first Rust library for building LLM-powered agents with tool calling, streaming, MCP, and multi-agent orchestration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::Duration;

use crate::error::KovaError;

/// Map a `reqwest` send error to an [`KovaError`].
///
/// Timeout errors map to `KovaError::Timeout`; everything else (including
/// connection refused) maps to `KovaError::Connection`.
pub(crate) fn map_request_error(e: reqwest::Error, timeout: Duration) -> KovaError {
    if e.is_timeout() {
        KovaError::Timeout(timeout)
    } else {
        KovaError::Connection(e.to_string())
    }
}