pub trait Embedder: Send + Sync {
// Required methods
fn dimension(&self) -> usize;
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, MemoryError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Compute embeddings for one or more texts.
Output vectors must each be of length Embedder::dimension.
Implementations must be deterministic at the type level — the
dimensionality cannot vary across calls on the same instance.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".