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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
DTO for POST /apps/{appName}/eval_sets/{evalSetId}/add-session requests.static class
Spring Boot REST Controller handling agent-related API endpoints.static class
Data Transfer Object (DTO) for POST /run and POST /run-sse requests.static class
A custom SpanExporter that stores relevant span data.static class
DTO for the response of GET /apps/{appName}/users/{userId}/sessions/{sessionId}/events/{eventId}/graph.static class
WebSocket Handler for the /run_live endpoint.static class
Configuration class for OpenTelemetry, setting up the tracer provider and span exporter.static class
DTO for POST /apps/{appName}/eval_sets/{evalSetId}/run-eval requests.static class
DTO for the response of POST /apps/{appName}/eval_sets/{evalSetId}/run-eval.static class
Service for creating and caching Runner instances.static class
Configuration class for WebSocket handling. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourceHandlers
(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) Configures resource handlers for serving static content (like the Dev UI).void
addViewControllers
(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry) Configures simple automated controllers: - Redirects the root path "/" to "/dev-ui".Provides the singleton instance of the ArtifactService (InMemory).loadedAgentRegistry
(AgentCompilerLoader loader, AgentLoadingProperties props) static void
Main entry point for the Spring Boot application.com.fasterxml.jackson.databind.ObjectMapper
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addErrorResponseInterceptors, addFormatters, addInterceptors, addReturnValueHandlers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
Constructor Details
-
AdkWebServer
public AdkWebServer()
-
-
Method Details
-
sessionService
-
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 interfaceorg.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 interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-
main
Main entry point for the Spring Boot application.- Parameters:
args
- Command line arguments.
-