AS AgentScopeAPI 手册 / API Reference

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
typeHookEventType类型(类型 `HookEventType`)。The event type (must not be null)
agentAgent智能体(类型 `Agent`)。The agent instance (must not be null)
toolkitToolkit工具包实例。The toolkit instance
toolUseToolUseBlock工具使用(类型 `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.

返回Returns Toolkit
工具包。The toolkit
源码Source io/agentscope/core/hook/ActingEvent.java:69–71

getToolUse

public final ToolUseBlock getToolUse()
final

获取工具使用。

Get the tool being executed.

返回Returns ToolUseBlock
工具使用块。The tool use block
源码Source io/agentscope/core/hook/ActingEvent.java:78–80

继承成员Inherited Members

基于官方固定版本源码静态生成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.