pub trait MultimodalEmbeddingModel: ModelInfo {
// Required methods
fn embed<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<MultimodalInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn dimensions(&self) -> u32;
fn supported_modalities(&self) -> &[Modality];
// Provided method
fn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A model that produces a single dense vector from heterogeneous content (text + image + audio together).
Supports models like Cohere Embed v4, Jina Embeddings v4, and Gemini Embedding 2 that map mixed-modality inputs into a single shared embedding space.
Required Methods§
Sourcefn embed<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<MultimodalInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<MultimodalInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Embed a batch of mixed-modality inputs.
Each MultimodalInput produces one vector spanning all its blocks.
§Errors
Returns an error if the provider rejects an unsupported modality combination or runs out of memory.
Sourcefn dimensions(&self) -> u32
fn dimensions(&self) -> u32
The dimensionality of vectors produced by this model.
Sourcefn supported_modalities(&self) -> &[Modality]
fn supported_modalities(&self) -> &[Modality]
Modalities accepted by this model (e.g. &[Text, Image] for Cohere
Embed v4 vs &[Text, Image, Audio, Video] for Gemini Embedding 2).