LLMClient

Trait LLMClient 

Source
pub trait LLMClient: Send + Sync {
    // Required method
    fn chat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: Vec<Message>,
        tools: Vec<ToolDefinition>,
        model: Option<&'life1 str>,
        json_mode: bool,
    ) -> Pin<Box<dyn Future<Output = GentResult<LLMResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for LLM clients

Required Methods§

Source

fn chat<'life0, 'life1, 'async_trait>( &'life0 self, messages: Vec<Message>, tools: Vec<ToolDefinition>, model: Option<&'life1 str>, json_mode: bool, ) -> Pin<Box<dyn Future<Output = GentResult<LLMResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a chat request to the LLM

§Arguments
  • messages - The conversation history
  • tools - Available tool definitions
  • model - Optional model override (uses client default if None)
  • json_mode - Enable JSON mode (response_format: json_object)

Implementors§