pub trait EmbeddingProvider: Send + Sync {
// Required methods
fn embed_text(&self, text: &str) -> Result<Vec<f32>, String>;
fn dimension(&self) -> usize;
fn model_name(&self) -> &str;
// Provided method
fn embed_batch(&self, texts: &[&str]) -> Result<Vec<Vec<f32>>, String> { ... }
}Expand description
Trait for providing text-to-embedding conversion
Implementations can use local models (e.g., ONNX) or remote APIs.
Required Methods§
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name/identifier