pub trait Embedder: Send + Sync {
// Required method
fn embed(&self, texts: &[&str]) -> Vec<Vec<f32>>;
// Provided method
fn id(&self) -> &str { ... }
}Expand description
A backend that produces dense embedding vectors for a slice of input texts.
Implementations must be deterministic for a given input set (otherwise the semantic axis becomes flappy across runs). Vector dimensionality is implementation-defined; only the requirement “every output vector has the same length” is enforced — the cosine math handles any dimensionality.