LlmProvider

Trait LlmProvider 

Source
pub trait LlmProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn is_ready<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_pricing<'life0, 'life1, 'async_trait>(
        &'life0 self,
        model: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Pricing>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for LLM provider implementations.

Required Methods§

Source

fn name(&self) -> &str

Get the provider name.

Source

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

Check if the provider is configured and ready.

Source

fn get_pricing<'life0, 'life1, 'async_trait>( &'life0 self, model: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Pricing>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get pricing information for a model.

Implementors§