Class AgentscopeAguiMvcAutoConfiguration
java.lang.Object
io.agentscope.spring.boot.agui.mvc.AgentscopeAguiMvcAutoConfiguration
@AutoConfiguration
@ConditionalOnClass({org.springframework.web.servlet.mvc.method.annotation.SseEmitter.class,io.agentscope.core.agent.Agent.class})
@ConditionalOnBean(io.agentscope.core.agui.registry.AguiAgentRegistry.class)
@ConditionalOnWebApplication(type=SERVLET)
@EnableConfigurationProperties(AguiProperties.class)
public class AgentscopeAguiMvcAutoConfiguration
extends Object
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaguiMvcController(io.agentscope.core.agui.registry.AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.strategy.AgentEventConverter> eventConvertersProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.strategy.AguiEventEnricher> eventEnrichersProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.runtime.AguiRuntimeContextResolver> runtimeContextResolverProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.AguiAgentAdapterFactory> adapterFactoryProvider) Creates the AG-UI MVC controller bean.io.agentscope.core.agui.runtime.AguiRequestBodyParserCreates the default AG-UI request body parser bean.aguiRestController(AguiMvcController aguiMvcController, AguiProperties props, io.agentscope.core.agui.runtime.AguiRequestBodyParser requestBodyParser) Creates the REST controller for AG-UI endpoints.Creates the thread session manager bean.
-
Constructor Details
-
AgentscopeAguiMvcAutoConfiguration
public AgentscopeAguiMvcAutoConfiguration()
-
-
Method Details
-
threadSessionManager
@Bean @ConditionalOnMissingBean public ThreadSessionManager threadSessionManager(AguiProperties props) Creates the thread session manager bean.- Parameters:
props- The configuration properties- Returns:
- A new ThreadSessionManager
-
aguiRequestBodyParser
@Bean @ConditionalOnMissingBean public io.agentscope.core.agui.runtime.AguiRequestBodyParser aguiRequestBodyParser()Creates the default AG-UI request body parser bean.The parser decodes request bodies with AgentScope's Jackson 2 codec so that Spring Boot 4's Jackson 3 converters do not touch AG-UI's Jackson 2-annotated models. Applications can override this bean to customize request body parsing.
- Returns:
- A new AguiRequestBodyParser
-
aguiMvcController
@Bean @ConditionalOnMissingBean public AguiMvcController aguiMvcController(io.agentscope.core.agui.registry.AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.strategy.AgentEventConverter> eventConvertersProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.strategy.AguiEventEnricher> eventEnrichersProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.runtime.AguiRuntimeContextResolver> runtimeContextResolverProvider, org.springframework.beans.factory.ObjectProvider<io.agentscope.core.agui.adapter.AguiAgentAdapterFactory> adapterFactoryProvider) Creates the AG-UI MVC controller bean.- Parameters:
registry- The agent registrysessionManager- The thread session managerprops- The configuration properties- Returns:
- A new AguiMvcController
-
aguiRestController
@Bean @ConditionalOnMissingBean public AguiRestController aguiRestController(AguiMvcController aguiMvcController, AguiProperties props, io.agentscope.core.agui.runtime.AguiRequestBodyParser requestBodyParser) Creates the REST controller for AG-UI endpoints.- Parameters:
aguiMvcController- The AG-UI MVC controllerprops- The configuration properties- Returns:
- A new AguiRestController
-