refactor(affinity_flow): 重构规划器架构并简化日志输出

- 移除ChatterManager中不必要的ActionPlanner实例化
- 在MessageManager中设置默认聊天模式为FOCUS
- 重构BaseChatter构造函数,移除planner依赖
- 统一ChatMode枚举定义,移除GROUP/PRIVATE模式
- 重构AffinityChatter内部planner初始化逻辑
- 大幅简化兴趣评分系统的日志输出
- 修复plan_filter中的动作解析逻辑,支持新格式
- 更新planner_prompts提示词模板,移除私聊限制
- 优化关系追踪器的错误处理和日志输出
This commit is contained in:
Windpicker-owo
2025-09-23 22:18:03 +08:00
parent 502d0b7c59
commit 2b04d548b6
16 changed files with 150 additions and 139 deletions

View File

@@ -15,17 +15,15 @@ class BaseChatter(ABC):
"""Chatter组件的描述"""
chat_types: List[ChatType] = [ChatType.PRIVATE, ChatType.GROUP]
def __init__(self, stream_id: str, planner: 'ActionPlanner', action_manager: 'ChatterActionManager'):
def __init__(self, stream_id: str, action_manager: 'ChatterActionManager'):
"""
初始化聊天处理器
Args:
stream_id: 聊天流ID
planner: 动作规划器
action_manager: 动作管理器
"""
self.stream_id = stream_id
self.planner = planner
self.action_manager = action_manager
@abstractmethod

View File

@@ -40,9 +40,8 @@ class ActionActivationType(Enum):
# 聊天模式枚举
class ChatMode(Enum):
"""聊天模式枚举"""
GROUP = "group" # 群聊模式
PRIVATE = "private" # 私聊模式
FOCUS = "focus" # 专注模式
NORMAL = "normal" # Normal聊天模式
PROACTIVE = "proactive" # 主动思考模式
PRIORITY = "priority" # 优先级聊天模式