LLM

Trait LLM 

Source
pub trait LLM: Send + Sync {
    // Required methods
    fn generate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: &'life1 [Message],
        options: GenerateOptions,
    ) -> Pin<Box<dyn Future<Output = Result<String, LLMError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn model_name(&self) -> &str;
}
Expand description

Trait for LLM providers

Required Methods§

Source

fn generate<'life0, 'life1, 'async_trait>( &'life0 self, messages: &'life1 [Message], options: GenerateOptions, ) -> Pin<Box<dyn Future<Output = Result<String, LLMError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a text response

Source

fn model_name(&self) -> &str

Get the model name

Implementors§