From cc6cd96d8e8b0df3d50c63d1c481bd8f79d8ded1 Mon Sep 17 00:00:00 2001 From: Raven95676 Date: Fri, 11 Apr 2025 11:03:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/provider/sources/gemini_source.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/provider/sources/gemini_source.py b/astrbot/core/provider/sources/gemini_source.py index 527ebf348..b2fd0a429 100644 --- a/astrbot/core/provider/sources/gemini_source.py +++ b/astrbot/core/provider/sources/gemini_source.py @@ -375,7 +375,10 @@ class ProviderGoogleGenAI(Provider): 组装上下文。 """ if image_urls: - user_content = {"role": "user", "content": [{"type": "text", "text": text}]} + user_content = { + "role": "user", + "content": [{"type": "text", "text": text if text else "[图片]"}], + } for image_url in image_urls: if image_url.startswith("http"): image_path = await download_image_by_url(image_url)