LanguageModel

Trait LanguageModel 

Source
pub trait LanguageModel: Send + Sync {
    // Required methods
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prompt: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn complete_with_tools<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prompt: &'life1 str,
        tools: &'life2 [ToolDefinition],
    ) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn model_name(&self) -> &str;
    fn supports_tools(&self) -> bool;
}
Expand description

Language model trait

Required Methods§

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, prompt: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn complete_with_tools<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prompt: &'life1 str, tools: &'life2 [ToolDefinition], ) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn model_name(&self) -> &str

Source

fn supports_tools(&self) -> bool

Implementors§