feat(affinity-flow): 通过标签扩展与提及分类增强兴趣匹配

- 实施扩展标签描述以实现更精确的语义匹配
- 增加强/弱提及分类,并附带独立的兴趣评分
- 重构机器人兴趣管理器,采用动态嵌入生成与缓存机制
- 通过增强的@提及处理功能优化消息处理
- 更新配置以支持回帖提升机制
- 将亲和力流量聊天重新组织为模块化结构,包含核心、规划器、主动响应和工具子模块
- 移除已弃用的规划器组件并整合功能
- 为napcat适配器插件添加数据库表初始化功能
- 修复元事件处理器中的心跳监控
This commit is contained in:
Windpicker-owo
2025-11-03 22:24:51 +08:00
parent eeb77e0e3c
commit a6d2aee781
28 changed files with 1217 additions and 168 deletions

View File

@@ -70,6 +70,11 @@
- `mention_bot_adjustment_threshold`
提及 Bot 后的调整阈值。当bot被提及后回复阈值会改变为这个值。
- `strong_mention_interest_score`
强提及的兴趣分。强提及包括:被@、被回复、私聊消息。这类提及表示用户明确想与bot交互。
- `weak_mention_interest_score`
弱提及的兴趣分。弱提及包括消息中包含bot的名字或别名文本匹配。这类提及可能只是在讨论中提到bot。
- `base_relationship_score`
---
@@ -80,13 +85,16 @@
2. **Bot 太热情/回复太多**
- 提高 `reply_action_interest_threshold`,或降低关键词相关倍率。
3. **希望 Bot 更关注被 @ 的消息**
- 提高 `mention_bot_interest_score``mention_bot_weight`
3. **希望 Bot 更关注被 @ 或回复的消息**
- 提高 `strong_mention_interest_score``mention_bot_weight`
4. **希望 Bot 更看重关系好的用户**
4. **希望 Bot 对文本提及也积极回应**
- 提高 `weak_mention_interest_score`
5. **希望 Bot 更看重关系好的用户**
- 提高 `relationship_weight``base_relationship_score`
5. **表情包行为过于频繁/稀少**
6. **表情包行为过于频繁/稀少**
- 调整 `non_reply_action_interest_threshold`
---
@@ -121,7 +129,8 @@ keyword_match_weight = 0.4
mention_bot_weight = 0.3
relationship_weight = 0.3
mention_bot_adjustment_threshold = 0.5
mention_bot_interest_score = 2.5
strong_mention_interest_score = 2.5 # 强提及(@/回复/私聊)
weak_mention_interest_score = 1.5 # 弱提及(文本匹配)
base_relationship_score = 0.3
```
@@ -134,7 +143,10 @@ MoFox-Bot 在收到每条消息时会通过一套“兴趣度评分afc
- 不同匹配度的关键词会乘以对应的倍率high/medium/low_match_keyword_multiplier并根据匹配数量叠加加成match_count_bonusmax_match_bonus
### 2. 提及与关系加分
- 如果消息中提及了 Bot(如被@会直接获得一部分兴趣分mention_bot_interest_score并按权重mention_bot_weight计入总分。
- 如果消息中提及了 Bot,会根据提及类型获得不同的兴趣分:
* **强提及**(被@、被回复、私聊): 获得 `strong_mention_interest_score` 分值表示用户明确想与bot交互
* **弱提及**文本中包含bot名字或别名: 获得 `weak_mention_interest_score` 分值表示在讨论中提到bot
* 提及分按权重(`mention_bot_weight`)计入总分
- 与用户的关系分base_relationship_score 及动态关系分)也会按 relationship_weight 计入总分。
### 3. 综合评分计算