-
-
Notifications
You must be signed in to change notification settings - Fork 334
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 #666
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
I followed the instructions from here to test the new Gemini provider. However, it does not show up on the model list. Any advice? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giswqs Thank you very much for your contribution! This will be really useful once it's released. There remains only a minor concern that needs to be addressed.
It would also be helpful if you could include a screenshot (or preferably a video) of Gemini working in Jupyter AI after making these changes. That would help verify that this PR behaves as expected. 👍
@dlqqq I have made the changes as suggested, but Gemini still does not show up on the provider list. Anything else I should change? The following code snippet works without the jupyter-ai magic command. from langchain_google_genai import GoogleGenerativeAI
llm = GoogleGenerativeAI(model="gemini-pro")
result = llm.invoke("Write a ballad about LangChain")
print(result) |
There are more Gemini models available. Let me work on adding them. |
I have added a few more gemini models to the list. https://ai.google.dev/api/python/google/generativeai # pip install google-generativeai
import pprint
import google.generativeai as genai
for model in genai.list_models():
pprint.pprint(model.name) |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@giswqs Awesome work, thank you! I've rebased this branch on the latest main
and fixed the merge conflicts. Will merge this, pending passing CI. 🚀
I had missed your question earlier in my review, my apologies. You are correct in recognizing that you need to run jlpm dev-install
if you are updating the entry points in pyproject.toml
. I've opened a new issue to add this info to the contributor documentation, so other contributors won't experience the same pain point. 👍
@meeseeksdev please backport to 1.x |
Co-authored-by: Qiusheng Wu <[email protected]>
* Add Gemini Provider * Rename GeminiAI * Use VertexAI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change back to langchain-google-genai * Add gemini as a partner provider * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add more gemini models * Add Gemini to docs --------- Co-authored-by: David L. Qiu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add Gemini Provider * Rename GeminiAI * Use VertexAI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change back to langchain-google-genai * Add gemini as a partner provider * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add more gemini models * Add Gemini to docs --------- Co-authored-by: David L. Qiu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This is an attempt to add support for Google Gemini API.
@simonff @richlysakowski @3coins
Reference: #395
https://python.langchain.com/docs/integrations/llms/google_ai