forked from jupyterlab/jupyter-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Gemini (jupyterlab#666)
* 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>
- Loading branch information
Showing
5 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/gemini.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from jupyter_ai_magics.providers import BaseProvider, EnvAuthStrategy | ||
from langchain_google_genai import GoogleGenerativeAI | ||
|
||
|
||
class GeminiProvider(BaseProvider, GoogleGenerativeAI): | ||
id = "gemini" | ||
name = "Gemini" | ||
models = [ | ||
"gemini-1.0-pro", | ||
"gemini-1.0-pro-001", | ||
"gemini-1.0-pro-latest", | ||
"gemini-1.0-pro-vision-latest", | ||
"gemini-pro", | ||
"gemini-pro-vision", | ||
] | ||
model_id_key = "model" | ||
auth_strategy = EnvAuthStrategy(name="GOOGLE_API_KEY") | ||
pypi_package_deps = ["langchain-google-genai"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters