feat(chat): 实现动态消息分发系统和消息打断机制

添加基于focus_energy的动态消息分发周期调整功能,根据聊天流兴趣度智能调整检查间隔
实现消息打断系统,允许高优先级消息打断正在处理的任务
重构ChatStream类,引入动态兴趣度计算系统,包括消息兴趣度统计和用户关系评分
扩展数据库模型和配置系统以支持新功能,增加相关配置项
更新版本号至0.11.0-alpha-1以反映重大功能更新
This commit is contained in:
Windpicker-owo
2025-09-25 17:14:01 +08:00
parent 4cbd86aa96
commit a2baec088e
15 changed files with 703 additions and 73 deletions

View File

@@ -150,6 +150,11 @@ class ChatMood:
self.last_change_time = message_time
# 更新ChatStream的兴趣度数据
if hasattr(self, 'chat_stream') and self.chat_stream:
self.chat_stream.add_message_interest(interested_rate)
logger.debug(f"{self.log_prefix} 已更新ChatStream兴趣度当前focus_energy: {self.chat_stream.focus_energy:.3f}")
async def regress_mood(self):
message_time = time.time()
message_list_before_now = get_raw_msg_by_timestamp_with_chat_inclusive(