From 1f4658874969e23f8a3ee41c6b1694af7c1b62c1 Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Sun, 20 Apr 2025 17:31:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=87=8F=E5=B0=91=E8=A1=A8=E6=83=85?= =?UTF-8?q?=E5=8C=85=E5=9C=A8prompt=E4=B8=AD=E7=9A=84=E5=8D=A0=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/chat/utils_image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/chat/utils_image.py b/src/plugins/chat/utils_image.py index acdbab011..89d9f8332 100644 --- a/src/plugins/chat/utils_image.py +++ b/src/plugins/chat/utils_image.py @@ -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: