From 93bfb966ea1be3dde5a7a8e444dda61a0dbfbc4d Mon Sep 17 00:00:00 2001 From: Asankilp Date: Fri, 5 Sep 2025 15:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=A4=84=E7=90=86=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=9A=84=E6=84=8F=E5=A4=96=20application/octet-stream?= =?UTF-8?q?=20=EF=BC=8C=E5=85=BC=E5=AE=B9matcha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonebot_plugin_marshoai/util.py b/nonebot_plugin_marshoai/util.py index 8292211..78a1011 100755 --- a/nonebot_plugin_marshoai/util.py +++ b/nonebot_plugin_marshoai/util.py @@ -83,6 +83,8 @@ async def get_image_raw_and_type( content_type = response.headers.get("Content-Type") if not content_type: content_type = mimetypes.guess_type(url)[0] + if content_type == "application/octet-stream": # matcha 兼容 + content_type = "image/jpeg" # image_format = content_type.split("/")[1] if content_type else "jpeg" return response.content, str(content_type) else: @@ -125,7 +127,7 @@ async def make_chat_openai( model_name: 指定AI模型名 tools: 工具列表 """ - print(msg) + # print(msg) return await client.chat.completions.create( # type: ignore messages=msg, model=model_name,