pub trait EmbeddingProvider: Send + Sync {
// Required methods
fn embed(&self, text: &str) -> MenteResult<Vec<f32>>;
fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>;
fn dimensions(&self) -> usize;
fn model_name(&self) -> &str;
}Expand description
Synchronous embedding provider.
Required Methods§
Sourcefn embed(&self, text: &str) -> MenteResult<Vec<f32>>
fn embed(&self, text: &str) -> MenteResult<Vec<f32>>
Generate an embedding vector for a single text.
Sourcefn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
Generate embedding vectors for a batch of texts.
Sourcefn dimensions(&self) -> usize
fn dimensions(&self) -> usize
The dimensionality of the embedding vectors produced by this provider.
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
The name of the model used by this provider.