fix:修复willing和表情包不注册
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -39,6 +39,8 @@ class EmojiManager:
|
||||
model=global_config.llm_emotion_judge, max_tokens=600, temperature=0.8, request_type="emoji"
|
||||
) # 更高的温度,更少的token(后续可以根据情绪来调整温度)
|
||||
|
||||
logger.info("启动表情包管理器")
|
||||
|
||||
def _ensure_emoji_dir(self):
|
||||
"""确保表情存储目录存在"""
|
||||
os.makedirs(self.EMOJI_DIR, exist_ok=True)
|
||||
@@ -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("[扫描] 开始扫描新表情包...")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user