Embedder

Trait Embedder 

Source
pub trait Embedder {
    // Required method
    fn embed<'a>(
        &'a self,
        payload_json: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'a>>;

    // Provided method
    fn model_version(&self) -> &'static str { ... }
}
Expand description

Embedder for converting payloads to vectors.

Required Methods§

Source

fn embed<'a>( &'a self, payload_json: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<f32>>>> + Send + 'a>>

Produce an embedding vector for the payload JSON. Implementations may be async.

Provided Methods§

Source

fn model_version(&self) -> &'static str

Return a stable identifier/version for the embedder model.

Implementors§