pub trait Embedder: Send + Sync {
// Required methods
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: &'life1 [Vec<ContentPart>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbedError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn dimension(&self) -> usize;
fn provider_name(&self) -> &str;
fn model_name(&self) -> &str;
// Provided method
fn embed_one<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, EmbedError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Core trait for generating multimodal embeddings.
Required Methods§
Sourcefn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: &'life1 [Vec<ContentPart>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbedError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: &'life1 [Vec<ContentPart>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbedError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Embed a slice of multimodal content, returning one Vec<f32> per input.
Sourcefn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider identifier used for store compatibility checks.
Sourcefn model_name(&self) -> &str
fn model_name(&self) -> &str
Model identifier used for store compatibility checks.