Class AgentscopeAguiWebFluxAutoConfiguration
java.lang.Object
io.agentscope.spring.boot.agui.webflux.AgentscopeAguiWebFluxAutoConfiguration
@AutoConfiguration
@ConditionalOnClass({org.springframework.web.reactive.function.server.RouterFunction.class,io.agentscope.core.agent.Agent.class})
@ConditionalOnBean(io.agentscope.core.agui.registry.AguiAgentRegistry.class)
@ConditionalOnWebApplication(type=REACTIVE)
@EnableConfigurationProperties(AguiProperties.class)
public class AgentscopeAguiWebFluxAutoConfiguration
extends Object
Spring Boot auto-configuration for AG-UI WebFlux integration.
This auto-configuration provides:
- AguiAgentRegistry bean for managing agents
- AguiWebFluxHandler bean for handling requests
- RouterFunction bean for routing to AG-UI 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 TypeMethodDescriptionorg.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse> aguiRoutes(AguiWebFluxHandler handler, AguiProperties props) Creates the router function for AG-UI endpoints.aguiWebFluxHandler(io.agentscope.core.agui.registry.AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props) Creates the AG-UI WebFlux handler bean.Creates the thread session manager bean.
-
Constructor Details
-
AgentscopeAguiWebFluxAutoConfiguration
public AgentscopeAguiWebFluxAutoConfiguration()
-
-
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
-
aguiWebFluxHandler
@Bean @ConditionalOnMissingBean public AguiWebFluxHandler aguiWebFluxHandler(io.agentscope.core.agui.registry.AguiAgentRegistry registry, ThreadSessionManager sessionManager, AguiProperties props) Creates the AG-UI WebFlux handler bean.- Parameters:
registry- The agent registrysessionManager- The thread session managerprops- The configuration properties- Returns:
- A new AguiWebFluxHandler
-
aguiRoutes
@Bean public org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse> aguiRoutes(AguiWebFluxHandler handler, AguiProperties props) Creates the router function for AG-UI endpoints.Provides two routes:
POST /agui/run- Agent ID from header or forwardedPropsPOST /agui/run/{agentId}- Agent ID from path variable (if enabled)
- Parameters:
handler- The AG-UI handlerprops- The configuration properties- Returns:
- The router function
-