Skip to content

Commit

Permalink
🐛 Bug: 1. Fix the bug where the OpenRouter channel cannot use image Q&A.
Browse files Browse the repository at this point in the history
2. Fix the bug where the grok model was assigned to the openrouter channel.

💰 Sponsors: Thanks to @powerhunter for the ¥2000 sponsorship, sponsorship information has been added to the README.
  • Loading branch information
yym68686 committed Nov 27, 2024
1 parent 644ed2c commit 98d7582
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ async def process_request(request: Union[RequestModel, ImageGenerationRequest, A
and "gpt" not in original_model \
and "o1" not in original_model \
and "gemini" not in original_model \
and "grok" not in original_model \
and parsed_url.netloc != 'api.cloudflare.com' \
and parsed_url.netloc != 'api.cohere.com':
engine = "openrouter"
Expand Down
2 changes: 1 addition & 1 deletion request.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def get_image_message(base64_image, engine = None):
semicolon_index = base64_image.index(";")
image_type = base64_image[colon_index + 1:semicolon_index]

if "gpt" == engine:
if "gpt" == engine or "openrouter" == engine:
return {
"type": "image_url",
"image_url": {
Expand Down

0 comments on commit 98d7582

Please sign in to comment.