AS AgentScopeAPI 手册 / API Reference

AgentConfiguration

@Configuration public class AgentConfiguration
源码Source 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.

参数Parameters
名称Name类型Type说明Description
workbenchStateRegistryWorkbenchStateRegistryworkbench 状态注册表(类型 `WorkbenchStateRegistry`)。The workbench state registry.
a2uiComposerA2uiComposera 2 ui Composer(类型 `A2uiComposer`)。The a 2 ui composer.
源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:84–88

方法详情Method Detail

aguiAgentRegistryCustomizer

public AguiAgentRegistryCustomizer aguiAgentRegistryCustomizer()

返回 aguiAgentRegistryCustomizer 结果。

Returns the agui agent registry customizer.

返回Returns AguiAgentRegistryCustomizer
返回AguiAgentRegistryCustomizer。Returns agui agent registry customizer.
源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:90–120

exampleAguiEventEnricher

public AguiEventEnricher exampleAguiEventEnricher()

返回 exampleAguiEventEnricher 结果。

Returns the example agui event enricher.

返回Returns AguiEventEnricher
返回AguiEventEnricher。Returns agui event enricher.
源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:122–130

persistingAgentEventEnricher

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.

参数Parameters
名称Name类型Type说明Description
eventStoreInMemoryAgentEventStore事件存储(类型 `InMemoryAgentEventStore`)。The event store.
workbenchConverterProviderObjectProvider<WorkbenchAguiEventConverter>workbench 转换器提供者(类型 `ObjectProvider`)。The workbench converter provider.
返回Returns PersistingAgentEventEnricher
返回PersistingAgentEventEnricher。Returns persisting agent event enricher.
源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:138–144

aguiRuntimeContextResolver

public AguiRuntimeContextResolver aguiRuntimeContextResolver()

返回AGUI 运行时上下文解析器。

Returns the agui runtime context resolver.

返回Returns AguiRuntimeContextResolver
返回AguiRuntimeContextResolver。Returns agui runtime context resolver.
源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:146–158

init

public void init()

初始化 AgentConfiguration 实例。

Creates a new instance.

源码Source io/agentscope/examples/copilotkit/config/AgentConfiguration.java:438–446
基于官方固定版本源码静态生成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.