pub trait EmbedderExt: Embedder {
// Provided methods
fn into_any_embedder(self) -> DynEmbedder
where Self: Sized,
Self::Error: Error { ... }
fn embed(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send { ... }
fn embed_query(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send { ... }
fn embed_batch(
&self,
inputs: impl IntoIterator<Item = impl ToString>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send { ... }
fn embed_batch_for(
&self,
inputs: impl IntoIterator<Item = EmbeddingInput>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send { ... }
}Expand description
Provided Methods§
Sourcefn into_any_embedder(self) -> DynEmbedder
fn into_any_embedder(self) -> DynEmbedder
Convert this embedder into an embedder trait object.
Sourcefn embed(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
fn embed( &self, input: impl ToString, ) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
Embed some text into a vector space
Sourcefn embed_query(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
fn embed_query( &self, input: impl ToString, ) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
Embed a query into a vector space
Sourcefn embed_batch(
&self,
inputs: impl IntoIterator<Item = impl ToString>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
fn embed_batch( &self, inputs: impl IntoIterator<Item = impl ToString>, ) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
Embed a batch of text into a vector space. Returns a list of embeddings in the same order as the inputs.
Sourcefn embed_batch_for(
&self,
inputs: impl IntoIterator<Item = EmbeddingInput>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
fn embed_batch_for( &self, inputs: impl IntoIterator<Item = EmbeddingInput>, ) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
Embed a batch of EmbeddingInput into a vector space. Returns a list of embeddings in the same order as the inputs.
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.