Repository navigation
feat(ux-demos): add dynamic UI rendering sample in Python and TypeScript - #341
Merged
arronbailiss merged 2 commits intoNov 3, 2026
Merged
Conversation
An agent that answers with UI components chosen from an app-defined catalog. The catalog (Pydantic / Zod) is the render_ui tool's input schema, so the model can only emit supported components and Strands validates them. A shared no-build web client renders each component type and sends form and button interactions back to the agent.
Use the template's heading case, move the prompts into Example Queries, and add Additional Resources.
|
Latest scan for commit: ✅ Security Scan Report (PR Files Only)Scanned Files
Security Scan Results
Threshold: High No security issues detected in your changes. Great job! This scan only covers files changed in this PR. |
arronbailiss
marked this pull request as ready for review
November 3, 2026 01:53
arronbailiss
enabled auto-merge (squash)
November 3, 2026 01:53
opieter-aws
approved these changes
Nov 3, 2026
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.
Human Overview
Add a sample focused on dynamic agent-driven UI generation
Description
Adds a sample, in both Python and TypeScript, of an agent that answers with UI components rather than just text. The app defines a component catalog as a schema (Pydantic in Python, Zod in TypeScript), and that schema is the input of a
render_uitool. The model can only produce components the app supports, and Strands validates them before the app sees them. A shared plain HTML and JavaScript client renders each component type and sends form submits and button clicks back to the agent, which acts on them and renders again.The existing AG-UI sample maps each tool to a predefined React component. Here the agent chooses the components and lays them out itself, with no frontend framework or build step, so the pattern can be lifted into any app.
python/07-ux-demos/dynamic-ui: FastAPI servertypescript/03-ux-demos/dynamic-ui: Express server, in a new TypeScript UX Demos categoryBoth samples use the same web client, dataset, components and prompts.
Testing
summarize_workoutstool and match the dataset.ruff checkandruff format --check; TypeScript passestsc.node generate-samples-manifest.mjs --checkandnode --test generate-samples-manifest.test.mjspass.site/scripts/samples/sync.tsin harness-sdk). Both guide pages build, and the screenshot and cross-sample links resolve.127.0.0.1only.Both prompts have the agent call
render_uibefore its final reply. Without that, the TypeScript SDK could fail on an empty final turn from Bedrock (strands-agents/harness-sdk#5763, fix in strands-agents/harness-sdk#5762).