pub trait AsyncEmbeddingProvider: Send + Sync {
// Required methods
fn embed(
&self,
text: &str,
) -> impl Future<Output = MenteResult<Vec<f32>>> + Send;
fn embed_batch(
&self,
texts: &[&str],
) -> impl Future<Output = MenteResult<Vec<Vec<f32>>>> + Send;
fn dimensions(&self) -> usize;
fn model_name(&self) -> &str;
}Expand description
Asynchronous embedding provider.
Required Methods§
Sourcefn embed(
&self,
text: &str,
) -> impl Future<Output = MenteResult<Vec<f32>>> + Send
fn embed( &self, text: &str, ) -> impl Future<Output = MenteResult<Vec<f32>>> + Send
Generate an embedding vector for a single text.
Sourcefn embed_batch(
&self,
texts: &[&str],
) -> impl Future<Output = MenteResult<Vec<Vec<f32>>>> + Send
fn embed_batch( &self, texts: &[&str], ) -> impl Future<Output = MenteResult<Vec<Vec<f32>>>> + Send
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".