Repository navigation
a2ui-agent-sdk 0.9.0
·
171 commits
to main
since this release
- BREAKING: Package dependency updated to require
a2ui-core>=0.4.0,<0.5.0. resolve_catalogs,validate_payload, and the Direct JSON and Express
formats resolve cross-catalog$refs between the catalogs they are given.
resolve_catalogsalso resolves references into registered catalogs that
the renderer doesn't support and into the unpruned catalogs that
transformers start from. It links per-request copies, so the registered
catalogs are never modified, and an inline catalog is only linked when the
agent accepts it.- BREAKING: Remove the
a2ui.schemapackage.- The constants move to
a2ui.constants. For example,
from a2ui.schema import A2UI_OPEN_TAGbecomes
from a2ui.constants import A2UI_OPEN_TAG. load_examples,resolve_examples_path,load_agent_to_renderer_schema
andload_common_types_schemamove toa2ui.utils.find_repo_root,get_spec_dir,get_basic_catalog_path,
get_basic_examples_dir,wrap_as_json_arrayanddeep_updateare
removed. The path helpers only worked in a repository checkout.- The
VERSION_0_8,VERSION_0_9,VERSION_0_9_1andVERSION_1_0
constants are removed. Use theProtocolVersionmembers from
a2ui.core.schemainstead, such asProtocolVersion.V0_9. Their values
carry a leading "v" ("v0.9");a2ui.utils.to_version_numberreturns the
bare form ("0.9") for paths and URIs. - The
SPECIFICATION_DIRconstant is removed.
- The constants move to
resolve_catalogsandA2uiGenerator.create_processorread v0.8
capabilities in the shape the v0.8 specification defines, the entry itself
({"supportedCatalogIds": [...]}), as well as keyed by"v0.8". From v0.9
the capabilities must be keyed by protocol version.- BREAKING: Move
a2ui.inference_formats.experimental.expressto
a2ui.inference_formats.express. ExpressCompiler: a variable holding a function call that names its
catalogId(total = formatString("...", catalogId="...")) is inlined
wherever it is used, like any other variable holding a function call.
Previously it was compiled as a component and failed with "Unknown component".- BREAKING: The agent SDK no longer depends on an agent framework.
a2ui.a2a
moves to the newa2ui-a2apackage anda2ui.adkto the newa2ui-adk
package, anda2a-sdk,google-adk,google-genaiandnest-asyncioare no
longer dependencies. Import paths are unchanged. To migrate, install the
packages you use:pip install a2ui-a2aandpip install "a2ui-adk[a2a]". - BREAKING:
FileResolverno longer createsgoogle.genaiparts.
to_genai_partandresolve_all_to_genai_partsmove to
a2ui.adk.GenAIFileResolver.FileResolver.resolve_allresolves a list of
file pointers, andresolve_allandas_tool_decoratortake aconvert
callback(bytes, mime_type) -> Any. Without one they return
(bytes, mime_type)tuples, andas_tool_decoratorinjects them into
resolved_filesinstead ofgenai_parts. To keep the old behavior, use
GenAIFileResolverfroma2ui-adk. - The experimental Elemental and Atom formats warn through an A2UI decorator
instead of ADK's. SetA2UI_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS
instead ofADK_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGSto silence the
warnings. DirectJsonParser.parse_chunkraisesA2uiValidationErroron the chunk that
closes an invalid v1.0 component. Previously the error was swallowed until the
block ended, and every component after it was held back.- BREAKING:
DirectJsonStreamParser,DirectJsonStreamParserModern,
DirectJsonStreamParserV08LegacyandDirectJsonFormat.create_stream_parser
are removed (#3074). To migrate, callparse_chunkon the parser that
DirectJsonFormat.create_parser()returns. It streams v0.8, v0.9 and v1.0,
and behaves differently from the removed parsers:- It adds no placeholder components. A parent is emitted with the child ids
it names before those children arrive. - A message that is still arriving is emitted whole each time it changes,
rather than pruned to the parts that parse. - A block whose messages never become valid, for example with an orphan or a
cycle, raises when it closes instead of dropping the bad parts. - Paths are emitted as written. The v0.8 parser added a leading slash.
- It adds no placeholder components. A parent is emitted with the child ids
DirectJsonParser.parse_chunkemits acreateSurfaceorbeginRendering
once, after its object closes, instead of again each time it grows. A string
that starts withhttp://,https://ordata:is never healed, even under
a progressive key, since a cut URL is a broken one.InferenceFormat.supports_streamingtells whether a format's parser
implementsparse_chunk.DirectJsonFormatreturnsTrue.validate_payloadaccepts a payload that creates a surface whose
components name children that a later message in the payload adds, and a
v0.8 payload that deletes a surface and starts it over.- BREAKING: Implement
A2uiGenerator,A2uiRequestProcessor,CatalogConfig,
CatalogProvider(FileSystemCatalogProvider,InMemoryCatalogProvider),
InferenceFormatFactory(DirectJsonFormatFactory,ExpressFormatFactory,
ElementalFormatFactory,AtomFormatFactory),PromptGenerator, and unified
Parser(ResponsePart,TextPart,A2uiPart,RawResponsePart,
RawA2uiPart) pera2ui_agent.blueprint.md.InferenceFormat.parseris
replaced byInferenceFormat.create_parser(),CatalogConfigmoves from
a2ui.schematoa2ui.processorwith
CatalogConfig(catalog, transformers=None)andtransformed_catalog, and
A2uiCatalogProvideris replaced byCatalogProvider. ComponentPruningTransformerandFunctionPruningTransformerkeep a
catalog's metadata and authored document, so a pruned catalog loaded from a
file serializes withto_json()as that file minus the pruned entries, with
the unions rebuilt. The macro expander builds the expanded catalog from
to_json(), keeping common type references and metadata (#3053).DirectJsonPromptGenerator(schema_to_prompt) embeds each active catalog's
Catalog.to_json()document alongside the prunedcommon_typesschema,
avoiding duplicate inlined common type definitions across multiple catalogs.- The SDK reads
Catalog.validation_schemainstead of the deprecated
catalog_schema(#3053). - A generated skill no longer falls back to the catalog's
descriptionwhen
none is given, since catalogs loaded withCatalog.from_jsonnow carry the
file's description (#3053).
Published to PyPI: a2ui-agent-sdk 0.9.0
pip install a2ui-agent-sdk==0.9.0