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

Adding Google Gemini Chat integration to Vanna #356

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

vipgupta
Copy link
Contributor

As a frequent user of Vanna in my projects, I've successfully integrated Google Gemini Chat with Vanna. I believe this integration could be valuable to other users, so I've submitted this pull request to share my work with the community. This addition enables seamless integration of Google Gemini Chat with Vanna (both through API key and Vertex AI), potentially enhancing its functionality for users who require Gemini chat capabilities.

@zainhoda
Copy link
Contributor

@vipgupta awesome! Thank you! I had started playing with Gemini but I couldn't find a good way to get the system prompt in there as it didn't seem like Gemini had an option to set the system prompt.

In this code, it seems like the messages are being flattened to strings and then the prompt is a list of strings without role? This is an interesting approach. I'll check it out. Did you find that it actually works?

@vipgupta
Copy link
Contributor Author

@zainhoda Yes it works! Verified it both with Vertex AI and Google AI studio API key. Yes, Gemini doesn't have a differentiation between a system prompt and a user prompt, and this approach of flattening the messaged worked. We are using it in our project for SQL query generation :)

@vipgupta
Copy link
Contributor Author

@zainhoda Can you review the PR? Also, here's a thread on people complaining about Gemini not having a system prompt and using the flattening out approach.

@zainhoda
Copy link
Contributor

@vipgupta the code looks good. I’m just going to test it with my own account first and add this to the list of integration tests

@vipgupta
Copy link
Contributor Author

vipgupta commented Apr 16, 2024 via email

@zainhoda zainhoda merged commit d2a5cf0 into vanna-ai:main Apr 16, 2024
@zainhoda zainhoda mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants