LLMClient

Trait LLMClient 

Source
pub trait LLMClient: Send + Sync {
    // Required methods
    fn generate<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        prompt: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn backend_kind(&self) -> BackendKind;
    fn model_id(&self) -> &str;
}
Expand description

Unified LLM client trait

Required Methods§

Source

fn generate<'life0, 'life1, 'async_trait>( &'life0 mut self, prompt: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn backend_kind(&self) -> BackendKind

Source

fn model_id(&self) -> &str

Implementors§