Skip to content
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

response_schema not working with gemini-1.5-pro model #392

Closed
kunalhexus opened this issue Jun 19, 2024 · 3 comments
Closed

response_schema not working with gemini-1.5-pro model #392

kunalhexus opened this issue Jun 19, 2024 · 3 comments
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

Comments

@kunalhexus
Copy link

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#json

Thanks 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 prompt

Any other information you'd like to share?

No response

@singhniraj08
Copy link

@kunalhexus, I can see response_schema working with python sdk 0.5.4.
Ref: screenshot below.
Can you please share a reproducible code to replicate the error on our end. Thank you!

image

@singhniraj08 singhniraj08 added type:bug Something isn't working status:awaiting user response Awaiting a response from the author component:python sdk Issue/PR related to Python SDK labels Jun 20, 2024
Copy link

github-actions bot commented Jul 5, 2024

Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.

@github-actions github-actions bot added the status:stale Issue/PR will be closed automatically if there's no further activity label Jul 5, 2024
Copy link

This issue was closed because it has been inactive for 28 days. Please post a new issue if you need further assistance. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants