fix: 修复潜在的空消息

This commit is contained in:
Raven95676
2025-04-11 11:03:17 +08:00
parent 4244d37625
commit cc6cd96d8e
@@ -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)