Skip to content

Commit

Permalink
🐛 Bug: Fix the bug of incorrect image recognition request format when…
Browse files Browse the repository at this point in the history
… using the Gemini official API.

Fix the bug where Gemini cannot customize system prompts.
  • Loading branch information
yym68686 committed Oct 17, 2024
1 parent eb12197 commit 1e075df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="modelmerge",
version="0.11.56",
version="0.11.57",
description="modelmerge is a multi-large language model API aggregator.",
long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/ModelMerge/models/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def add_to_conversation(
Add a message to the conversation
"""

if convo_id not in self.conversation or pass_history <= 2:
if convo_id not in self.conversation:
self.reset(convo_id=convo_id)
# print("message", message)

Expand Down
2 changes: 1 addition & 1 deletion src/ModelMerge/utils/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_image_message(image_url, message, engine = None):
if "gpt-4" in engine \
or (os.environ.get('claude_api_key', None) is None and "claude-3" in engine) \
or (os.environ.get('GOOGLE_AI_API_KEY', None) is None and "gemini" in engine) \
or (os.environ.get('VERTEX_CLIENT_EMAIL', None) is None and os.environ.get('VERTEX_PRIVATE_KEY', None) is None and os.environ.get("VERTEX_PROJECT_ID", None) is None and "gemini" in engine):
or (os.environ.get('GOOGLE_AI_API_KEY', None) is None and os.environ.get('VERTEX_CLIENT_EMAIL', None) is None and os.environ.get('VERTEX_PRIVATE_KEY', None) is None and os.environ.get("VERTEX_PROJECT_ID", None) is None and "gemini" in engine):
message.append(
{
"type": "image_url",
Expand Down

0 comments on commit 1e075df

Please sign in to comment.