Skip to main content

LlmClient

Trait LlmClient 

Source
pub trait LlmClient: Send + Sync {
    // Required methods
    fn chat<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        messages: &'life1 [ChatMessage],
        tools: &'life2 [Value],
        enable_thinking: Option<bool>,
        response_format: Option<&'life3 ResponseFormat>,
    ) -> Pin<Box<dyn Future<Output = AgentResult<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn chat_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        messages: &'life1 [ChatMessage],
        tools: &'life2 [Value],
        enable_thinking: Option<bool>,
        response_format: Option<&'life3 ResponseFormat>,
    ) -> Pin<Box<dyn Future<Output = AgentResult<Pin<Box<dyn Stream<Item = AgentResult<StreamChunk>> + Send>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn capabilities(&self) -> LlmCapabilities;
}

Required Methods§

Source

fn chat<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, messages: &'life1 [ChatMessage], tools: &'life2 [Value], enable_thinking: Option<bool>, response_format: Option<&'life3 ResponseFormat>, ) -> Pin<Box<dyn Future<Output = AgentResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn chat_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, messages: &'life1 [ChatMessage], tools: &'life2 [Value], enable_thinking: Option<bool>, response_format: Option<&'life3 ResponseFormat>, ) -> Pin<Box<dyn Future<Output = AgentResult<Pin<Box<dyn Stream<Item = AgentResult<StreamChunk>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn capabilities(&self) -> LlmCapabilities

Implementors§