docs(integrations): fix broken a2ui-agent-sdk imports in A2UI guide - #2180
Open
rootkiller6788 wants to merge 1 commit into
Open
docs(integrations): fix broken a2ui-agent-sdk imports in A2UI guide#2180rootkiller6788 wants to merge 1 commit into
rootkiller6788 wants to merge 1 commit into
Conversation
The A2UI page imported modules that do not exist in the released a2ui-agent-sdk 0.5.0: a2ui.core.schema.manager and a2ui.core.parser.parser raise ModuleNotFoundError, and importing directly from the a2ui.a2a namespace package raises ImportError. Point all code blocks at the real module locations (a2ui.inference_formats.direct_json, a2ui.parser.parser, a2ui.a2a.parts, a2ui.a2a.extension) and switch to the recommended, non-deprecated DirectJsonFormat class. Also pass the now-required version argument (VERSION_0_9 from a2ui.schema.constants) to DirectJsonFormat, BasicCatalog.get_config, and get_a2ui_agent_extension, which otherwise raise TypeError.
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.
Problem
Every Python code block on the A2UI integration page fails against the released
a2ui-agent-sdk0.5.0:from a2ui.core.schema.manager import A2uiSchemaManager->ModuleNotFoundError: No module named 'a2ui.core.schema.manager'(there is noa2ui.corenamespace ina2ui-agent-sdk;A2uiSchemaManagerlives ina2ui.schema.manager, and the recommended class isDirectJsonFormatina2ui.inference_formats.direct_json)from a2ui.core.parser.parser import parse_response->ModuleNotFoundError: No module named 'a2ui.core.parser'(real path:a2ui.parser.parser)from a2ui.a2a import parse_response_to_parts/from a2ui.a2a import create_a2ui_part/from a2ui.a2a import get_a2ui_agent_extension->ImportError(thea2ui.a2apackage has no__init__.py; these symbols live ina2ui.a2a.partsanda2ui.a2a.extension)DirectJsonFormat(...),BasicCatalog.get_config(...), andget_a2ui_agent_extension(...)were called without the requiredversionargument ->TypeError: missing 1 required positional argument: 'version'Fix
a2ui.inference_formats.direct_json,a2ui.parser.parser,a2ui.a2a.parts,a2ui.a2a.extension,a2ui.schema.catalog,a2ui.schema.constants).DirectJsonFormatclass (A2uiSchemaManagerina2ui.schema.manageris a deprecated compatibility shim).version=VERSION_0_9(imported froma2ui.schema.constants) toDirectJsonFormat,BasicCatalog.get_config, andget_a2ui_agent_extension.Verification
Installed
a2ui-agent-sdk==0.5.0(with its declared depsa2ui-coreanda2a-sdk) in a clean virtualenv and executed every code block from the updated page end-to-end, includinggenerate_system_prompt,parse_response+selected_catalog.validator.validate,parse_response_to_parts,create_a2ui_part, andget_a2ui_agent_extension. All blocks pass.Fixes the import reported in #2131 and the additional broken imports found on the same page.