feat(planner): 实现大小脑规划器分离以优化决策流程

将规划器(Planner)拆分为“大脑”和“小脑”两个部分,以实现更精细化的决策控制。

- **大脑(BIG_BRAIN)**: 负责宏观决策,如是否回复、是否需要@人等高层级意图。
- **小脑(SMALL_BRAIN)**: 负责具体的功能性动作执行。

此重构引入了 `PlannerType` 枚举,并更新了动作(Action)定义,允许将动作明确分配给大脑或小脑,从而提升了AI回复的逻辑性和条理性。同时,新增了 `no_action` 类型,用于在规划阶段明确表示“无动作”,提高了处理流程的清晰度。
This commit is contained in:
minecraft1024a
2025-09-06 20:49:56 +08:00
committed by Windpicker-owo
parent cfffc69e20
commit a30652b0bc
5 changed files with 38 additions and 27 deletions

View File

@@ -6,7 +6,7 @@ from typing import Tuple, Optional, Dict, Any
from src.common.logger import get_logger
from src.chat.message_receive.chat_stream import ChatStream
from src.plugin_system.base.component_types import ActionActivationType, ChatMode, ActionInfo, ComponentType, ChatType
from src.plugin_system.base.component_types import ActionActivationType, ChatMode, ActionInfo, ComponentType, ChatType,PlannerType
from src.plugin_system.apis import send_api, database_api, message_api
@@ -92,6 +92,8 @@ class BaseAction(ABC):
self.parallel_action: bool = getattr(self.__class__, "parallel_action", True)
self.associated_types: list[str] = getattr(self.__class__, "associated_types", []).copy()
self.chat_type_allow: ChatType = getattr(self.__class__, "chat_type_allow", ChatType.ALL)
self.planner_type: PlannerType = getattr(self.__class__, "planner_type", ChatType.ALL)
# =============================================================================
# 便捷属性 - 直接在初始化时获取常用聊天信息(带类型注解)