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 |
|---|---|---|
sessionKey | String | 执行会话键相关操作。 the session key that produced this event |
eventType | String | 执行事件类型相关操作。 `TOOL_CALL` or `TOOL_RESULT` |
toolName | String | 工具的名称。 the name of the tool |
data | Map<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–65eventType
String eventType执行事件类型相关操作。
TOOL_CALL or TOOL_RESULT
源码Source
io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65toolName
String toolName工具的名称。
the name of the tool
源码Source
io/agentscope/builder/web/toolbus/ToolEventBus.java:57–65data
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 |
|---|---|---|
sessionKey | String | 会话键(类型 `String`)。The session key. |
toolName | String | 工具名称(类型 `String`)。The tool name. |
input | Map<String, Object> | 输入消息(类型 `Map`)。The input. |
ToolEvent返回ToolEvent。Returns tool event.
源码Source
io/agentscope/builder/web/toolbus/ToolEventBus.java:61–64