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 c4f24244c1
commit a67b78b551
15 changed files with 703 additions and 70 deletions

View File

@@ -125,11 +125,17 @@ class ChatterActionPlanner:
logger.info(f"兴趣度不足 ({latest_score.total_score:.2f}),移除回复")
reply_not_available = True
# 更新情绪状态 - 使用最新消息的兴趣度
# 更新情绪状态和ChatStream兴趣度数据
if latest_message and score > 0:
chat_mood = mood_manager.get_mood_by_chat_id(self.chat_id)
await chat_mood.update_mood_by_message(latest_message, score)
logger.debug(f"已更新聊天 {self.chat_id} 的情绪状态,兴趣度: {score:.3f}")
elif latest_message:
# 即使不更新情绪状态也要更新ChatStream的兴趣度数据
chat_mood = mood_manager.get_mood_by_chat_id(self.chat_id)
if hasattr(chat_mood, 'chat_stream') and chat_mood.chat_stream:
chat_mood.chat_stream.add_message_interest(score)
logger.debug(f"已更新聊天 {self.chat_id} 的ChatStream兴趣度分数: {score:.3f}")
# base_threshold = self.interest_scoring.reply_threshold
# 检查兴趣度是否达到非回复动作阈值

View File

@@ -11,7 +11,7 @@
"host_application": {
"min_version": "0.10.0",
"max_version": "0.10.0"
"max_version": "0.11.0"
},
"homepage_url": "https://github.com/Windpicker-owo/InternetSearchPlugin",
"repository_url": "https://github.com/Windpicker-owo/InternetSearchPlugin",

View File

@@ -305,7 +305,7 @@ class NapcatAdapterPlugin(BasePlugin):
"name": ConfigField(type=str, default="napcat_adapter_plugin", description="插件名称"),
"version": ConfigField(type=str, default="1.1.0", description="插件版本"),
"config_version": ConfigField(type=str, default="1.3.1", description="配置文件版本"),
"enabled": ConfigField(type=bool, default=False, description="是否启用插件"),
"enabled": ConfigField(type=bool, default=True, description="是否启用插件"),
},
"inner": {
"version": ConfigField(type=str, default="0.2.1", description="配置版本号,请勿修改"),