Skip to main content

LlmProvider

Trait LlmProvider 

Source
pub trait LlmProvider: Send + Sync {
    // Required method
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: Vec<LlmMessage>,
        tools: Vec<ToolDefinition>,
        model: &'life1 str,
        temperature: Option<f32>,
    ) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Narrow provider trait for LLM completions.

Required Methods§

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, messages: Vec<LlmMessage>, tools: Vec<ToolDefinition>, model: &'life1 str, temperature: Option<f32>, ) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a single completion.

Implementors§