Skip to content

Support legacy mistralai client imports#2197

Open
LittleChenLiya wants to merge 1 commit into567-labs:mainfrom
LittleChenLiya:fix-mistral-import-compat
Open

Support legacy mistralai client imports#2197
LittleChenLiya wants to merge 1 commit into567-labs:mainfrom
LittleChenLiya:fix-mistral-import-compat

Conversation

@LittleChenLiya
Copy link
Copy Markdown

Summary

Support mistralai layouts where Mistral is exposed from mistralai.client instead of the package root.

This keeps Mistral provider initialization working across both import styles and avoids breaking the provider path when the top-level import is unavailable.

Changes

  • add a fallback import for Mistral in the Mistral provider client
  • add the same fallback in from_provider(..., provider="mistral")
  • add a regression test covering the legacy mistralai.client.Mistral import path

Testing

  • python -m pytest tests/test_auto_client.py -k "mistral_provider_falls_back_to_legacy_client_module_import or invalid_provider_format or unsupported_provider"
  • python -m pytest tests/test_auto_client.py -k "google_provider_runtime_import_error_propagates or generative_ai_provider_runtime_import_error_propagates"

Closes #2137

@LittleChenLiya
Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: New Mistralai version 2.0.0 released 3h ago breaks instructor

1 participant