pub trait Embedder: Send + Sync {
// Required methods
fn device(&self) -> &str;
fn embed(&self, texts: &[String]) -> Result<Vec<Vec<f32>>>;
}Expand description
The embedding seam (spec.md#search): text in, vectors out. The real
backend is CandleEmbedder; tests substitute an instrumented fake
to assert batching behavior. The vector width is checked at the write
boundary and the model id is whatever model_id returns at the
time of the write.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".