-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
must be specified when not using one_of - error on structured output using zod on google provider #4153
Comments
Hi there, we are looking into this, thanks for raising. In the immediate term as a workaround, it looks like if you define separate schemas for Morning and Evening products (even if the definition is the same) it will fix the issue.
Another workaround is to disable structured outputs:
|
I'm also getting an error on the json schema that's created from the zod when calling Gemini.
This somehow gets mangled before its sent in the HTTP request.
|
I'm also getting this with gemini. and zod:
edit: seems related: https://discuss.ai.google.dev/t/oneof-in-response-schema/55926/8 |
This might require several fixes. Fix for main reported bug: #4370 |
@marko911 can you trying using z.object instead of z.record? |
@agamm |
@lgrammel with original schema getting:
after trying the discriminated union I get:
Can I open this issue or another one? @lgrammel EDIT:
|
@agamm Yes - pls open another issue and attach the call(s) incl. schema that you are making. |
Description
This is the error I get when I try to stream a structured response using the schema below on google-experimental-1206 model.
Code example
AI provider
^4.0.20 and 1.0.10 for google provider.
|
Additional context
No response
The text was updated successfully, but these errors were encountered: