PersistingAgentEventEnricher
public final class PersistingAgentEventEnricher implements AguiEventEnricher
源码Source
io/agentscope/examples/copilotkit/service/PersistingAgentEventEnricher.java:38–75Persisting 智能体事件 Enricher,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.examples.copilotkit.service 包,实现 AguiEventEnricher。核心成员包括 enrich、PersistingAgentEventEnricher。
Persists the source AgentEvent while the AG-UI adapter projects it.
AG-UI frames themselves are not stored — connect replay re-projects through converters.
On AgentStartEvent, also stores the run's input messages so reconnect can rebuild
RUN_STARTED.input.messages (how CopilotKit restores user / tool turns).
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<AguiEvent> enrich(AgentEvent source, List<AguiEvent> events, AguiStreamContext context) | 执行 `enrich` 方法。 Performs the enrich operation. |
构造器详情Constructor Detail
PersistingAgentEventEnricher
public PersistingAgentEventEnricher(InMemoryAgentEventStore eventStore, ObjectProvider<WorkbenchAguiEventConverter> workbenchConverterProvider)
初始化 PersistingAgentEventEnricher 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
eventStore | InMemoryAgentEventStore | 事件存储(类型 `InMemoryAgentEventStore`)。The event store. |
workbenchConverterProvider | ObjectProvider<WorkbenchAguiEventConverter> | workbench 转换器提供者(类型 `ObjectProvider`)。The workbench converter provider. |
源码Source
io/agentscope/examples/copilotkit/service/PersistingAgentEventEnricher.java:43–48方法详情Method Detail
enrich
public List<AguiEvent> enrich(AgentEvent source, List<AguiEvent> events, AguiStreamContext context)
执行 enrich 方法。
Performs the enrich operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
source | AgentEvent | 来源(类型 `AgentEvent`)。The source. |
events | List<AguiEvent> | 事件列表(类型 `List`)。The events. |
context | AguiStreamContext | 上下文(类型 `AguiStreamContext`)。The context. |
List<AguiEvent>返回列出。Returns list.
源码Source
io/agentscope/examples/copilotkit/service/PersistingAgentEventEnricher.java:50–63