Closed PCloud-Bernard closed 3 weeks ago
If the only thing you're changing is the model name, this is likely to be an issue with the underlying service or model, not the Go SDK. Please consider asking on the general support forum https://discuss.ai.google.dev/ -- where folks who use other languages could also have encountered this issue
After asking on the general support forum, I've gotten the answer. I might as well update here for people who want to know as well.
gemini-1.5-flash
only accepts JSON schema from text, as in prompt or system instruction, whereas gemini-1.5-pro
takes schema object.
The documentation and cookbook shows how to define schemas in different models.
Description of the bug:
While using
gemini-1.5-flash
, no matter how I define the response schema, it does not respect the defined schema butgemini-1.5-pro-latest
does not have this issue.Code snippet:
Actual vs expected behavior:
Actual Response:
Expected Response:
Any other information you'd like to share?
No response