Trait AsyncEmbeddingClient

Source
pub trait AsyncEmbeddingClient {
    type ErrorType: Error;

    // Required methods
    fn generate_embedding(
        &self,
        text: Chunk,
    ) -> impl Future<Output = Result<Embedding, Self::ErrorType>> + Send;
    fn generate_embeddings(
        &self,
        text: Chunks,
    ) -> impl Future<Output = Result<Vec<Embedding>, Self::ErrorType>> + Send;
}
Expand description

§AsyncEmbeddingClient

Trait for any client that generates embeddings asynchronously

Required Associated Types§

Required Methods§

Source

fn generate_embedding( &self, text: Chunk, ) -> impl Future<Output = Result<Embedding, Self::ErrorType>> + Send

Source

fn generate_embeddings( &self, text: Chunks, ) -> impl Future<Output = Result<Vec<Embedding>, Self::ErrorType>> + Send

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.

Implementors§