Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_framework_mistral-1.0.0b260813.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_framework_mistral-1.0.0b260813-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file agent_framework_mistral-1.0.0b260813.tar.gz.

File metadata

  • Download URL: agent_framework_mistral-1.0.0b260813.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_framework_mistral-1.0.0b260813.tar.gz
Algorithm Hash digest
SHA256 edc06cb4514def322161c4e6a22a10ccbdf352981d9f63a19e1aea3b684f6366
MD5 37969b8e7426c5e032a89b2d0a02a634
BLAKE2b-256 f580da02a96efbd20056281d9a4795d91430e2c24b7060a7ffeb1ec470920d08

See more details on using hashes here.

File details

Details for the file agent_framework_mistral-1.0.0b260813-py3-none-any.whl.

File metadata

  • Download URL: agent_framework_mistral-1.0.0b260813-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_framework_mistral-1.0.0b260813-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc313fc233fdbd8f231b829dbf891a6661a1ea174163c1449e9bca62f6a1e46
MD5 3d22ac28261c0fd9df5a5f4ae028460d
BLAKE2b-256 b3866bd0ce6a043131f96835ad2ad959c2707e2be6c1e3b01f6e995fb6a30f2c

See more details on using hashes here.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page