pub struct ServerConfig {
pub agent_loader: Arc<dyn AgentLoader>,
pub session_service: Arc<dyn SessionService>,
pub artifact_service: Option<Arc<dyn ArtifactService>>,
pub backend_url: Option<String>,
pub security: SecurityConfig,
}Available on crate feature
server only.Expand description
Configuration for the ADK server.
Fields§
§agent_loader: Arc<dyn AgentLoader>§session_service: Arc<dyn SessionService>§artifact_service: Option<Arc<dyn ArtifactService>>§backend_url: Option<String>§security: SecurityConfigImplementations§
Source§impl ServerConfig
impl ServerConfig
pub fn new( agent_loader: Arc<dyn AgentLoader>, session_service: Arc<dyn SessionService>, ) -> ServerConfig
pub fn with_artifact_service( self, artifact_service: Arc<dyn ArtifactService>, ) -> ServerConfig
pub fn with_artifact_service_opt( self, artifact_service: Option<Arc<dyn ArtifactService>>, ) -> ServerConfig
pub fn with_backend_url(self, backend_url: impl Into<String>) -> ServerConfig
pub fn with_security(self, security: SecurityConfig) -> ServerConfig
Sourcepub fn with_allowed_origins(self, origins: Vec<String>) -> ServerConfig
pub fn with_allowed_origins(self, origins: Vec<String>) -> ServerConfig
Configure allowed CORS origins
Sourcepub fn with_max_body_size(self, size: usize) -> ServerConfig
pub fn with_max_body_size(self, size: usize) -> ServerConfig
Configure maximum request body size
Sourcepub fn with_request_timeout(self, timeout: Duration) -> ServerConfig
pub fn with_request_timeout(self, timeout: Duration) -> ServerConfig
Configure request timeout
Sourcepub fn with_error_details(self, expose: bool) -> ServerConfig
pub fn with_error_details(self, expose: bool) -> ServerConfig
Enable detailed error messages (for development only)
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerConfig
impl !RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl !UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request