SkillHook
@Deprecated(since = "2.0.0") public class SkillHook implements Hook
io/agentscope/core/skill/SkillHook.java:37–67技能钩子,让智能体以受控方式调用外部能力。位于 io.agentscope.core.skill 包,实现 Hook。核心成员包括 onEvent、priority、SkillHook、SKILL_HOOK_PRIORITY。
Injects the skill catalog prompt into the unified system message on PreCallEvent via
PreCallEvent#appendSystemContent(String).
Uses priority #SKILL_HOOK_PRIORITY so that, in typical HarnessAgent wiring,
this hook runs after SubagentsHook (80) and before WorkspaceContextHook (900),
yielding append order: base prompt → subagents → skills → workspace context.
The skill prompt is appended to the transient system message and is never stored in
the agent's persistent Memory.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
SKILL_HOOK_PRIORITYstaticfinal | int | 技能钩子优先级字段。 Runs after subagent prompt injection and before workspace context injection in the default
harness hook chain. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public SkillHook(SkillBox skillBox) | 初始化 `SkillHook` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public T extends HookEvent Mono<T> onEvent(T event) | 处理事件事件。 Performs the on event operation. |
public int priority() | 返回优先级。 Returns the priority. |
字段详情Field Detail
SKILL_HOOK_PRIORITY
public static final int SKILL_HOOK_PRIORITY
技能钩子优先级字段。声明为 public static final int SKILL_HOOK_PRIORITY。
Runs after subagent prompt injection and before workspace context injection in the default harness hook chain.
io/agentscope/core/skill/SkillHook.java:44构造器详情Constructor Detail
SkillHook
public SkillHook(SkillBox skillBox)
初始化 SkillHook 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillBox | SkillBox | 技能 Box(类型 `SkillBox`)。The skill box. |
io/agentscope/core/skill/SkillHook.java:48–50方法详情Method Detail
onEvent
public T extends HookEvent Mono<T> onEvent(T event)
处理事件事件。
Performs the on event operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
event | T | 事件(类型 `T`)。The event. |
Mono<T>io/agentscope/core/skill/SkillHook.java:52–61priority
public int priority()
返回优先级。
Returns the priority.
intio/agentscope/core/skill/SkillHook.java:63–66