Class AdkWebServer

java.lang.Object
com.google.adk.web.AdkWebServer
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@SpringBootApplication @ConfigurationPropertiesScan @ComponentScan(basePackages={"com.google.adk.web","com.google.adk.web.config"}) public class AdkWebServer extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Single-file Spring Boot application for the Agent Server. Combines configuration, DTOs, and controller logic.
  • Constructor Details

    • AdkWebServer

      public AdkWebServer()
  • Method Details

    • sessionService

      @Bean public BaseSessionService sessionService()
    • artifactService

      @Bean public BaseArtifactService artifactService()
      Provides the singleton instance of the ArtifactService (InMemory). TODO: configure this based on config (e.g., DB URL)
      Returns:
      An instance of BaseArtifactService (currently InMemoryArtifactService).
    • loadedAgentRegistry

      @Bean("loadedAgentRegistry") public Map<String, BaseAgent> loadedAgentRegistry(AgentCompilerLoader loader, AgentLoadingProperties props)
    • objectMapper

      @Bean public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
    • addResourceHandlers

      public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
      Configures resource handlers for serving static content (like the Dev UI). Maps requests starting with "/dev-ui/" to the directory specified by the 'adk.web.ui.dir' system property.
      Specified by:
      addResourceHandlers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addViewControllers

      public void addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
      Configures simple automated controllers: - Redirects the root path "/" to "/dev-ui". - Forwards requests to "/dev-ui" to "/dev-ui/index.html" so the ResourceHandler serves it.
      Specified by:
      addViewControllers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • main

      public static void main(String[] args)
      Main entry point for the Spring Boot application.
      Parameters:
      args - Command line arguments.