feat(planner): 引入双模动作激活机制与混合触发类型
为了更精细地控制动作在不同聊天模式下的行为,并提升决策效率,本次更新引入了全新的动作激活机制。 - **双模激活**: 为 Action 新增 `normal_activation_type` 和 `focus_activation_type` 属性,允许插件在 `NORMAL` 和 `FOCUS` 模式下拥有不同的激活策略,使行为更符合上下文。 - **混合触发**: 新增 `KEYWORD_OR_LLM_JUDGE` 激活类型。该类型会先进行快速的关键词匹配,若未匹配成功,则回退至 LLM 进行判断,兼顾了响应速度和智能化。 - **流程优化**: 重构了 `PlanGenerator` 的动作筛选逻辑,使其在生成计划前,就根据当前聊天模式和简单的激活规则进行预筛选,为后续的 LLM 决策提供更精准、更高效的候选动作列表。
This commit is contained in:
@@ -459,7 +459,6 @@ class BaseAction(ABC):
|
||||
focus_activation_type = getattr(cls, "focus_activation_type", ActionActivationType.ALWAYS)
|
||||
normal_activation_type = getattr(cls, "normal_activation_type", ActionActivationType.ALWAYS)
|
||||
|
||||
# 处理activation_type:如果插件中声明了就用插件的值,否则默认使用focus_activation_type
|
||||
activation_type = getattr(cls, "activation_type", focus_activation_type)
|
||||
|
||||
return ActionInfo(
|
||||
|
||||
Reference in New Issue
Block a user