pub trait Embedder: Send {
// Required methods
fn dim(&self) -> usize;
fn embed(&mut self, texts: &[&str]) -> Result<Vec<Vec<f32>>, HostError>;
}Expand description
Turns texts into embedding vectors. Batched by design — providers price and perform far better on batches.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".