Skip to main content

LlmProvider

Trait LlmProvider 

Source
pub trait LlmProvider: Send + Sync {
    // Required methods
    fn complete<'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 name(&self) -> &'static str;
}
Expand description

🤖 Common interface for all LLM providers

Required Methods§

Source

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

Send a prompt to the LLM and get a response

Source

fn name(&self) -> &'static str

Get the provider name

Implementors§