pub struct A2aServerBuilder { /* private fields */ }server only.Expand description
Builder for configuring an A2A server with custom settings.
Allows customization of the agent card metadata, session service, bind address, and capabilities before building the server app.
§Defaults
- Session service:
InMemorySessionService - Bind address:
0.0.0.0:8080 - Agent card name: from
agent.name() - Agent card description: from
agent.description() - Agent card version:
"1.0.0" - Agent card URL:
http://localhost:8080 - Streaming: enabled
- Push notifications: disabled
Implementations§
Source§impl A2aServerBuilder
impl A2aServerBuilder
Sourcepub fn agent(self, agent: Arc<dyn Agent>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn agent(self, agent: Arc<dyn Agent>) -> A2aServerBuilder
a2a-v1 only.Set the agent to expose via A2A protocol.
This is required — the builder will return an error if no agent is set.
Sourcepub fn session_service(
self,
service: Arc<dyn SessionService>,
) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn session_service( self, service: Arc<dyn SessionService>, ) -> A2aServerBuilder
a2a-v1 only.Set a custom session service implementation.
Defaults to InMemorySessionService if not specified.
Sourcepub fn bind_addr(self, addr: impl Into<String>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn bind_addr(self, addr: impl Into<String>) -> A2aServerBuilder
a2a-v1 only.Set the bind address for the server.
Defaults to "0.0.0.0:8080".
Sourcepub fn agent_card_name(self, name: impl Into<String>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn agent_card_name(self, name: impl Into<String>) -> A2aServerBuilder
a2a-v1 only.Override the agent card name.
Defaults to agent.name().
Sourcepub fn agent_card_description(self, desc: impl Into<String>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn agent_card_description(self, desc: impl Into<String>) -> A2aServerBuilder
a2a-v1 only.Override the agent card description.
Defaults to agent.description().
Sourcepub fn agent_card_version(self, version: impl Into<String>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn agent_card_version(self, version: impl Into<String>) -> A2aServerBuilder
a2a-v1 only.Override the agent card version.
Defaults to "1.0.0".
Sourcepub fn agent_card_url(self, url: impl Into<String>) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn agent_card_url(self, url: impl Into<String>) -> A2aServerBuilder
a2a-v1 only.Override the agent card URL.
Defaults to "http://localhost:8080".
Sourcepub fn streaming(self, enabled: bool) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn streaming(self, enabled: bool) -> A2aServerBuilder
a2a-v1 only.Enable or disable streaming support.
Defaults to true.
Sourcepub fn push_notifications(self, enabled: bool) -> A2aServerBuilder
Available on crate feature a2a-v1 only.
pub fn push_notifications(self, enabled: bool) -> A2aServerBuilder
a2a-v1 only.Enable or disable push notifications.
Defaults to false.
Sourcepub fn build(self) -> Result<A2aServerApp, AdkError>
Available on crate feature a2a-v1 only.
pub fn build(self) -> Result<A2aServerApp, AdkError>
a2a-v1 only.