针对gemini进行图像格式转换

pull/1211/head
foxplaying 2025-08-22 03:54:12 +08:00 committed by GitHub
parent 05f6fdabe4
commit 3c9c83e00e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -60,8 +60,7 @@ def _convert_messages(messages: list[Message]) -> list[ChatCompletionMessagePara
content = [] content = []
for item in message.content: for item in message.content:
if isinstance(item, tuple): if isinstance(item, tuple):
# 修复图像格式处理 image_format = "jpeg" if "gemini-" in model_info.model_identifier and item[0].lower() == "jpg" else item[0].lower()
image_format = "jpeg" if item[0].lower() == "jpg" else item[0].lower()
content.append( content.append(
{ {
"type": "image_url", "type": "image_url",