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.
Backport PR jupyterlab#666: Add support for Gemini
- Loading branch information
1 parent
7483987
commit 7ac2539
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