Skip to content

Commit

Permalink
Added gemini-2 model
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Jan 14, 2025
1 parent 8fe3c19 commit 91f840c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 4 deletions.
58 changes: 55 additions & 3 deletions src/pygpt_net/data/config/models.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"__meta__": {
"version": "2.4.46",
"app.version": "2.4.46",
"updated_at": "2024-12-16T00:00:00"
"version": "2.4.47",
"app.version": "2.4.47",
"updated_at": "2025-01-14T00:00:00"
},
"items": {
"claude-3-5-sonnet-20240620": {
Expand Down Expand Up @@ -253,6 +253,58 @@
"tokens": 4096,
"default": false
},
"gemini-2.0-flash-exp": {
"id": "gemini-2.0-flash-exp",
"name": "gemini-2.0-flash-exp",
"mode": [
"llama_index",
"agent",
"agent_llama",
"expert"
],
"langchain": {
"provider": "google",
"mode": [
"chat"
],
"args": [
{
"name": "model",
"value": "gemini-2.0-flash-exp",
"type": "str"
}
],
"env": [
{
"name": "GOOGLE_API_KEY",
"value": "{api_key_google}"
}
]
},
"llama_index": {
"provider": "google",
"mode": [
"chat"
],
"args": [
{
"name": "model",
"value": "models/gemini-2.0-flash-exp",
"type": "str"
}
],
"env": [
{
"name": "GOOGLE_API_KEY",
"value": "{api_key_google}"
}
]
},
"ctx": 128000,
"tokens": 4096,
"default": false,
"multimodal": []
},
"gpt-3.5-turbo": {
"id": "gpt-3.5-turbo",
"name": "gpt-3.5-turbo",
Expand Down
8 changes: 7 additions & 1 deletion src/pygpt_net/provider/core/model/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# GitHub: https://github.com/szczyglis-dev/py-gpt #
# MIT License #
# Created By : Marcin Szczygliński #
# Updated Date: 2024.12.16 20:00:00 #
# Updated Date: 2025.01.14 14:00:00 #
# ================================================== #

from packaging.version import parse as parse_version, Version
Expand Down Expand Up @@ -469,6 +469,12 @@ def execute(self, version: Version) -> bool:
self.window.core.config.save()
updated = True

# < 2.4.47 <--- add gemini-2.0-flash-exp
if old < parse_version("2.4.47"):
print("Migrating models from < 2.4.47...")
# add gemini-2.0-flash-exp
updated = True

# update file
if updated:
data = dict(sorted(data.items()))
Expand Down

0 comments on commit 91f840c

Please sign in to comment.