AS AgentScopeAPI 手册 / API Reference

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
agentAgent智能体(类型 `Agent`)。The agent instance (must not be null)
toolkitToolkit工具包(类型 `Toolkit`)。The toolkit instance (must not be null)
toolUseToolUseBlock工具使用(类型 `ToolUseBlock`)。The tool being executed (must not be null)
chunkToolResultBlock分块(类型 `ToolResultBlock`)。The streaming chunk from ToolEmitter (must not be null)
抛出Throws
  • 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.

返回Returns ToolResultBlock
分块。The chunk
源码Source io/agentscope/core/hook/ActingChunkEvent.java:76–78

继承成员Inherited Members

继承自Members inherited from ActingEvent
基于官方固定版本源码静态生成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.