AS AgentScopeAPI 手册 / API Reference

SkillHook

@Deprecated(since = "2.0.0") public class SkillHook implements Hook
源码Source 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_PRIORITY
staticfinal
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
staticfinal

技能钩子优先级字段。声明为 public static final int SKILL_HOOK_PRIORITY。

Runs after subagent prompt injection and before workspace context injection in the default harness hook chain.

源码Source io/agentscope/core/skill/SkillHook.java:44

构造器详情Constructor Detail

SkillHook

public SkillHook(SkillBox skillBox)

初始化 SkillHook 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
skillBoxSkillBox技能 Box(类型 `SkillBox`)。The skill box.
源码Source 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.

参数Parameters
名称Name类型Type说明Description
eventT事件(类型 `T`)。The event.
返回Returns Mono<T>
返回Mono。Returns mono.
源码Source io/agentscope/core/skill/SkillHook.java:52–61

priority

public int priority()

返回优先级。

Returns the priority.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/skill/SkillHook.java:63–66

继承成员Inherited Members

继承自Methods inherited from Hook
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.