open-agent-sdk 0.11.5

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
7
8
9
10
11
12
13
14
impl Client {
    /// Starts a request with a pre-built message, including image content.
    /// UserPromptSubmit hooks apply only to [`Self::send`], which accepts text.
    /// The message enters history before HTTP I/O; pending output is discarded.
    pub async fn send_message(&mut self, message: Message) -> Result<()> {
        self.interrupted.store(false, Ordering::SeqCst);

        self.discard_pending_output();

        self.history.push(message);

        self.start_request().await
    }
}