pub trait EmbeddingProvider: Send + Sync {
// Required methods
fn embed(
&self,
text: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + '_>>;
fn dimensions(&self) -> usize;
}Expand description
Trait for embedding providers.
Required Methods§
Sourcefn embed(
&self,
text: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + '_>>
fn embed( &self, text: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + '_>>
Embed a single text string into a vector.
Sourcefn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Return the embedding dimensionality.