AS AgentScopeAPI 手册 / API Reference

ToolEvent

@JsonInclude(JsonInclude.Include.NON_NULL) public record ToolEvent( String sessionKey, String eventType, String toolName, Map<String, Object> data)
源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65

承载工具事件数据的记录类型。位于 io.agentscope.builder.web.toolbus 包。核心成员包括 sessionKey、eventType、toolName、data、toolCall。

A single tool-call or tool-result event.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
sessionKeyString
执行会话键相关操作。
the session key that produced this event
eventTypeString
执行事件类型相关操作。
`TOOL_CALL` or `TOOL_RESULT`
toolNameString
工具的名称。
the name of the tool
dataMap<String, Object>
执行数据相关操作。
additional event data (input args or result text)

方法摘要Method Summary

方法Method说明Description
public static ToolEvent toolCall(String sessionKey, String toolName, Map<String, Object> input)
static
执行工具调用相关操作。
Performs the tool call operation.

记录组件详情Record Component Detail

sessionKey

String sessionKey

执行会话键相关操作。

the session key that produced this event

源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65

eventType

String eventType

执行事件类型相关操作。

TOOL_CALL or TOOL_RESULT

源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65

toolName

String toolName

工具的名称。

the name of the tool

源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65

data

Map<String, Object> data

执行数据相关操作。

additional event data (input args or result text)

源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65

方法详情Method Detail

toolCall

public static ToolEvent toolCall(String sessionKey, String toolName, Map<String, Object> input)
static

执行工具调用相关操作。

Performs the tool call operation.

参数Parameters
名称Name类型Type说明Description
sessionKeyString会话键(类型 `String`)。The session key.
toolNameString工具名称(类型 `String`)。The tool name.
inputMap<String, Object>输入消息(类型 `Map`)。The input.
返回Returns ToolEvent
返回ToolEvent。Returns tool event.
源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:61–64
基于官方固定版本源码静态生成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.