Replies: 3 comments 1 reply
-
|
We are using the zod4 internal tojsonschema for v4 schemas and you are right this might impact it. As a workaround, you could try using the |
Beta Was this translation helpful? Give feedback.
-
|
I also ran into this issue when upgrading from v4 to v5. In v4, setting I was able to re-enable strict mode for tool calls by passing providerOptions to streamText({
// ...
providerOptions: {
openai: {
strictJsonSchema: true,
},
},
// ...
});I think this is a regression and that |
Beta Was this translation helpful? Give feedback.
-
|
This discussion was automatically locked because it has not been updated in over 30 days. If you still have questions about this topic, please ask us at community.vercel.com/ai-sdk |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since I have migrated to the v5, I can observe a drop of accuracy on complex generations using zod 4 schemas.
I have migrated from z.lazy to new getter method and get rid of all
.transformsas the internal zod method to convert zod to json does not accepts them (while zod-to-json-schema was fine with them).The problem is probably coming from my schema definition, but they worked very well on the v4 with the same models.
Maybe the conversion of json to zod via a third party library was producing better outputs ?
Don't want to open an issue as it's probably one of my own mistake, but if someone face the same problem please let me know.
Beta Was this translation helpful? Give feedback.
All reactions