Skip to main content

LlmClient

Trait LlmClient 

Source
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;
}

Required Methods§

Source

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,

Source

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,

Source

fn capabilities(&self) -> LlmCapabilities

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§