pub trait EmbeddingProviderExt: EmbeddingProvider {
// Provided method
fn embed_text(
&self,
model: &str,
input: impl Into<String>,
) -> impl Future<Output = Result<Vec<f32>>> + Send { ... }
}Expand description
Convenience extension methods for EmbeddingProvider implementors.
Provided Methods§
Sourcefn embed_text(
&self,
model: &str,
input: impl Into<String>,
) -> impl Future<Output = Result<Vec<f32>>> + Send
fn embed_text( &self, model: &str, input: impl Into<String>, ) -> impl Future<Output = Result<Vec<f32>>> + Send
Quick one-shot embedding for a single input.
§Errors
Propagates any crate::Error from the underlying
EmbeddingProvider::embed call, and returns
crate::Error::UnexpectedResponse if the provider response contains
no embeddings.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.