ModelProvider

Trait ModelProvider 

Source
pub trait ModelProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: Vec<Message>,
        config: &'life1 ModelConfig,
    ) -> Pin<Box<dyn Future<Output = Result<ModelResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stream_complete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: Vec<Message>,
        config: &'life1 ModelConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String>> + Unpin + Send>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn complete<'life0, 'life1, 'async_trait>( &'life0 self, messages: Vec<Message>, config: &'life1 ModelConfig, ) -> Pin<Box<dyn Future<Output = Result<ModelResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn stream_complete<'life0, 'life1, 'async_trait>( &'life0 self, messages: Vec<Message>, config: &'life1 ModelConfig, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String>> + Unpin + Send>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§