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 Google Gemini #592

Open
danaiamirali opened this issue Apr 11, 2024 · 5 comments
Open

Add support for Google Gemini #592

danaiamirali opened this issue Apr 11, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@danaiamirali
Copy link

Is your feature request related to a problem? Please describe.
I'm currently working on a project using Gemini, and if this library supported Gemini that would've been great. Will likely be building my own instructor-esque solution to get structured output.

Describe the solution you'd like
Adding support for Gemini.

@dosubot dosubot bot added the enhancement New feature or request label Apr 11, 2024
@jxnl
Copy link
Owner

jxnl commented Apr 11, 2024

If you intend to build something instructor esqu, would love a contribution if you're willing.

@danaiamirali
Copy link
Author

Definitely willing to work on this. Unfortunately, it appears that at least as of now most forms of Gemini lacks any API parameters like OpenAI's response_format. Gemini 1.5 Pro, though, (which is luckily the model I will be using) does offer a JSON formatted response. I'll look into that and hopefully contribute.

@jxnl
Copy link
Owner

jxnl commented Apr 11, 2024

Yeah, I think what might need to happen is to find something that goes from PyDantic or JSON schema to Gemini's RPC model. which is a bit of a pain and why we avoided it so far. It might make sense to just have a ask for Jason mode in Gemini.

@Vasilije1990
Copy link

could this work with litellm or is it another type of an integration issue?

@danaiamirali
Copy link
Author

From my (very limited) knowledge of LiteLLM, their completions don't seem to support structured output?

I did end up making a hasty structured output solution for Gemini 1.5 Pro with the Gemini REST API (because their Python SDK unfortunately does not support JSON outputs fsr) for a Hackathon. Will look into cleaning it up and applying it to this repo for a PR if using the REST API is fine @jxnl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants