pub trait EmbeddingProvider {
// Required methods
fn model(&self) -> &str;
fn dim(&self) -> usize;
fn max_input_tokens(&self) -> Option<u32>;
fn embed(&self, texts: &[String]) -> Result<Vec<Vec<f32>>, Error>;
// Provided method
fn embed_query(&self, query: &str) -> Result<Vec<f32>, Error> { ... }
}Expand description
An embedding model: an external process or endpoint (see
crate::external) or, in a runner, the FixtureEmbedder.
Required Methods§
Sourcefn max_input_tokens(&self) -> Option<u32>
fn max_input_tokens(&self) -> Option<u32>
The model’s input limit in tokens, when it reports one (§2.4).
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".