Skip to main content

EmbeddingProvider

Trait EmbeddingProvider 

Source
pub trait EmbeddingProvider: Send + Sync {
    // Required methods
    fn compute_embeddings(&self, chunks: &[String]) -> Result<Array2<f32>>;
    fn dimensions(&self) -> usize;
    fn name(&self) -> &str;
}
Expand description

Trait for embedding computation backends.

Required Methods§

Source

fn compute_embeddings(&self, chunks: &[String]) -> Result<Array2<f32>>

Compute embeddings for a batch of text chunks.

Source

fn dimensions(&self) -> usize

Get the dimensionality of the embeddings.

Source

fn name(&self) -> &str

Get the provider name.

Implementors§