feat(python): generate Pydantic models and basic catalog for A2UI spec v1.0 - #2308
Open
nan-yu wants to merge 1 commit into
Open
feat(python): generate Pydantic models and basic catalog for A2UI spec v1.0#2308nan-yu wants to merge 1 commit into
nan-yu wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for version 1.0 of the A2UI protocol, introducing auto-generated Pydantic models, components, and function APIs for v1_0, and updating multi-version protocol unions. Feedback on the changes highlights two key issues in the code generator: first, a regression where FunctionDefinition in v1_0 compiles to a StrictBaseModel that forbids extra properties, which should be fixed by dynamically injecting additionalProperties: True; second, a potential false positive in import matching where simple substring checks can incorrectly match shorter type names (like DynamicString inside DynamicStringList), which should be resolved using word boundary matching.
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 21:41
afd91b6 to
2b8c02c
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 21:58
2b8c02c to
298c40e
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:01
298c40e to
90c8e3f
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:03
90c8e3f to
74381fc
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:07
74381fc to
a40f0b7
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:31
a40f0b7 to
c435582
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:36
c435582 to
0bc127d
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:39
0bc127d to
9c40d87
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 22:42
9c40d87 to
e25f70f
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 17, 2026 23:38
e25f70f to
47fe72b
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 00:43
47fe72b to
907e350
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 01:19
907e350 to
2f933ad
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 04:07
2f933ad to
aa093bc
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
2 times, most recently
from
August 18, 2026 04:16
e65a90a to
d469d2f
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 04:29
d469d2f to
4716f6f
Compare
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 04:38
4716f6f to
22badcd
Compare
…c v1.0 - Generate Pydantic schema models for A2UI protocol v1.0 under `python/a2ui_core/src/a2ui/core/schema/v1_0/`: - `constants.py`: Spec constants (`SPEC_VERSION = "v1.0"`). - `common_types.py`: `StrictBaseModel`, dynamic value types, `DataBinding`, `FunctionCall`, `FunctionResponse`, `ComponentCommon`, `AccessibilityAttributes`. - `agent_to_renderer.py`: Modern outbound messages (`CreateSurfaceMessage`, `UpdateComponentsMessage`, `UpdateDataModelMessage`, `DeleteSurfaceMessage`, `CallRendererFunctionMessage`, `AgentFunctionResponseMessage`, `AgentToRendererMessage`). - `renderer_to_agent.py`: Modern inbound messages (`A2uiRendererActionMessage`, `CallAgentFunctionMessage`, `RendererFunctionResponseMessage`, `A2uiClientErrorMessage`, `RendererToAgentMessage`). - `renderer_capabilities.py`: `A2uiRendererCapabilities`, `V10Capabilities`, `InlineCatalog`, `FunctionDefinition`, `ValidationResult`. - Generate basic catalog components and function APIs for v1.0 under `python/a2ui_core/src/a2ui/core/basic_catalog/v1_0/`: - `components.py`: 18 basic component models and `BASIC_COMPONENTS` list. - `function_apis.py`: 14 basic function APIs with dynamic typing. - `__init__.py`: `BasicCatalog` registration for v1.0. - Register `A2uiProtocolVersion.V1_0 = "v1.0"` and update root schema envelope unions in `python/a2ui_core/src/a2ui/core/schema/__init__.py`. - Improve Pydantic generator (`codegen_pydantic.py`): - Dynamic `common_types` import computation based on actual symbols used in generated modules. - Strictly conditional `styles.py` and `FunctionDefinition` generation based on specification schema definitions. TAG=agy CONV=707c9b6b-b2da-4940-ba6e-67f0b4f1d563
nan-yu
force-pushed
the
v1_0_firing_python_6_generate_v10
branch
from
August 18, 2026 04:47
22badcd to
9fe708e
Compare
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.
Description
This PR is Layer 6 in the stacked PR series to implement comprehensive multi-version support and A2UI v1.0 execution in Python.
It generates and registers the strongly typed Pydantic data models and basic catalog definitions for A2UI protocol v1.0:
Schema Models (
python/a2ui_core/src/a2ui/core/schema/v1_0/):constants.py: Spec version constants (SPEC_VERSION = "v1.0").common_types.py:StrictBaseModel, dynamic value types (DynamicString,DynamicNumber,DynamicBoolean,DynamicValue),DataBinding,FunctionCall,FunctionResponse,ComponentCommon,AccessibilityAttributes.agent_to_renderer.py: Modern outbound messages (CreateSurfaceMessage,UpdateComponentsMessage,UpdateDataModelMessage,DeleteSurfaceMessage,CallRendererFunctionMessage,AgentFunctionResponseMessage,AgentToRendererMessage).renderer_to_agent.py: Modern inbound messages (A2uiRendererActionMessage,CallAgentFunctionMessage,RendererFunctionResponseMessage,A2uiClientErrorMessage,RendererToAgentMessage).renderer_capabilities.py:A2uiRendererCapabilities,V10Capabilities,InlineCatalog,FunctionDefinition,ValidationResult.__init__.py: Version export namespace and backward-compatibility aliases.Basic Catalog (
python/a2ui_core/src/a2ui/core/basic_catalog/v1_0/):components.py: 18 basic component models (TextComponent,ButtonComponent,VideoComponent,SliderComponent,TextFieldComponent, etc.) andBASIC_COMPONENTSregistration map.function_apis.py: 14 basic function APIs with dynamic arguments (RequiredApi,RegexApi,LengthApi,OpenUrlApi,AndApi,OrApi,NotApi, etc.).__init__.py:BasicCatalogclass bound tov1.0basic catalog ID.Multi-Version Protocol Root (
python/a2ui_core/src/a2ui/core/schema/__init__.py):V1_0 = "v1.0"inA2uiProtocolVersionenum.Generator Enhancements (
codegen_pydantic.py):common_typesimport computation based on actual symbols used in generated modules.styles.pyandFunctionDefinitionbased on schema definitions.The Stack
feat(skills): add automated Pydantic model generator skill for A2UI schemasfeat(python): establish versioned schema architecture and multi-version envelope unionsfeat(python): generate Pydantic model classes and basic catalog for A2UI spec v0.9feat(python): generate Pydantic model classes and basic catalog for A2UI spec v0.8feat(python): generate Pydantic models and basic catalog for A2UI spec v1.0Verification
uv run pyink --check .: Passeduv run --all-packages mypy .: Passed (106 source files checked, 0 errors)uv run pytest python/: Passed (722 passed, 2 skipped)TAG=agy
CONV=707c9b6b-b2da-4940-ba6e-67f0b4f1d563