pub trait Embedder: Send + Sync {
// Required methods
fn model_id(&self) -> &str;
fn dim(&self) -> usize;
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Produces dense vectors for text. Must be deterministic for a given
(model, input) so persisted vectors stay comparable across runs.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".