pub struct ServerConfig {
pub agent_loader: Arc<dyn AgentLoader>,
pub session_service: Arc<dyn SessionService>,
pub artifact_service: Option<Arc<dyn ArtifactService>>,
pub memory_service: Option<Arc<dyn Memory>>,
pub compaction_config: Option<EventsCompactionConfig>,
pub context_cache_config: Option<ContextCacheConfig>,
pub cache_capable: Option<Arc<dyn CacheCapable>>,
pub span_exporter: Option<Arc<AdkSpanExporter>>,
pub backend_url: Option<String>,
pub security: SecurityConfig,
pub request_context_extractor: Option<Arc<dyn RequestContextExtractor>>,
}Expand description
Configuration for the ADK server.
Fields§
§agent_loader: Arc<dyn AgentLoader>§session_service: Arc<dyn SessionService>§artifact_service: Option<Arc<dyn ArtifactService>>§memory_service: Option<Arc<dyn Memory>>§compaction_config: Option<EventsCompactionConfig>§context_cache_config: Option<ContextCacheConfig>§cache_capable: Option<Arc<dyn CacheCapable>>§span_exporter: Option<Arc<AdkSpanExporter>>§backend_url: Option<String>§security: SecurityConfig§request_context_extractor: Option<Arc<dyn RequestContextExtractor>>Implementations§
Source§impl ServerConfig
impl ServerConfig
pub fn new( agent_loader: Arc<dyn AgentLoader>, session_service: Arc<dyn SessionService>, ) -> Self
pub fn with_artifact_service( self, artifact_service: Arc<dyn ArtifactService>, ) -> Self
pub fn with_artifact_service_opt( self, artifact_service: Option<Arc<dyn ArtifactService>>, ) -> Self
Sourcepub fn with_memory_service(self, memory_service: Arc<dyn Memory>) -> Self
pub fn with_memory_service(self, memory_service: Arc<dyn Memory>) -> Self
Configure a memory service for semantic search across sessions.
When set, the runner injects memory into the invocation context,
allowing agents to search previous conversation content via
ToolContext::search_memory().
Sourcepub fn with_compaction(self, compaction_config: EventsCompactionConfig) -> Self
pub fn with_compaction(self, compaction_config: EventsCompactionConfig) -> Self
Configure automatic context compaction for long-running sessions.
Sourcepub fn with_context_cache(
self,
context_cache_config: ContextCacheConfig,
cache_capable: Arc<dyn CacheCapable>,
) -> Self
pub fn with_context_cache( self, context_cache_config: ContextCacheConfig, cache_capable: Arc<dyn CacheCapable>, ) -> Self
Configure automatic prompt-cache lifecycle management for cache-capable models.
pub fn with_backend_url(self, backend_url: impl Into<String>) -> Self
pub fn with_security(self, security: SecurityConfig) -> Self
pub fn with_span_exporter(self, span_exporter: Arc<AdkSpanExporter>) -> Self
Sourcepub fn with_allowed_origins(self, origins: Vec<String>) -> Self
pub fn with_allowed_origins(self, origins: Vec<String>) -> Self
Configure allowed CORS origins
Sourcepub fn with_max_body_size(self, size: usize) -> Self
pub fn with_max_body_size(self, size: usize) -> Self
Configure maximum request body size
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Configure request timeout
Sourcepub fn with_error_details(self, expose: bool) -> Self
pub fn with_error_details(self, expose: bool) -> Self
Enable detailed error messages (for development only)
Sourcepub fn with_request_context(
self,
extractor: Arc<dyn RequestContextExtractor>,
) -> Self
pub fn with_request_context( self, extractor: Arc<dyn RequestContextExtractor>, ) -> Self
Configure a request context extractor for auth middleware bridging.
When set, the server invokes the extractor on each incoming request
to extract authenticated identity (user_id, scopes, metadata) from
HTTP headers. The extracted context flows into InvocationContext,
making scopes available via ToolContext::user_scopes().
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more