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 GEMINI Pro langchain genai support #207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lienchen0526
Copy link

Why this changes made?

It mainly to resolve issue. There are two ways to access Google Gemini API, by VertexAI or by API directly. Currently, OpenGPTs default supports the first way (VertexAI). It can be more flexible if we allow user to choose between this two.

What does this changes made?

GEMINI_GENAI is added to LLMType and AgentType in the backend code. And the ability of def get_google_llm in llm.py is extended to make user to select to use genai based endpoint or vertexai endpoint. (Which default to be vertexai)

Effect

After this change, we only have to add GOOGLE_API_KEY in .env, so we can use genai based GEMINI Pro.

@ptgoetz ptgoetz added models Adds or updates LLM model support backend Changes to the backend service labels Apr 16, 2024
Copy link
Collaborator

@ptgoetz ptgoetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about changes to pyproject.toml.


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a wholesale replacement of pyproject.toml. Can you limit it to only necessary changes or explain why a wholesale replacement is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Changes to the backend service models Adds or updates LLM model support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can i set the gemini api key?
3 participants