mirror of https://github.com/Mai-with-u/MaiBot.git
针对gemini进行图像格式转换
parent
05f6fdabe4
commit
3c9c83e00e
|
|
@ -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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue