fix(tools): use correct import path for mistralai SDK

mistralai v2.x is a namespace package — `Mistral` class lives at
`mistralai.client`, not at the top-level `mistralai` module. The
previous `from mistralai import Mistral` raises ImportError at runtime.

Update both production code and test fixture to use the correct path.
This commit is contained in:
jjovalle99 2026-04-06 18:27:56 +01:00 committed by Teknium
parent 5f4b93c20f
commit d46db0a1b4
2 changed files with 2 additions and 2 deletions

View file

@ -875,7 +875,7 @@ def mock_mistral_module():
mock_mistral_cls = MagicMock(return_value=mock_client)
fake_module = MagicMock()
fake_module.Mistral = mock_mistral_cls
with patch.dict("sys.modules", {"mistralai": fake_module}):
with patch.dict("sys.modules", {"mistralai": fake_module, "mistralai.client": fake_module}):
yield mock_client