pub struct ClientConfig {
pub preferred_bindings: Vec<String>,
pub accepted_output_modes: Vec<String>,
pub history_length: Option<u32>,
pub return_immediately: bool,
pub request_timeout: Duration,
pub stream_connect_timeout: Duration,
pub connection_timeout: Duration,
pub tls: TlsConfig,
}Expand description
Configuration for an crate::A2aClient instance.
Build via crate::ClientBuilder. Reasonable defaults are provided for all
fields; most users only need to set the agent URL.
Fields§
§preferred_bindings: Vec<String>Ordered list of preferred protocol bindings.
The client tries each in order, selecting the first one supported by the
target agent’s card. Defaults to ["JSONRPC"].
accepted_output_modes: Vec<String>MIME types the client will advertise in acceptedOutputModes.
Defaults to ["text/plain", "application/json"].
history_length: Option<u32>Number of historical messages to include in task responses.
None means use the agent’s default.
return_immediately: boolIf true, send_message returns immediately with the submitted task
rather than waiting for completion.
request_timeout: DurationPer-request timeout for non-streaming calls.
Defaults to 30 seconds.
stream_connect_timeout: DurationPer-request timeout for establishing the SSE stream.
Once the stream is established this timeout no longer applies. Defaults to 30 seconds.
connection_timeout: DurationTCP connection timeout (DNS + handshake).
Prevents the client from hanging for the OS default (~2 minutes) when the server is unreachable. Defaults to 10 seconds.
tls: TlsConfigTLS configuration.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn default_http() -> ClientConfig
pub fn default_http() -> ClientConfig
Returns the default configuration suitable for connecting to a local or well-known agent over plain HTTP.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more