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. Setprotocol="json-rpc":
Methods
send_message
Send a message to an A2A agent and wait for the complete response.
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.
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.
AgentCard if available, None otherwise
aget_agent_card
Get the agent card for capability discovery asynchronously.
AgentCard if available, None otherwise
Response Types
TaskResult
Returned bysend_message():
StreamEvent
Yielded bystream_message():
Artifact
Represents files, images, or other artifacts from a task:AgentCard
Describes the capabilities of an A2A agent:Multi-Turn Conversations
Usecontext_id to maintain conversation context across multiple messages: