fix:修复willing和表情包不注册

This commit is contained in:
SengokuCola
2025-04-03 21:30:53 +08:00
parent 7734c5d895
commit 06ef607e77
3 changed files with 8 additions and 2 deletions

View File

@@ -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)

View File

@@ -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("[扫描] 开始扫描新表情包...")

View File

@@ -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)