LLMProvider

Trait LLMProvider 

Source
pub trait LLMProvider: Send + Sync {
    // Required methods
    fn generate<'life0, 'async_trait>(
        &'life0 self,
        request: LLMRequest,
    ) -> Pin<Box<dyn Future<Output = Result<LLMResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A trait for LLM providers.

Required Methods§

Source

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

Generates a response from the LLM.

Source

fn as_any(&self) -> &dyn Any

Returns the provider as an Any type.

Implementors§