Skip to content

Commit

Permalink
🐛 Bug: Fix image input bug in o1-mini model
Browse files Browse the repository at this point in the history
💻 Code: Change request header to curl/7.68.0
  • Loading branch information
yym68686 committed Dec 7, 2024
1 parent 89ab406 commit c211d80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ async def ensure_config(request: Request, call_next):

default_config = {
"headers": {
"User-Agent": "OpenAI/Python 1.55.3",
"User-Agent": "curl/7.68.0",
"Accept": "*/*",
},
"http2": True,
Expand Down
2 changes: 1 addition & 1 deletion request.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ async def get_gpt_payload(request, engine, provider):
if item.type == "text":
text_message = await get_text_message(msg.role, item.text, engine)
content.append(text_message)
elif item.type == "image_url" and provider.get("image", True):
elif item.type == "image_url" and provider.get("image", True) and "o1-mini" not in model:
image_message = await get_image_message(item.image_url.url, engine)
content.append(image_message)
else:
Expand Down

0 comments on commit c211d80

Please sign in to comment.