mirror of https://github.com/Mai-with-u/MaiBot.git
pull/541/head
parent
fa9309b2c2
commit
49f57c2364
|
|
@ -169,8 +169,6 @@ class ChatBot:
|
|||
config=global_config,
|
||||
is_emoji=message.is_emoji,
|
||||
interested_rate=interested_rate,
|
||||
|
||||
|
||||
)
|
||||
current_willing = willing_manager.get_willing(chat_stream=chat)
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,6 @@ class CQCode:
|
|||
|
||||
return None
|
||||
|
||||
|
||||
def translate_image(self) -> Optional[str]:
|
||||
"""处理图片类型的CQ码,返回base64字符串"""
|
||||
if "url" not in self.params:
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ class EmojiManager:
|
|||
|
||||
async def _get_emoji_discription(self, image_base64: str) -> str:
|
||||
"""获取表情包的标签,使用image_manager的描述生成功能"""
|
||||
|
||||
|
||||
try:
|
||||
# 使用image_manager获取描述,去掉前后的方括号和"表情包:"前缀
|
||||
description = await image_manager.get_emoji_description(image_base64)
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ class ImageManager:
|
|||
# 调用AI获取描述
|
||||
prompt = "请用中文描述这张图片的内容。如果有文字,请把文字都描述出来。并尝试猜测这个图片的含义。最多200个字,可以使用二次元词汇。"
|
||||
description, _ = await self._llm.generate_response_for_image(prompt, image_base64)
|
||||
|
||||
|
||||
if description is None:
|
||||
logger.warning("AI未能生成图片描述")
|
||||
return "[图片]"
|
||||
|
|
|
|||
Loading…
Reference in New Issue