String Interpolation (v0.9) #453
Merged
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.
This pull request introduces support for string interpolation within the A2UI v0.9 protocol and includes documentation and schema refinements to improve modularity and LLM generation quality.
Key Changes
1. String Interpolation Mechanism
Introduced a string interpolation feature for all
DynamicStringproperties, allowing models to embed data-bound values and function results directly within strings.${expression}format (e.g.,"Hello, ${/user/name}!").${/path/to/value}) and relative paths (${itemName}) resolved against the current collection scope."Time: ${now()}").${formatDate(${/timestamp}, 'yyyy-MM-dd')}).\${for a literal${).2. Documentation and Schema Refactoring
a2ui_protocol.md.DynamicStringincommon_types.jsonto provide a verbose description, providing explicit instructions to LLMs on how to utilize the new interpolation syntax effectively.Impact on Client Implementations
While parsing "flat" interpolation can remain simple, supporting nested expressions will require client implementations to use either a basic recursive descent parser or a simple balanced-brace scanner. The grammar remains intentionally lightweight (avoiding logic/operators) to keep client-side overhead minimal.
Verification
common_types.json.a2ui_protocol.mdto serve as the definitive reference for the new feature.