AS AgentScopeAPI 手册 / API Reference

ToolEventBus

@Component public class ToolEventBus
源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:30–66

工具事件总线,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.toolbus 包。核心成员包括 publish、subscribe。

Singleton in-memory event bus for tool-call events emitted by HarnessAgent hooks.

Consumers subscribe via #subscribe(String) filtering by session key. Publishers call #publish(ToolEvent) from the hook when a tool call is about to execute.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ToolEvent记录record
承载工具事件数据的记录类型。
A single tool-call or tool-result event.

方法摘要Method Summary

方法Method说明Description
public void publish(ToolEvent event)
设置发布。
Publishes a tool-call event to all current subscribers.
public Flux<ToolEvent> subscribe(String sessionKey)
设置订阅。
Returns a `Flux` filtered to events matching the given session key.

方法详情Method Detail

publish

public void publish(ToolEvent event)

设置发布。

Publishes a tool-call event to all current subscribers.

参数Parameters
名称Name类型Type说明Description
eventToolEvent事件(类型 `ToolEvent`)。The event.
源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:37–39

subscribe

public Flux<ToolEvent> subscribe(String sessionKey)

设置订阅。

Returns a Flux filtered to events matching the given session key.

参数Parameters
名称Name类型Type说明Description
sessionKeyString会话键(类型 `String`)。The session key.
返回Returns Flux<ToolEvent>
返回Flux。Returns flux.
源码Source io/agentscope/builder/web/toolbus/ToolEventBus.java:45–47

嵌套类详情Nested Class Detail

ToolEvent

@JsonInclude(JsonInclude.Include.NON_NULL) public record ToolEvent( String sessionKey, String eventType, String toolName, Map<String, Object> data)

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

A single tool-call or tool-result event.

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