open-agent-sdk 0.11.3

Production-ready Rust SDK for building AI agents over two wire protocols: OpenAI chat completions (LMStudio, Ollama, llama.cpp, vLLM, OpenRouter) and Anthropic messages. Features streaming, tools, hooks, retry logic, and comprehensive examples.
Documentation
1
2
3
4
5
6
/// An asynchronous JSON-to-JSON handler shared through [`Arc`].
///
/// [`Tool::new`] boxes the returned future and wraps the closure automatically.
/// The closure must be `Send + Sync`; its future must be `Send`.
pub type ToolHandler =
    Arc<dyn Fn(Value) -> Pin<Box<dyn Future<Output = Result<Value>> + Send>> + Send + Sync>;