Description
mistralai v2.0.0 (released 2026-03-11) changed the import path for the Mistral client class:
# v1.x
import mistralai
mistralai.Mistral(...) # works
# v2.x
import mistralai
mistralai.Mistral(...) # AttributeError: module 'mistralai' has no attribute 'Mistral'
# v2.x correct import:
from mistralai.client import Mistral
The strands.models.mistral module uses import mistralai at line 11 and mistralai.Mistral(...) at lines 431, 439, 532, which breaks with v2.0.
Since strands-agents doesn't pin mistralai<2.0, installing/upgrading in a fresh environment pulls v2.0.4 and breaks all Mistral model usage.
Impact
Suggested Fix
Add a compatibility shim in strands/models/mistral.py:
# Support both mistralai v1.x and v2.x import paths
try:
from mistralai.client import Mistral as MistralClient
except ImportError:
from mistralai import Mistral as MistralClient
Then replace mistralai.Mistral(...) with MistralClient(...) at lines 431, 439, 532.
Alternatively, pin mistralai>=1.9.11,<2.0 in the [mistral] extra dependencies until a full v2 migration is done.
Reproduction
pip install 'strands-agents[mistral]'
# Pulls mistralai 2.0.4
python -c "from strands.models.mistral import MistralModel; print('OK')"
# Works (import doesn't trigger the error)
# But using the model fails:
python -c "
from strands.models.mistral import MistralModel
import asyncio
m = MistralModel(model_id='mistral-small-latest')
# Any call that triggers stream() or structured_output() will fail with:
# AttributeError: module 'mistralai' has no attribute 'Mistral'
"
Environment
- strands-agents: 1.19.0
- mistralai: 2.0.4 (breaks) / 1.12.4 (works)
- Python: 3.11
Description
mistralaiv2.0.0 (released 2026-03-11) changed the import path for theMistralclient class:The
strands.models.mistralmodule usesimport mistralaiat line 11 andmistralai.Mistral(...)at lines 431, 439, 532, which breaks with v2.0.Since
strands-agentsdoesn't pinmistralai<2.0, installing/upgrading in a fresh environment pulls v2.0.4 and breaks all Mistral model usage.Impact
strands-agents[mistral]failsmistralai<2.0as a workaroundSuggested Fix
Add a compatibility shim in
strands/models/mistral.py:Then replace
mistralai.Mistral(...)withMistralClient(...)at lines 431, 439, 532.Alternatively, pin
mistralai>=1.9.11,<2.0in the[mistral]extra dependencies until a full v2 migration is done.Reproduction
Environment