a2ui-agent-sdk package.
Quick Start
Generative UI Flow
get_schema_manager()— load JSON schemas and cataloggenerate_a2ui_system_prompt()— inject schema into instructions- Agent returns A2UI JSON via tool or structured output
parse_a2ui_response()— validate and split text vs UI parts- External renderer draws the UI
Tool Input Shapes
send_a2ui_messages accepts:
| Input | Accepted |
|---|---|
| List of message dicts | Yes |
| JSON string of a list | Yes |
{"messages": [...]} dict | Yes |
| Single message dict | Yes (wrapped in a list) |
Best Practices
Prefer Generative UI for simple web apps
Prefer Generative UI for simple web apps
Generative UI covers most CopilotKit and structured-output cases with less setup.
Validate with parse_a2ui_response before sending to clients
Validate with parse_a2ui_response before sending to clients
Catch schema errors server-side before the renderer receives invalid JSON.
Use A2A DataParts for transport
Use A2A DataParts for transport
Wrap payloads with
create_a2ui_part() for application/json+a2ui compatibility.Related
Generative UI
Tiered UI options overview
Integrate A2UI Frontend
Connect any UI framework

