Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send {
    // Required method
    fn embed(
        &self,
        text: &str,
    ) -> impl Future<Output = Result<Vec<f32>, LaserError>> + Send;
}
Expand description

Turns text into an embedding vector. The SDK stays model-agnostic: the implementation (an API call, a local model) lives in application code, the same boundary as the LlmClient seam in the examples.

Required Methods§

Source

fn embed( &self, text: &str, ) -> impl Future<Output = Result<Vec<f32>, LaserError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§