Skip to main content

A2UI A2A extension

a2ui-a2a connects the A2UI agent SDK to the Agent-to-Agent (A2A) protocol. It provides the a2ui.a2a package.

Installation

pip install a2ui-a2a

This installs a2ui-agent-sdk and a2a-sdk as dependencies.

Contents

a2ui.a2a contains:

  • Extension helpers: get_a2ui_agent_extension builds the AgentExtension that an agent advertises in its AgentCard, and try_activate_a2ui_extension activates the A2UI extension for a request when the client asks for it. get_a2ui_extension_uri and A2UI_EXTENSION_BASE_URI give the extension URI for a protocol version.
  • Part helpers: create_a2ui_part, is_a2ui_part and get_a2ui_datapart wrap and unwrap A2UI messages in A2A DataParts. to_a2a_parts converts the parts that A2uiRequestProcessor.parse_response() returns, and stream_response_to_parts reads a streamed response through a ResponseStream, such as one from A2uiRequestProcessor.open_stream(). Both leave validation errors to the caller. parse_content_to_parts parses a whole response with a Parser, such as A2uiRequestProcessor.parser, and logs and drops one that fails. A canvas agent passes it the RendererState it keeps with state=. extract_a2ui_json_to_parts extracts text and <a2ui-json> blocks into A2A parts without requiring a Parser or Catalog.
  • RPC helpers (v1.0): get_a2ui_messages returns the A2UI messages in an incoming A2A message's A2UI parts, such as a renderer's callAgentFunction or action, and create_a2ui_parts wraps the replies of RendererToAgentMessageProcessor (from a2ui.rpc) as A2UI parts.
from a2ui.a2a import create_a2ui_part, get_a2ui_agent_extension

extension = get_a2ui_agent_extension(version="0.9")
part = create_a2ui_part({"version": "v0.9", "deleteSurface": {"surfaceId": "main"}})

In an AgentExecutor, answer the renderer's agent function calls before running the agent's turn:

from a2ui.a2a import create_a2ui_parts, get_a2ui_messages
from a2ui.rpc import RendererToAgentMessageProcessor

processor = RendererToAgentMessageProcessor(request_processor.active_catalogs)

messages = get_a2ui_messages(context.message)
results = [await processor.process_message(message) for message in messages]
parts = create_a2ui_parts(reply for result in results for reply in result.replies)
...  # send `parts` to the client
if len(messages) < len(context.message.parts) or not all(
    result.handled for result in results
):
    ...  # run the agent's turn for the rest, such as text or an `action`

The specification of the extension is in a2ui_extension_specification.md.

Running tests

From the repository root:

uv run pytest python/a2ui_a2a/tests

The conformance cases are in conformance/extensions/a2a.

Building

From the python/a2ui_a2a directory:

uv build

Metadata

Release files for a2ui-a2a 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a2ui-a2a 0.3.0
File Size Uploaded Provenance Actions
a2ui_a2a-0.3.0.tar.gz 17.8 kB With provenance Details for a2ui_a2a-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for a2ui-a2a 0.3.0
File Interpreter ABI Platform Actions
a2ui_a2a-0.3.0-py3-none-any.whl Python 3 none any Details for a2ui_a2a-0.3.0-py3-none-any.whl

Total release size: 26.9 kB

Release files / a2ui_a2a-0.3.0.tar.gz

Download URL a2ui_a2a-0.3.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
386d81c5ebd32fbe6f01b1c439c4c57e978a1a993e83ecc7c2a05401418dc54a
BLAKE2b-256 checksum
How to use checksums
368b441e3a69e57d3957445995e9b7e75abcdc2f7c61b3fef2f50747a393566a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / a2ui_a2a-0.3.0-py3-none-any.whl

Download URL a2ui_a2a-0.3.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
155aa8887909c99223e0c4e3eff2906bb2ac30eef20f9910c9c4b920840cb7f1
BLAKE2b-256 checksum
How to use checksums
e79b73c2213c82a7fcec24d18738724ac5d6227a87fb2f3a286d8575fecd0f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 10, 2026.

Transparency log

Security for a2ui-a2a 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for a2ui_a2a-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page