1pub mod anthropic;
7pub mod factory;
8pub mod http;
9pub mod openai;
10mod types;
11
12pub use anthropic::AnthropicClient;
14pub use factory::{create_client_with_config, LlmConfig};
15pub use http::{default_http_client, HttpClient, HttpResponse, StreamingHttpResponse};
16pub use openai::OpenAiClient;
17pub use types::*;
18
19use anyhow::Result;
20use async_trait::async_trait;
21use tokio::sync::mpsc;
22
23#[async_trait]
25pub trait LlmClient: Send + Sync {
26 async fn complete(
28 &self,
29 messages: &[Message],
30 system: Option<&str>,
31 tools: &[ToolDefinition],
32 ) -> Result<LlmResponse>;
33
34 async fn complete_streaming(
37 &self,
38 messages: &[Message],
39 system: Option<&str>,
40 tools: &[ToolDefinition],
41 ) -> Result<mpsc::Receiver<StreamEvent>>;
42}
43
44#[cfg(test)]
46#[path = "tests.rs"]
47mod tests_file;