-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Feat(mistral) use actual response format #6327
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(mistral) use actual response format #6327
Conversation
this is great! we have switch dev to the |
Sure can do (will do in a new PR tonight). Do we happen to have an ETA for v5? My company is running into issues during testing, and we would like to use this asap. (Also thank you for the quick reply) |
We can fix on main and v5. Having 2 prs works! |
also, can you add a test? |
Could you point me to a file I can use as a test base? (So I know in which way I should exactly write the test?) |
|
@lgrammel Fixed a bug and added a test case. Good to merge now. |
'@ai-sdk/mistral': minor | ||
'ai': minor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls change to patch
responseFormat: { | ||
schema: outputStrategy.jsonSchema, | ||
type: 'json', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the object json mode mode.schema should be used. pls remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is the mode not depricated?
The reason why I added responseFormat there was that I've seen that mistral (and I assume others) handle it with a warning, but responseFormat was from what Ive seen never set if you passed on an schema. if I remove this I have to modify my code to handle the schema by the depricated mode field.
If you are still set on removal of this I can do that.
Background
Currently when calling the mistral AI we are passing on the response schema as an message, but do not actually make use of the structured output endpoint. This commit changes that.
Summary
Verification
I manually ran the mistral file inside of the ai core generate-object endpoint. And it worked now as expected. (I would prefer if someone could look over it as well to be certain and test if my ResponseFormat fix actually impacted other packages. (Many packages have error handling for ResponseFormat / warnings for it, but since it always returned undefined those we're never invoked (from what I know, I did not check other packages besides mistral and a bit openai)
Tasks
pnpm changeset
in the project root)pnpm prettier-fix
in the project root)Future Work
People would now need to go around and update all other packages to move away from the depricated mode field. This should lay the first step to make ResponseFormat usuable.
Related Issues
Did not check.