pub trait EmbeddingModel {
    // Required methods
    fn embed<'life0, 'async_trait>(
        &'life0 self,
        input: String
    ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, AnchorChainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn dimensions(&self) -> usize;
}
Expand description

Defines the interface for an embedding model that can embed text input.

Required Methods§

source

fn embed<'life0, 'async_trait>( &'life0 self, input: String ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, AnchorChainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Embeds the given input text and returns the resulting vector.

source

fn dimensions(&self) -> usize

Implementors§