diff --git a/samples/agent/adk/restaurant_finder/prompt_builder.py b/samples/agent/adk/restaurant_finder/prompt_builder.py index 1cc8445e..ca52a2c2 100644 --- a/samples/agent/adk/restaurant_finder/prompt_builder.py +++ b/samples/agent/adk/restaurant_finder/prompt_builder.py @@ -809,7 +809,7 @@ def get_ui_prompt(base_url: str, examples: str) -> str: 1. Your response MUST be in two parts, separated by the delimiter: `---a2ui_JSON---`. 2. The first part is your conversational text response. 3. The second part is a single, raw JSON object which is a list of A2UI messages. - 4. The JSON part MUST validate against the A2UI JSON SCHEMA provided below. + 4. The JSON part MUST follow the A2UI JSON contract below. --- UI TEMPLATE RULES --- - If the query is for a list of restaurants, use the restaurant data you have already received from the `get_restaurants` tool to populate the `dataModelUpdate.contents` array (e.g., as a `valueMap` for the "items" key). @@ -820,9 +820,14 @@ def get_ui_prompt(base_url: str, examples: str) -> str: {formatted_examples} - ---BEGIN A2UI JSON SCHEMA--- - {A2UI_SCHEMA} - ---END A2UI JSON SCHEMA--- + ---BEGIN A2UI JSON CONTRACT--- + - The JSON MUST be a list of message objects. + - Each message object MUST contain exactly one of: `beginRendering`, `surfaceUpdate`, `dataModelUpdate`, `deleteSurface`. + - `beginRendering` MUST include: `surfaceId`, `root`. + - `surfaceUpdate` MUST include: `surfaceId`, `components` (array of objects with `id` and `component`). + - `dataModelUpdate` MUST include: `surfaceId`, `contents`. + - `deleteSurface` MUST include: `surfaceId`. + ---END A2UI JSON CONTRACT--- """