Skip to main content

AiProvider

Trait AiProvider 

Source
pub trait AiProvider: Send + Sync {
    // Required methods
    fn provider_id(&self) -> &str;
    fn capabilities(&self) -> &'static [AiCapability];
    fn embed_semantic<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 EmbedRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn embed_avec<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 EmbedRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn score_avec<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 ScoreAvecRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AvecState>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn provider_id(&self) -> &str

Source

fn capabilities(&self) -> &'static [AiCapability]

Source

fn embed_semantic<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 EmbedRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn embed_avec<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 EmbedRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn score_avec<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ScoreAvecRequest, ) -> Pin<Box<dyn Future<Output = Result<AvecState>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§