pub trait LlmClient: Send + Sync {
// Required methods
fn chat<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = Result<Value, AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait;
fn chat_stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamChunk, AgentError>> + Send>>, AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait;
fn capabilities(&self) -> LlmCapabilities;
// Provided method
fn model_name(&self) -> &str { ... }
}Required Methods§
fn chat<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = Result<Value, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn chat_stream<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: &'life2 [Value],
reasoning: Option<&'life3 ReasoningConfig>,
response_format: Option<&'life4 ResponseFormat>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamChunk, AgentError>> + Send>>, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn capabilities(&self) -> LlmCapabilities
Provided Methods§
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
The model name used by this client (e.g. “claude-sonnet”, “gpt-4o”). Default: “unknown”.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".