Feature/template schema 721#1276
Open
hrithik18k wants to merge 3 commits intogoogle:mainfrom
Open
Conversation
…tax (google#721) - Add JSON Schema (schema.json) for the A2UI template format - Defines required fields: name, version, catalogId, components - Defines optional fields: description, surfaceId, theme, dataSchema, dataModel - Uses JSON Schema draft 2020-12 consistent with the v0.9 spec - Add placeholder syntax specification (template_schema.md) - Formalizes {{path.to.field}} expression syntax and resolution rules - Documents type preservation (whole-string) vs string coercion (inline) - Specifies error behavior: KeyError on missing keys, no silent fallbacks - Clarifies relationship between {{}} (server-side inflation) and {"path": "..."} (client-side data binding) - Documents LLM response format (templateName + data) - Shows inflated output example (createSurface + updateComponents + updateDataModel) - Add 5 reference template examples: - restaurant-card: restaurant display with booking button - contact-card: contact info with icons and message button - product-detail: product with image and add-to-cart button - weather-summary: weather conditions card - booking-form: interactive form demonstrating {{}} + data binding coexistence - Add Template-based Inference section to agent_development.md All templates validated against schema.json via jsonschema. Part of google#657. Closes google#721.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a template-based inference system for the A2UI SDK, featuring a formal JSON schema, comprehensive documentation, and five reference templates for common UI layouts. The review feedback focuses on enhancing the JSON schema with stricter validation for URI formats, component IDs, and naming patterns, while also recommending improvements to type consistency and the removal of redundant properties in the example templates.
- Add format: uri to catalogId in schema.json - Add prefixItems to enforce root as first component - Fix defaultPartySize type: string -> number in booking_form.json - Remove redundant dataModel fields from booking_form.json - Clarify dot-key limitation in template_schema.md - Add kebab-case pattern to surfaceId in schema.json
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Implements Issue #721 — the formal template schema and data-binding specification for template-based inference (parent: #657).
Changes:
schema.json — JSON Schema 2020-12 defining the A2UI template format, including catalogId, dataSchema, dataModel, surfaceId, and {{}} component structure
template_schema.md — Full specification for {{}} placeholder syntax: path resolution, type preservation vs string coercion, error behaviour, and distinction from client-side {"path":"..."} data binding
5 reference templates: restaurant-card, contact-card, product-detail, weather-summary, booking-form
agent_development.md — Added "Template-based Inference" section
All templates validated against schema.json via jsonschema.
Part of #657. Closes #721.