AgentConfiguration
@Configuration public class AgentConfiguration
io/agentscope/examples/copilotkit/config/AgentConfiguration.java:78–447智能体配置,保存相关配置项。位于 io.agentscope.examples.copilotkit.config 包。核心成员包括 aguiAgentRegistryCustomizer、exampleAguiEventEnricher、persistingAgentEventEnricher、aguiRuntimeContextResolver、init、AgentConfiguration。
Configuration class that registers agents with the AG-UI registry.
This example demonstrates how to register multiple agents with different IDs. Clients can select which agent to use via:
-
URL path variable:
POST /agui/run/{agentId} -
HTTP header:
X-Agent-Id: agentId -
Request body:
forwardedProps.agentId
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentConfiguration(WorkbenchStateRegistry workbenchStateRegistry, A2uiComposer a2uiComposer) | 初始化 `AgentConfiguration` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public AguiAgentRegistryCustomizer aguiAgentRegistryCustomizer() | 返回 `aguiAgentRegistryCustomizer` 结果。 Returns the agui agent registry customizer. |
public AguiEventEnricher exampleAguiEventEnricher() | 返回 `exampleAguiEventEnricher` 结果。 Returns the example agui event enricher. |
public PersistingAgentEventEnricher persistingAgentEventEnricher(InMemoryAgentEventStore eventStore, ObjectProvider<WorkbenchAguiEventConverter> workbenchConverterProvider) | 执行 `persistingAgentEventEnricher` 方法。 Persist each source `AgentEvent` so `/agent/{agentId}/connect` can re-project
AG-UI frames through converters. |
public AguiRuntimeContextResolver aguiRuntimeContextResolver() | 返回AGUI 运行时上下文解析器。 Returns the agui runtime context resolver. |
public void init() | 初始化 `AgentConfiguration` 实例。 Creates a new instance. |
构造器详情Constructor Detail
AgentConfiguration
public AgentConfiguration(WorkbenchStateRegistry workbenchStateRegistry, A2uiComposer a2uiComposer)
初始化 AgentConfiguration 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workbenchStateRegistry | WorkbenchStateRegistry | workbench 状态注册表(类型 `WorkbenchStateRegistry`)。The workbench state registry. |
a2uiComposer | A2uiComposer | a 2 ui Composer(类型 `A2uiComposer`)。The a 2 ui composer. |
io/agentscope/examples/copilotkit/config/AgentConfiguration.java:84–88方法详情Method Detail
aguiAgentRegistryCustomizer
public AguiAgentRegistryCustomizer aguiAgentRegistryCustomizer()
返回 aguiAgentRegistryCustomizer 结果。
Returns the agui agent registry customizer.
AguiAgentRegistryCustomizerio/agentscope/examples/copilotkit/config/AgentConfiguration.java:90–120exampleAguiEventEnricher
public AguiEventEnricher exampleAguiEventEnricher()
返回 exampleAguiEventEnricher 结果。
Returns the example agui event enricher.
AguiEventEnricherio/agentscope/examples/copilotkit/config/AgentConfiguration.java:122–130persistingAgentEventEnricher
public PersistingAgentEventEnricher persistingAgentEventEnricher(InMemoryAgentEventStore eventStore, ObjectProvider<WorkbenchAguiEventConverter> workbenchConverterProvider)
执行 persistingAgentEventEnricher 方法。
Persist each source AgentEvent so /agent/{agentId}/connect can re-project AG-UI frames through converters.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
eventStore | InMemoryAgentEventStore | 事件存储(类型 `InMemoryAgentEventStore`)。The event store. |
workbenchConverterProvider | ObjectProvider<WorkbenchAguiEventConverter> | workbench 转换器提供者(类型 `ObjectProvider`)。The workbench converter provider. |
PersistingAgentEventEnricherio/agentscope/examples/copilotkit/config/AgentConfiguration.java:138–144aguiRuntimeContextResolver
public AguiRuntimeContextResolver aguiRuntimeContextResolver()
返回AGUI 运行时上下文解析器。
Returns the agui runtime context resolver.
AguiRuntimeContextResolverio/agentscope/examples/copilotkit/config/AgentConfiguration.java:146–158init
public void init()
初始化 AgentConfiguration 实例。
Creates a new instance.
io/agentscope/examples/copilotkit/config/AgentConfiguration.java:438–446