fix:减少表情包在prompt中的占比

This commit is contained in:
SengokuCola
2025-04-20 17:31:34 +08:00
parent ed21af9dba
commit 1f46588749

View File

@@ -113,21 +113,21 @@ class ImageManager:
cached_description = self._get_description_from_db(image_hash, "emoji")
if cached_description:
# logger.debug(f"缓存表情包描述: {cached_description}")
return f"[表情包{cached_description}]"
return f"[表达了{cached_description}]"
# 调用AI获取描述
if image_format == "gif" or image_format == "GIF":
image_base64 = self.transform_gif(image_base64)
prompt = "这是一个动态图表情包,每一张图代表了动态图的某一帧,黑色背景代表透明,使用中文简洁的描述一下表情包的内容和表达的情感,简短一些"
prompt = "这是一个动态图表情包,每一张图代表了动态图的某一帧,黑色背景代表透明,使用一个词描述一下表情包表达的情感,简短一些"
description, _ = await self._llm.generate_response_for_image(prompt, image_base64, "jpg")
else:
prompt = "这是一个表情包,使用中文简洁的描述一下表情包的内容和表情包所表达的情感"
prompt = "这是一个表情包,描述一下表情包所表达的情感,请用使用一个词"
description, _ = await self._llm.generate_response_for_image(prompt, image_base64, image_format)
cached_description = self._get_description_from_db(image_hash, "emoji")
if cached_description:
logger.warning(f"虽然生成了描述,但是找到缓存表情包描述: {cached_description}")
return f"[表情包{cached_description}]"
return f"[表达了{cached_description}]"
# 根据配置决定是否保存图片
if global_config.EMOJI_SAVE: