ActingChunkEvent
@Deprecated(forRemoval = true, since = "2.0.0") public final class ActingChunkEvent extends ActingEvent
源码Source
io/agentscope/core/hook/ActingChunkEvent.java:51–79执行分块事件,描述执行过程中的事件。位于 io.agentscope.core.hook 包,继承自 ActingEvent。核心成员包括 getChunk、ActingChunkEvent。
Event fired during tool execution streaming.
Modifiable: No (notification-only)
Context:
-
#getAgent()- The agent instance -
#getMemory()- Agent's memory -
#getToolkit()- The toolkit instance -
#getToolUse()- The tool being executed -
#getChunk()- The streaming chunk from ToolEmitter
Note: These chunks are emitted by tools via io.agentscope.core.tool.ToolEmitter. They are NOT sent to the LLM - only the final return value
is sent.
Use Cases:
-
Display tool execution progress
-
Log intermediate tool outputs
-
Monitor long-running tool operations
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ActingChunkEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock chunk) | 初始化 `ActingChunkEvent` 实例。 Constructor for ActingChunkEvent. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public ToolResultBlock getChunk() | 获取流式分块来自 ToolEmitter。 Get the streaming chunk from ToolEmitter. |
构造器详情Constructor Detail
ActingChunkEvent
public ActingChunkEvent(Agent agent, Toolkit toolkit, ToolUseBlock toolUse, ToolResultBlock chunk)
初始化 ActingChunkEvent 实例。
Constructor for ActingChunkEvent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agent | Agent | 智能体(类型 `Agent`)。The agent instance (must not be null) |
toolkit | Toolkit | 工具包(类型 `Toolkit`)。The toolkit instance (must not be null) |
toolUse | ToolUseBlock | 工具使用(类型 `ToolUseBlock`)。The tool being executed (must not be null) |
chunk | ToolResultBlock | 分块(类型 `ToolResultBlock`)。The streaming chunk from ToolEmitter (must not be null) |
NullPointerException可能抛出 `NullPointerException`。if agent, toolkit, toolUse, or chunk is null
源码Source
io/agentscope/core/hook/ActingChunkEvent.java:65–69方法详情Method Detail
getChunk
public ToolResultBlock getChunk()
获取流式分块来自 ToolEmitter。
Get the streaming chunk from ToolEmitter.
ToolResultBlock分块。The chunk
源码Source
io/agentscope/core/hook/ActingChunkEvent.java:76–78