Update contact multiple surfaces sample#569
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new a2ui-agent Python package with a centralized A2uiSchemaManager for handling A2UI schemas. This is a great architectural improvement, moving away from hardcoded schemas in the sample agents. The manager provides robust, multi-layered logic for loading schemas from package resources or the source repository, and includes functionality for bundling, pruning, and validating schemas. The sample agents (contact_lookup and contact_multiple_surfaces) are refactored to use this new manager, simplifying their code and making them more maintainable. The changes also include a Hatch build hook to package the schema files correctly and new tests for the added functionality.
I've found a couple of issues: one in a __main__ block in contact_lookup/prompt_builder.py that would cause a TypeError if run directly, and a logic error in contact_multiple_surfaces/agent.py where a check for a loaded schema was referencing a method instead of a property. I've provided suggestions to fix both. Overall, this is a well-executed and beneficial refactoring.
a2cc041 to
3eb5cf5
Compare
a76909c to
09e6b06
Compare
09e6b06 to
53244c8
Compare
0504cba to
aa67318
Compare
Introduces a `schema_modifiers` parameter to A2uiSchemaManager, allowing custom callable hooks to transform schemas after loading. This enables flexible schema customization, such as relaxing strict validation constraints during testing.
6d305ad to
8032361
Compare
It updates the sample to use the A2uiSchemaManager from the a2ui-agent python SDK. Tested: - [x] The `contact` lit client successfully connected to the `contact_multiple_surfaces` agent and rendered the response correctly.
8032361 to
248ab10
Compare
Description
It updates the sample to use the A2uiSchemaManager from the a2ui-agent python SDK.
Tested:
contactangular client successfully connected to thecontact_multiple_surfacesagent and rendered the response correctly.Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.