Refactor: Update schema to use valueMap instead of valueList, clarify data model.
#83
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 updates the A2UI schema and examples to replace and deprecate
valueListwithvalueMapfor representing map-like data structures within the data model. It updates the samples as well as the evals and web examples to match.Changes:
a2ui_schema.py):valueListproperty in theDataModelUpdatecontents definition withvalueMap.valueMapis defined as an array of objects, where each object has akey(string) and one of thevalue*properties (valueString,valueNumber,valueBoolean).pathto clarify that/can be used to replace the entire data model.a2ui_examples.py):CONTACT_UI_EXAMPLESto usevalueMapto represent the list of contacts.valueMaparray, keyed by a unique identifier (e.g., "contact1", "contact2").valueMap.types.ts):DataModelUpdateinterface in the web library to reflect the schema change fromvalueListtovalueMap.Reasoning:
Using
valueMapprovides a more explicit and structured way to represent key-value pairs, improving clarity and consistency in how map-like data is handled within the A2UI framework. This change aligns the examples and types with the updated schema definition. Also, LLMS suck at dealing with list indices, so this helps them use string keys instead. They can always still use "1" and "2" as keys, but the examples help encourage strings.Eval results with new schema (N=2)
Evaluation Summary
Model: gemini-2.5-flash (thinking: 0)
Total failed runs: 5 / 44
Model: gemini-2.5-flash-lite (thinking: 0)
Total failed runs: 5 / 44
Overall Summary