From 06ef607e775625d987ba789eb4d07190c82cfb2c Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Thu, 3 Apr 2025 21:30:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8Dwilling=E5=92=8C?= =?UTF-8?q?=E8=A1=A8=E6=83=85=E5=8C=85=E4=B8=8D=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.py | 2 ++ src/plugins/chat/emoji_manager.py | 4 +++- src/plugins/chat_module/think_flow_chat/think_flow_chat.py | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index af2896c79..e3bbf38d1 100644 --- a/src/main.py +++ b/src/main.py @@ -50,6 +50,7 @@ class MainSystem: # 初始化表情管理器 emoji_manager.initialize() + logger.success("表情包管理器初始化成功") # 启动情绪管理器 self.mood_manager.start_mood_update(update_interval=global_config.mood_update_interval) @@ -106,6 +107,7 @@ class MainSystem: self.print_mood_task(), self.remove_recalled_message_task(), emoji_manager.start_periodic_check(), + emoji_manager.start_periodic_register(), self.app.run(), ] await asyncio.gather(*tasks) diff --git a/src/plugins/chat/emoji_manager.py b/src/plugins/chat/emoji_manager.py index 18a54b1ec..279dfb464 100644 --- a/src/plugins/chat/emoji_manager.py +++ b/src/plugins/chat/emoji_manager.py @@ -38,6 +38,8 @@ class EmojiManager: self.llm_emotion_judge = LLM_request( model=global_config.llm_emotion_judge, max_tokens=600, temperature=0.8, request_type="emoji" ) # 更高的温度,更少的token(后续可以根据情绪来调整温度) + + logger.info("启动表情包管理器") def _ensure_emoji_dir(self): """确保表情存储目录存在""" @@ -338,7 +340,7 @@ class EmojiManager: except Exception: logger.exception("[错误] 扫描表情包失败") - async def _periodic_scan(self): + async def start_periodic_register(self): """定期扫描新表情包""" while True: logger.info("[扫描] 开始扫描新表情包...") diff --git a/src/plugins/chat_module/think_flow_chat/think_flow_chat.py b/src/plugins/chat_module/think_flow_chat/think_flow_chat.py index 8197af0b1..9ed08971d 100644 --- a/src/plugins/chat_module/think_flow_chat/think_flow_chat.py +++ b/src/plugins/chat_module/think_flow_chat/think_flow_chat.py @@ -191,7 +191,9 @@ class ThinkFlowChat: # 计算回复意愿 current_willing_old = willing_manager.get_willing(chat_stream=chat) current_willing_new = (heartflow.get_subheartflow(chat.stream_id).current_state.willing - 5) / 4 - current_willing = (current_willing_old + current_willing_new) / 2 + # current_willing = (current_willing_old + current_willing_new) / 2 + # 有点bug + current_willing = current_willing_old willing_manager.set_willing(chat.stream_id, current_willing)