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§
Sourcefn embed_content(&self) -> String
fn embed_content(&self) -> String
Extract the text content that should be embedded
Sourcefn document_id(&self) -> String
fn document_id(&self) -> String
Get the document ID
Provided Methods§
Sourcefn metadata(&self) -> HashMap<String, MetadataValue>
fn metadata(&self) -> HashMap<String, MetadataValue>
Get additional metadata