Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder {
    // Required methods
    fn model_id(&self) -> &str;
    fn embed(&self, input: &[String]) -> Result<Vec<Vec<f32>>>;
}
Expand description

Converts text batches into vectors from one stable model space.

Required Methods§

Source

fn model_id(&self) -> &str

Returns a stable identity such as a provider, model, and revision.

Source

fn embed(&self, input: &[String]) -> Result<Vec<Vec<f32>>>

Embeds every input string in the same order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Embedder for FastEmbedder

Available on crate feature fastembed only.