AS AgentScopeAPI 手册 / API Reference

AgentscopeAguiMvcAutoConfiguration

@AutoConfiguration @ConditionalOnClass({SseEmitter.class, Agent.class}) @ConditionalOnBean(AguiAgentRegistry.class) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) @EnableConfigurationProperties(AguiProperties.class) public class AgentscopeAguiMvcAutoConfiguration
源码Source io/agentscope/spring/boot/agui/mvc/AgentscopeAguiMvcAutoConfiguration.java:51–150

Agentscope AGUI Mvc Auto 配置,保存相关配置项。位于 io.agentscope.spring.boot.agui.mvc 包。核心成员包括 threadSessionManager、aguiRequestBodyParser、aguiMvcController、aguiRestController。

Spring Boot auto-configuration for AG-UI MVC integration.

This auto-configuration provides:

  • AguiAgentRegistry bean for managing agents

  • AguiMvcController bean for handling requests

  • AguiRestController bean for exposing endpoints

To use this auto-configuration, simply add the dependency to your project and register your agents with the AguiAgentRegistry.

方法摘要Method Summary

方法Method说明Description
public ThreadSessionManager threadSessionManager(AguiProperties props)
设置会话线程会话管理器。
Creates the thread session manager bean.
public AguiRequestBodyParser aguiRequestBodyParser()
返回AGUI 请求正文解析器。
Creates the default AG-UI request body parser bean.
public AguiMvcController aguiMvcController(AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props, ObjectProvider<AgentEventConverter> eventConvertersProvider, ObjectProvider<AguiEventEnricher> eventEnrichersProvider, ObjectProvider<AguiRuntimeContextResolver> runtimeContextResolverProvider, ObjectProvider<AguiAgentAdapterFactory> adapterFactoryProvider)
执行 `aguiMvcController` 方法。
Creates the AG-UI MVC controller bean.
public AguiRestController aguiRestController(AguiMvcController aguiMvcController, AguiProperties props, AguiRequestBodyParser requestBodyParser)
执行AGUI REST 控制器相关操作。
Creates the REST controller for AG-UI endpoints.

方法详情Method Detail

threadSessionManager

public ThreadSessionManager threadSessionManager(AguiProperties props)

设置会话线程会话管理器。

Creates the thread session manager bean.

参数Parameters
名称Name类型Type说明Description
propsAguiProperties配置属性。The configuration properties
返回Returns ThreadSessionManager
一种新的ThreadSessionManager。A new ThreadSessionManager
源码Source io/agentscope/spring/boot/agui/mvc/AgentscopeAguiMvcAutoConfiguration.java:64–69

aguiRequestBodyParser

public AguiRequestBodyParser aguiRequestBodyParser()

返回AGUI 请求正文解析器。

Creates the default AG-UI request body parser bean.

返回Returns AguiRequestBodyParser
一种新的AguiRequestBodyParser。A new AguiRequestBodyParser
源码Source io/agentscope/spring/boot/agui/mvc/AgentscopeAguiMvcAutoConfiguration.java:80–84

aguiMvcController

public AguiMvcController aguiMvcController(AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props, ObjectProvider<AgentEventConverter> eventConvertersProvider, ObjectProvider<AguiEventEnricher> eventEnrichersProvider, ObjectProvider<AguiRuntimeContextResolver> runtimeContextResolverProvider, ObjectProvider<AguiAgentAdapterFactory> adapterFactoryProvider)

执行 aguiMvcController 方法。

Creates the AG-UI MVC controller bean.

参数Parameters
名称Name类型Type说明Description
registryAguiAgentRegistry智能体注册表。The agent registry
sessionManagerThreadSessionManager会话线程会话管理器。The thread session manager
propsAguiProperties配置属性。The configuration properties
eventConvertersProviderObjectProvider<AgentEventConverter>事件 Converters 提供者(类型 `ObjectProvider`)。The event converters provider.
eventEnrichersProviderObjectProvider<AguiEventEnricher>事件 Enrichers 提供者(类型 `ObjectProvider`)。The event enrichers provider.
runtimeContextResolverProviderObjectProvider<AguiRuntimeContextResolver>运行时上下文解析器提供者(类型 `ObjectProvider`)。The runtime context resolver provider.
adapterFactoryProviderObjectProvider<AguiAgentAdapterFactory>适配器工厂提供者(类型 `ObjectProvider`)。The adapter factory provider.
返回Returns AguiMvcController
一种新的AguiMvcController。A new AguiMvcController
源码Source io/agentscope/spring/boot/agui/mvc/AgentscopeAguiMvcAutoConfiguration.java:94–129

aguiRestController

public AguiRestController aguiRestController(AguiMvcController aguiMvcController, AguiProperties props, AguiRequestBodyParser requestBodyParser)

执行AGUI REST 控制器相关操作。

Creates the REST controller for AG-UI endpoints.

参数Parameters
名称Name类型Type说明Description
aguiMvcControllerAguiMvcControllerAG-UI MVC 控制器。The AG-UI MVC controller
propsAguiProperties配置属性。The configuration properties
requestBodyParserAguiRequestBodyParser请求正文解析器(类型 `AguiRequestBodyParser`)。The request body parser.
返回Returns AguiRestController
一种新的AguiRestController。A new AguiRestController
源码Source io/agentscope/spring/boot/agui/mvc/AgentscopeAguiMvcAutoConfiguration.java:138–149
基于官方固定版本源码静态生成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.