Trait Embeddable

Source
pub trait Embeddable {
    // Required methods
    fn embed_content(&self) -> String;
    fn document_id(&self) -> String;

    // Provided method
    fn metadata(&self) -> HashMap<String, MetadataValue> { ... }
}
Expand description

Trait for documents that can be embedded

This trait is inspired by Rig’s Embed trait and allows automatic embedding generation for structured data.

Required Methods§

Source

fn embed_content(&self) -> String

Extract the text content that should be embedded

Source

fn document_id(&self) -> String

Get the document ID

Provided Methods§

Source

fn metadata(&self) -> HashMap<String, MetadataValue>

Get additional metadata

Implementors§