Skip to main content

LLMClientFactoryTrait

Trait LLMClientFactoryTrait 

Source
pub trait LLMClientFactoryTrait: Send + Sync {
    // Required methods
    fn default_provider(&self) -> &Provider;
    fn create_default<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LLMClient>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_with_provider<'life0, 'async_trait>(
        &'life0 self,
        provider: Provider,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LLMClient>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait abstraction for LLM client factories (useful for mocking in tests)

Required Methods§

Source

fn default_provider(&self) -> &Provider

Get the default provider configuration

Source

fn create_default<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LLMClient>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an LLM client using the default provider

Source

fn create_with_provider<'life0, 'async_trait>( &'life0 self, provider: Provider, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn LLMClient>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an LLM client using a specific provider

Implementors§