Mistral AI integration for Microsoft Agent Framework.
Project Links
Meta
Author: Microsoft
Requires Python: >=3.10
Classifiers
License
- OSI Approved :: MIT License
Development Status
- 4 - Beta
Intended Audience
- Developers
Programming Language
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
Framework
- Pydantic :: 2
Typing
- Typed
Get Started with Microsoft Agent Framework Mistral AI
Please install this package:
pip install agent-framework-mistral --pre
and see the README for more information.
See the Mistral agent sample and the Mistral embedding sample for runnable examples.
Chat Client
The MistralChatClient provides chat completions using Mistral AI models, with support for
streaming, function tools, and structured output.
Quick Start
from agent_framework import Agent
from agent_framework.mistral import MistralChatClient
# Using environment variables (MISTRAL_API_KEY, MISTRAL_CHAT_MODEL)
# Parameters can also be passed directly:
# MistralChatClient(model="mistral-large-latest", api_key="your-api-key")
client = MistralChatClient()
try:
agent = Agent(client=client, instructions="You are a helpful assistant.")
response = await agent.run("Hello!")
print(response.text)
finally:
await client.close()
Configuration
| Environment Variable | Description |
|---|---|
MISTRAL_API_KEY |
Your Mistral AI API key |
MISTRAL_CHAT_MODEL |
Chat model name (e.g., mistral-large-latest) |
MISTRAL_SERVER_URL |
Optional server URL override |
Chat connection settings belong on the client, not on individual requests. Both
MistralChatClient and RawMistralChatClient reject server_url, http_headers,
retries, and timeout_ms in per-call options or client_kwargs. Configure
the endpoint with the constructor's server_url, or inject a configured SDK
client or http_client. Normal model generation options remain per-call.
Embedding Client
The MistralEmbeddingClient provides embedding generation using Mistral AI models.
Quick Start
from agent_framework.mistral import MistralEmbeddingClient
# Using environment variables (MISTRAL_API_KEY, MISTRAL_EMBEDDING_MODEL)
client = MistralEmbeddingClient()
try:
# Parameters can also be passed directly:
# MistralEmbeddingClient(model="mistral-embed", api_key="your-api-key")
result = await client.get_embeddings(["Hello, world!", "How are you?"])
for embedding in result:
print(f"Dimensions: {embedding.dimensions}")
print(f"Vector: {embedding.vector[:5]}...")
finally:
await client.close()
Configuration
| Environment Variable | Description |
|---|---|
MISTRAL_API_KEY |
Your Mistral AI API key |
MISTRAL_EMBEDDING_MODEL |
Embedding model name (e.g., mistral-embed) |
MISTRAL_SERVER_URL |
Optional server URL override |
1.0.0b260918
Sep 18, 2026
1.0.0b260903
Sep 03, 2026
1.0.0b260827
Aug 28, 2026
1.0.0b260813
Aug 14, 2026
1.0.0b260730
Jul 30, 2026
1.0.0b260721
Jul 21, 2026
1.0.0a260709
Jul 10, 2026
1.0.0a260604
Jun 04, 2026