Agent to Agent Protocol (A2A)#

This page presents all APIs and classes related to Agent to Agent Protocol (A2A).

Connection Config#

class pyagentspec.a2aagent.A2AConnectionConfig(*, id=<factory>, name, description=None, metadata=<factory>, min_agentspec_version=AgentSpecVersionEnum.v25_4_2, max_agentspec_version=AgentSpecVersionEnum.v26_1_0, timeout=600.0, headers=None, verify=True, key_file=None, cert_file=None, ssl_ca_cert=None)#

Bases: Component

Class to specify configuration settings for establishing a connection in A2A communication.

Parameters:
  • id (str) – A unique identifier for this Component

  • name (str) – Name of this Component

  • description (str | None) – Optional description of this Component

  • metadata (Dict[str, Any] | None) – Optional, additional metadata related to this Component

  • min_agentspec_version (AgentSpecVersionEnum) –

  • max_agentspec_version (AgentSpecVersionEnum) –

  • timeout (float) – The maximum time in seconds to wait for HTTP requests to complete before timing out.

  • headers (Dict[str, str] | None) – A dictionary of HTTP headers to include in requests sent to the server.

  • verify (bool) – Determines whether the client verifies the server’s SSL certificate, enabling HTTPS. If True, the client will verify the server’s identity using the provided ssl_ca_cert. If False, disables SSL verification (not recommended for production environments).

  • key_file (str | None) – Path to the client’s private key file in PEM format, used for mTLS authentication.

  • cert_file (str | None) – Path to the client’s certificate chain file in PEM format, used for mTLS authentication.

  • ssl_ca_cert (str | None) – Path to the trusted CA certificate file in PEM format, used to verify the server’s identity.

Session Parameters#

class pyagentspec.a2aagent.A2ASessionParameters(*, timeout=60.0, poll_interval=2.0, max_retries=5)#

Bases: BaseModel

Class to specify parameters of the A2A session.

Parameters:
  • timeout (float) –

  • poll_interval (float) –

  • max_retries (int) –

max_retries: int#

The maximum number of retry attempts to establish a connection or receive a response before giving up.

poll_interval: float#

The time interval in seconds between polling attempts to check for a response from the server.