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

Add support for Gemini Structured Outputs #472

Open
willbakst opened this issue Sep 5, 2024 · 3 comments
Open

Add support for Gemini Structured Outputs #472

willbakst opened this issue Sep 5, 2024 · 3 comments
Assignees
Labels
Feature Request New feature or request good first issue Good for newcomers

Comments

@willbakst
Copy link
Contributor

Description

Recently Google released Structured Outputs for Gemini (much like OpenAI).

Should be fairly simple to enable this by updating setup_call for gemini and updating the warning to include gemini as a module that supports strict in the response model schema (although it seems like structured outputs for tools is not quite supported).

See: https://ai.google.dev/gemini-api/docs/json-mode?lang=python#supply-schema-in-config

Only difficulty I can see right now is that the only two supported inputs are either raw type annotations (so no BaseModel) or their genai.protos.Schema type (which will require conversion from BaseModel). Should have most of this implemented already I believe, so still shouldn't be terribly difficult.

@willbakst willbakst added the Feature Request New feature or request label Sep 5, 2024
@willbakst willbakst added the good first issue Good for newcomers label Sep 20, 2024
@willbakst willbakst added the hacktoberfest Hacktoberfest! label Oct 16, 2024
@AbhishekRP2002
Copy link

hi @willbakst if this issue's still open, I would love to take this up!

@willbakst willbakst removed the hacktoberfest Hacktoberfest! label Nov 4, 2024
@willbakst
Copy link
Contributor Author

@AbhishekRP2002 it's open! would love for you to take this

if you have any questions let me know! our implementation of OpenAI structured outputs should act as a good reference

@AbhishekRP2002
Copy link

sure, will let you know if there's any blocker in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants