Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn models(&self) -> Vec<ModelInfo>;
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        model: &'life1 str,
        prompt: &'life2 Prompt,
        key: Option<&'life3 str>,
        stream: bool,
    ) -> Pin<Box<dyn Future<Output = Result<ResponseStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;

    // Provided methods
    fn needs_key(&self) -> Option<&str> { ... }
    fn key_env_var(&self) -> Option<&str> { ... }
}

Required Methods§

Source

fn id(&self) -> &str

Source

fn models(&self) -> Vec<ModelInfo>

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, model: &'life1 str, prompt: &'life2 Prompt, key: Option<&'life3 str>, stream: bool, ) -> Pin<Box<dyn Future<Output = Result<ResponseStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Provided Methods§

Source

fn needs_key(&self) -> Option<&str>

Source

fn key_env_var(&self) -> Option<&str>

Implementors§