a2ui-a2a connects the A2UI agent SDK to the
Agent-to-Agent (A2A) protocol. It provides the
a2ui.a2a package.
pip install a2ui-a2aThis installs a2ui-agent-sdk and a2a-sdk as dependencies.
a2ui.a2a contains:
- Extension helpers:
get_a2ui_agent_extensionbuilds theAgentExtensionthat an agent advertises in itsAgentCard, andtry_activate_a2ui_extensionactivates the A2UI extension for a request when the client asks for it.get_a2ui_extension_uriandA2UI_EXTENSION_BASE_URIgive the extension URI for a protocol version. - Part helpers:
create_a2ui_part,is_a2ui_partandget_a2ui_datapartwrap and unwrap A2UI messages in A2ADataParts.to_a2a_partsconverts the parts thatA2uiRequestProcessor.parse_response()returns, andstream_response_to_partsreads a streamed response through aResponseStream, such as one fromA2uiRequestProcessor.open_stream(). Both leave validation errors to the caller.parse_content_to_partsparses a whole response with aParser, such asA2uiRequestProcessor.parser, and logs and drops one that fails. A canvas agent passes it theRendererStateit keeps withstate=.
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"}})The specification of the extension is in
a2ui_extension_specification.md.
From the repository root:
uv run pytest python/a2ui_a2a/testsThe conformance cases are in
conformance/extensions/a2a.
From the python/a2ui_a2a directory:
uv build