AS AgentScopeAPI 手册 / API Reference

AgentEventConverter

public interface AgentEventConverter
源码Source io/agentscope/core/agui/adapter/strategy/AgentEventConverter.java:28–44

定义智能体事件转换器契约的接口。位于 io.agentscope.core.agui.adapter.strategy 包。核心成员包括 eventTypes、convert。

Extension point for converting AgentScope events to AG-UI protocol events.

Implementations declare the AgentEvent types they handle and emit AG-UI events through the provided AguiStreamContext. Custom converters can be registered through AguiAdapterConfig to extend or override built-in semantic mappings.

方法摘要Method Summary

方法Method说明Description
public Set<Class<? extends AgentEvent>> eventTypes()
返回事件类型。
Return the AgentScope event types handled by this converter.
public void convert(AgentEvent event, AguiStreamContext context)
执行转换相关操作。
Convert a source AgentScope event by emitting AG-UI events to the stream context.

方法详情Method Detail

eventTypes

public Set<Class<? extends AgentEvent>> eventTypes()

返回事件类型。

Return the AgentScope event types handled by this converter.

返回Returns Set<Class<? extends AgentEvent>>
返回设置>。supported AgentScope event types
源码Source io/agentscope/core/agui/adapter/strategy/AgentEventConverter.java:35

convert

public void convert(AgentEvent event, AguiStreamContext context)

执行转换相关操作。

Convert a source AgentScope event by emitting AG-UI events to the stream context.

参数Parameters
名称Name类型Type说明Description
eventAgentEvent事件(类型 `AgentEvent`)。source AgentScope event
contextAguiStreamContext上下文(类型 `AguiStreamContext`)。stream conversion context used to emit AG-UI events
源码Source io/agentscope/core/agui/adapter/strategy/AgentEventConverter.java:43
基于官方固定版本源码静态生成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.