Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn supported_models(&self) -> Vec<String>;
    fn cli(&self) -> &'static dyn CliHandlers;
    fn handle_messages<'life0, 'async_trait>(
        &'life0 self,
        body: MessagesRequest,
        ctx: RequestContext,
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_count_tokens<'life0, 'async_trait>(
        &'life0 self,
        body: MessagesRequest,
        ctx: RequestContext,
    ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

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

Source

fn supported_models(&self) -> Vec<String>

Source

fn cli(&self) -> &'static dyn CliHandlers

Source

fn handle_messages<'life0, 'async_trait>( &'life0 self, body: MessagesRequest, ctx: RequestContext, ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn handle_count_tokens<'life0, 'async_trait>( &'life0 self, body: MessagesRequest, ctx: RequestContext, ) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§