Skip to main content
The A2AClient provides an async interface for communicating with any A2A protocol compatible server. This includes Agno AgentOS instances with A2A interface enabled, Google ADK agents, and any other A2A-compatible agent server.

Basic Usage

Parameters

Connecting to Different Servers

Agno AgentOS

For Agno servers with A2A interface enabled, include the full agent path in the URL:

Google ADK

Google ADK uses pure JSON-RPC mode. Set protocol="json-rpc":

Methods

send_message

Send a message to an A2A agent and wait for the complete response.
Parameters: Returns: TaskResult Raises:
  • HTTPStatusError: If the server returns an HTTP error (4xx, 5xx)
  • RemoteServerUnavailableError: If connection fails or times out

stream_message

Stream a message response in real-time.
Parameters: Same as send_message Yields: StreamEvent Raises:
  • HTTPStatusError: If the server returns an HTTP error (4xx, 5xx)
  • RemoteServerUnavailableError: If connection fails or times out

get_agent_card

Get the agent card for capability discovery.
Returns: AgentCard if available, None otherwise

aget_agent_card

Get the agent card for capability discovery asynchronously.
Returns: AgentCard if available, None otherwise

Response Types

TaskResult

Returned by send_message():

StreamEvent

Yielded by stream_message():

Artifact

Represents files, images, or other artifacts from a task:

AgentCard

Describes the capabilities of an A2A agent:

Multi-Turn Conversations

Use context_id to maintain conversation context across multiple messages:

Error Handling