优化图片格式处理,统一将'jpg'格式转换为'jpeg',新增标准化和MIME类型转换功能,以确保API兼容性和提高代码可读性(最主要的还是为了gemini)

This commit is contained in:
minecraft1024a
2025-08-13 13:20:15 +08:00
committed by Windpicker-owo
parent e6976e4e50
commit 1e785a117d
5 changed files with 82 additions and 5 deletions

View File

@@ -957,7 +957,7 @@ class EmojiManager:
raise RuntimeError("GIF表情包转换失败")
prompt = "这是一个动态图表情包,每一张图代表了动态图的某一帧,黑色背景代表透明,描述一下表情包表达的情感和内容,描述细节,从互联网梗,meme的角度去分析"
description, _ = await self.vlm.generate_response_for_image(
prompt, image_base64, "jpg", temperature=0.3, max_tokens=1000
prompt, image_base64, "jpeg", temperature=0.3, max_tokens=1000
)
else:
prompt = (