response_schema not working with gemini-1.5-pro model #392
Labels
component:python sdk
Issue/PR related to Python SDK
status:awaiting user response
Awaiting a response from the author
status:stale
Issue/PR will be closed automatically if there's no further activity
type:bug
Something isn't working
Description of the bug:
I ended up wasting 2 hours on trying to get it to work after seeing the official documentation for
contstrained generation
on https://ai.google.dev/gemini-api/docs/api-overview#jsonThanks for the pro tip of adding the schema to system prompt mentioned on #343 I was finally able to get it working.
The code generated on https://aistudio.google.com/ is also exteremly deceptive as it makes you input the schema making you believe that constrained generation is working and gives back the code which has no reference to JSON schema specified in Advanced Settings
Actual vs expected behavior:
response_schema
in model configuration should be respected without having to explcitly add the whole schema to system promptAny other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered: