pub trait EmbeddingProvider: Send + Sync {
// Required methods
fn compute_embeddings(
&self,
chunks: &[String],
progress: Option<&dyn IndexProgress>,
) -> Result<Array2<f32>>;
fn dimensions(&self) -> usize;
fn name(&self) -> &str;
}Expand description
Trait for embedding computation backends.
Required Methods§
Sourcefn compute_embeddings(
&self,
chunks: &[String],
progress: Option<&dyn IndexProgress>,
) -> Result<Array2<f32>>
fn compute_embeddings( &self, chunks: &[String], progress: Option<&dyn IndexProgress>, ) -> Result<Array2<f32>>
Compute embeddings for a batch of text chunks.
Sourcefn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Get the dimensionality of the embeddings.