Trait EmbeddingModel

Source
pub trait EmbeddingModel:
    Send
    + Sync
    + Debug
    + DynClone {
    // Required method
    fn embed<'life0, 'async_trait>(
        &'life0 self,
        input: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Embeddings, LanguageModelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn name(&self) -> &'static str { ... }
}
Expand description

Embeds a list of strings and returns its embeddings. Assumes the strings will be moved.

Required Methods§

Source

fn embed<'life0, 'async_trait>( &'life0 self, input: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Embeddings, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn name(&self) -> &'static str

Trait Implementations§

Source§

impl EmbeddingModel for &dyn EmbeddingModel

Source§

fn embed<'life0, 'async_trait>( &'life0 self, input: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Embeddings, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Source§

impl EmbeddingModel for Box<dyn EmbeddingModel>

Source§

fn embed<'life0, 'async_trait>( &'life0 self, input: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Embeddings, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Implementations on Foreign Types§

Source§

impl EmbeddingModel for Box<dyn EmbeddingModel>

Source§

fn embed<'life0, 'async_trait>( &'life0 self, input: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Embeddings, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Implementors§