routes.a2ui
A2UI protocol route for the pydantic-ai restaurant agent.
A2UIQueryRequest Objects
class A2UIQueryRequest(BaseModel)
Request model for A2UI query endpoint.
A2UIResponse Objects
class A2UIResponse(BaseModel)
Response model for A2UI endpoint.
restaurant_query
@router.post("/restaurant")
async def restaurant_query(request: A2UIQueryRequest) -> list[dict[str, Any]]
Handle restaurant search and booking queries via A2UI protocol.
Supports two types of requests:
- Query requests (query parameter): Search for restaurants
- Action requests (action + context): Handle button clicks, form submissions
Returns A2A-style response with A2UI messages as data parts.
restaurant_health
@router.get("/restaurant/health")
async def restaurant_health() -> dict[str, Any]
Health check for the A2UI restaurant endpoint.
support_assistant_query
@router.post("/support-assistant")
async def support_assistant_query(
request: A2UIQueryRequest) -> list[dict[str, Any]]
Handle support assistant chat and user actions via A2UI protocol.
Query requests build a support workflow UI with form components. Action requests process A2UI button events from that workflow.
support_assistant_health
@router.get("/support-assistant/health")
async def support_assistant_health() -> dict[str, Any]
Health check for the A2UI support assistant endpoint.