Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send + Sync {
    // Required method
    fn embed<'a>(
        &'a self,
        text: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, ReactError>> + Send + 'a>>;
}
Expand description

Text embedding interface: maps text to dense float vectors

Required Methods§

Source

fn embed<'a>( &'a self, text: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, ReactError>> + Send + 'a>>

Compute the embedding vector for the given text

Implementors§