-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(api): migrate Mistral provider to AI SDK #11089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(api): migrate Mistral provider to AI SDK #11089
Conversation
- Replace @mistralai/mistralai SDK with @ai-sdk/mistral v3.0.0 - Use streamText and generateText from AI SDK v6 - Add comprehensive test suite with 23 tests - Maintain support for Codestral models with custom base URL EXT-692
All issues have been resolved. Ready for merge.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Address review comment - ensure temperature defaults to 1 (MISTRAL_DEFAULT_TEMPERATURE) instead of 0 from getModelParams to match original behavior.
|
@roomote please fix the compile and knip errors |
Fixed the reported issues. All local checks passed. |
|
@roomote can you resolve the conflicts with main one more time? |
Resolved merge conflicts with main. All local checks passed. |
- Add handleAiSdkError to imports from ../transform/ai-sdk - Wrap stream processing in try/catch block - Handle AI_RetryError, AI_APICallError, etc. with proper error transformation Addresses review comment about missing error handling for AI SDK errors.
Summary
Migrate the Mistral provider from using the direct
@mistralai/mistralaiSDK to the AI SDK's dedicated@ai-sdk/mistralpackage.Changes
1.
src/api/providers/mistral.ts@mistralai/mistralaiSDK with@ai-sdk/mistralcreateMistralto create the provider instancestreamTextandgenerateTextfrom the AI SDK v6 for completions2.
src/package.json@ai-sdk/mistral: ^3.0.0to dependencies (v3.x required for AI SDK v6 compatibility)3.
src/api/providers/__tests__/mistral.spec.tsTesting
Linear
Resolves EXT-692
Important
Migrates Mistral provider to AI SDK, updating dependencies and tests for compatibility.
mistral.tsfrom@mistralai/mistralaito@ai-sdk/mistral.createMistral,streamText, andgenerateTextfor completions.mistral.spec.tsto mock@ai-sdk/mistralandaifunctions.@ai-sdk/mistral: ^3.0.0topackage.jsondependencies.This description was created by
for fb0bc26. You can customize this summary. It will automatically update as commits are pushed.