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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.agentscope.core.agui.runtime.AguiRequestBodyParser
    Creates the default AG-UI request body parser bean.
    org.springframework.web.reactive.function.server.RouterFunction<org.springframework.web.reactive.function.server.ServerResponse>
    Creates the router function for AG-UI endpoints.
    aguiWebFluxHandler(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, io.agentscope.core.agui.runtime.AguiRequestBodyParser requestBodyParser)
    Creates the AG-UI WebFlux handler bean.
    Creates the thread session manager bean.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • 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
    • aguiWebFluxHandler

      @Bean @ConditionalOnMissingBean public AguiWebFluxHandler aguiWebFluxHandler(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, io.agentscope.core.agui.runtime.AguiRequestBodyParser requestBodyParser)
      Creates the AG-UI WebFlux handler bean.
      Parameters:
      registry - The agent registry
      sessionManager - The thread session manager
      props - 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 forwardedProps
      • POST /agui/run/{agentId} - Agent ID from path variable (if enabled)
      Parameters:
      handler - The AG-UI handler
      props - The configuration properties
      Returns:
      The router function