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