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.
Set<Class<? extends AgentEvent>>返回设置>。supported AgentScope event types
源码Source
io/agentscope/core/agui/adapter/strategy/AgentEventConverter.java:35convert
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 |
|---|---|---|
event | AgentEvent | 事件(类型 `AgentEvent`)。source AgentScope event |
context | AguiStreamContext | 上下文(类型 `AguiStreamContext`)。stream conversion context used to emit AG-UI events |
源码Source
io/agentscope/core/agui/adapter/strategy/AgentEventConverter.java:43