EmbeddingModel

Trait EmbeddingModel 

Source
pub trait EmbeddingModel {
    // Provided methods
    fn dimensions(&self) -> usize { ... }
    async fn embed(
        &self,
        _text: &str,
    ) -> Result<EmbeddingVector, EmbeddingError> { ... }
    async fn embed_batch(
        &self,
        _texts: &[String],
    ) -> Result<Vec<EmbeddingVector>, EmbeddingError> { ... }
}

Provided Methods§

Source

fn dimensions(&self) -> usize

Source

async fn embed(&self, _text: &str) -> Result<EmbeddingVector, EmbeddingError>

Source

async fn embed_batch( &self, _texts: &[String], ) -> Result<Vec<EmbeddingVector>, EmbeddingError>

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§