pub struct MistralEmbedProvider { /* private fields */ }Expand description
Embedding provider backed by the Mistral AI embeddings API.
Default model: mistral-embed (1024 dims). Mistral’s embedding endpoint
follows an OpenAI-compatible request/response shape.
Implementations§
Source§impl MistralEmbedProvider
impl MistralEmbedProvider
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create a new Mistral provider with the default model (mistral-embed).
Sourcepub fn with_model(
api_key: impl Into<String>,
model: impl Into<String>,
dimensions: usize,
) -> Self
pub fn with_model( api_key: impl Into<String>, model: impl Into<String>, dimensions: usize, ) -> Self
Create with an explicit model and dimension override.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Override the API base URL.
Sourcepub fn build_payload(&self, texts: &[String]) -> Value
pub fn build_payload(&self, texts: &[String]) -> Value
Build the request payload for the Mistral embeddings API.
Trait Implementations§
Source§impl EmbeddingProvider for MistralEmbedProvider
impl EmbeddingProvider for MistralEmbedProvider
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compute embedding vector for a single text.
Source§fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compute embeddings for a batch of texts.
Auto Trait Implementations§
impl Freeze for MistralEmbedProvider
impl RefUnwindSafe for MistralEmbedProvider
impl Send for MistralEmbedProvider
impl Sync for MistralEmbedProvider
impl Unpin for MistralEmbedProvider
impl UnsafeUnpin for MistralEmbedProvider
impl UnwindSafe for MistralEmbedProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more