pub struct Mistral { /* private fields */ }Expand description
Mistral provider handle — entry point for model construction.
Cheap to clone; the underlying HTTP client and headers are shared.
Implementations§
Source§impl Mistral
impl Mistral
Sourcepub fn builder() -> MistralBuilder
pub fn builder() -> MistralBuilder
Open a MistralBuilder.
Sourcepub fn from_env() -> Result<Self, ProviderError>
pub fn from_env() -> Result<Self, ProviderError>
Build with defaults: API key from MISTRAL_API_KEY, default base URL.
§Errors
Returns ProviderError::load_api_key when the env var is unset
or empty.
Sourcepub fn chat(&self, model_id: impl Into<String>) -> MistralChatModel
pub fn chat(&self, model_id: impl Into<String>) -> MistralChatModel
Construct a Chat Completions model handle.
model_id is the Mistral model name, e.g. "mistral-large-latest".
Sourcepub fn language_model(&self, model_id: impl Into<String>) -> MistralChatModel
pub fn language_model(&self, model_id: impl Into<String>) -> MistralChatModel
Alias of Self::chat — mirrors ai-sdk’s provider.languageModel(id).
Sourcepub fn embedding(&self, model_id: impl Into<String>) -> MistralEmbeddingModel
pub fn embedding(&self, model_id: impl Into<String>) -> MistralEmbeddingModel
Construct a text-embedding model handle.
model_id is the Mistral embedding model name, e.g.
"mistral-embed" or "codestral-embed".
Sourcepub fn embedding_model(
&self,
model_id: impl Into<String>,
) -> MistralEmbeddingModel
pub fn embedding_model( &self, model_id: impl Into<String>, ) -> MistralEmbeddingModel
Alias of Self::embedding — mirrors ai-sdk’s provider.embeddingModel(id).
Sourcepub fn text_embedding(
&self,
model_id: impl Into<String>,
) -> MistralEmbeddingModel
pub fn text_embedding( &self, model_id: impl Into<String>, ) -> MistralEmbeddingModel
Deprecated alias of Self::embedding retained for ai-sdk parity.
Sourcepub fn text_embedding_model(
&self,
model_id: impl Into<String>,
) -> MistralEmbeddingModel
pub fn text_embedding_model( &self, model_id: impl Into<String>, ) -> MistralEmbeddingModel
Deprecated alias of Self::embedding_model retained for ai-sdk parity.