ActingEvent
@Deprecated(forRemoval = true, since = "2.0.0") public abstract sealed class ActingEvent extends HookEvent permits PreActingEvent, PostActingEvent, ActingChunkEvent
源码Source
io/agentscope/core/hook/ActingEvent.java:43–81执行事件,描述执行过程中的事件。位于 io.agentscope.core.hook 包,继承自 HookEvent。核心成员包括 getToolkit、getToolUse、ActingEvent、toolUse。
Base class for tool execution (acting) related events.
This sealed class provides common context for all acting events:
-
#getToolkit()- The toolkit instance -
#getToolUse()- The tool being executed
Subclasses represent different stages of tool execution:
-
PreActingEvent- Before tool execution -
PostActingEvent- After tool execution -
ActingChunkEvent- During tool streaming
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
toolUse | ToolUseBlock | 工具使用字段。 The tool use field. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected ActingEvent(HookEventType type, Agent agent, Toolkit toolkit, ToolUseBlock toolUse) | 初始化 `ActingEvent` 实例。 Constructor for ActingEvent. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public final Toolkit getToolkit()final | 获取工具包实例。 Get the toolkit instance. |
public final ToolUseBlock getToolUse()final | 获取工具使用。 Get the tool being executed. |
字段详情Field Detail
toolUse
protected ToolUseBlock toolUse
工具使用字段。声明为 protected ToolUseBlock toolUse。
The tool use field.
源码Source
io/agentscope/core/hook/ActingEvent.java:48构造器详情Constructor Detail
ActingEvent
protected ActingEvent(HookEventType type, Agent agent, Toolkit toolkit, ToolUseBlock toolUse)
初始化 ActingEvent 实例。
Constructor for ActingEvent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | HookEventType | 类型(类型 `HookEventType`)。The event type (must not be null) |
agent | Agent | 智能体(类型 `Agent`)。The agent instance (must not be null) |
toolkit | Toolkit | 工具包实例。The toolkit instance |
toolUse | ToolUseBlock | 工具使用(类型 `ToolUseBlock`)。The tool being executed (can be null for empty events) |
源码Source
io/agentscope/core/hook/ActingEvent.java:58–62方法详情Method Detail
getToolkit
public final Toolkit getToolkit()
final
获取工具包实例。
Get the toolkit instance.
Toolkit工具包。The toolkit
源码Source
io/agentscope/core/hook/ActingEvent.java:69–71getToolUse
public final ToolUseBlock getToolUse()
final
获取工具使用。
Get the tool being executed.
ToolUseBlock工具使用块。The tool use block
源码Source
io/agentscope/core/hook/ActingEvent.java:78–80