A2uiSchemaManager supports multiple versions via the constructor parameter. This is used to create the system instructions.
- Validators like
A2uiMessageListWrapper (and other files in src/a2ui/core/schema/*.py) are codegened from a specific version of a schema. This is defined in SPEC_VERSION
This is problematic because a client can call the former with a specific version of A2uiSchemaManager that is incompatible with the latter.
It's somewhat mitigated because the files in src/a2ui/core/schema/*.py are private(?). And there's a router in
|
v1_0_enabled = os.environ.get("A2UI_VERSION_1_0", "").lower() in ( |
|
"true", |
|
"1", |
|
"yes", |
|
) |
|
express_enabled = os.environ.get("A2UI_EXPRESS_ENABLED", "").lower() in ( |
|
"true", |
|
"1", |
|
"yes", |
|
) |
|
if v1_0_enabled or express_enabled: |
|
self._delegator = A2uiValidatorWrapperV10(catalog) |
|
else: |
|
raise A2uiCatalogError( |
|
"A2UI v1.0 validation is experimental and is disabled by default. " |
|
"To enable it, set the environment variable A2UI_VERSION_1_0=true." |
|
) |
|
else: |
|
self._delegator = A2uiValidatorWrapper(catalog) |
.
But this points towards us having two kinds of validation (with pydantic and also json schema).
A2uiSchemaManagersupports multiple versions via the constructor parameter. This is used to create the system instructions.A2uiMessageListWrapper(and other files insrc/a2ui/core/schema/*.py) are codegened from a specific version of a schema. This is defined inSPEC_VERSIONThis is problematic because a client can call the former with a specific version of
A2uiSchemaManagerthat is incompatible with the latter.It's somewhat mitigated because the files in
src/a2ui/core/schema/*.pyare private(?). And there's a router ina2ui/agent_sdks/python/a2ui_agent/src/a2ui/schema/validator.py
Lines 210 to 228 in a3f50cd
But this points towards us having two kinds of validation (with pydantic and also json schema).