Skip to main content

Embedder

Trait Embedder 

Source
pub trait Embedder: Send + Sync {
    // Required methods
    fn embed(&self, text: &str) -> Vec<f32>;
    fn dim(&self) -> usize;
    fn name(&self) -> &str;

    // Provided methods
    fn is_semantic(&self) -> bool { ... }
    fn embed_batch(&self, texts: &[String]) -> Vec<Vec<f32>> { ... }
}
Expand description

Backend-neutral embedding seam used by the store’s search implementation.

The deterministic lexical backend is always available. Higher-quality implementations may be injected through StoreHooks without changing the search interface or any transport.

Required Methods§

Source

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

Source

fn dim(&self) -> usize

Source

fn name(&self) -> &str

Provided Methods§

Source

fn is_semantic(&self) -> bool

Source

fn embed_batch(&self, texts: &[String]) -> Vec<Vec<f32>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§