Skip to main content

LocalEmbedder

Trait LocalEmbedder 

Source
pub trait LocalEmbedder {
    // Required method
    async fn embed(&self, text: &str) -> Result<Vec<f32>, LaserError>;
}
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

async fn embed(&self, text: &str) -> Result<Vec<f32>, LaserError>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<TraitVariantBlanketType: Embedder> LocalEmbedder for TraitVariantBlanketType