Skip to content

Commit df770eb

Browse files
authored
Rename a2ui_extension to a2ui_agent (#516)
This major refactoring renames the python agent library from `a2ui_extension` to `a2ui_agent` to better reflect its purpose as a core agent library rather than just an extension. - Rename directory `a2a_agents/python/a2ui_extension` -> `a2a_agents/python/a2ui_agent`. - Refactor project structure: - Move extension source files to `src/a2ui/extension/` to support proper namespacing. - Move extension tests to `tests/extension/`. - Update pyproject.toml: - Rename project to `a2ui-agent`. - Configure `hatchling` build target. - Update README.md with new directory paths and testing instructions. - Fix imports in source and test files to match the new `a2ui.extension` namespace. - Update all sample agents (`contact_lookup`, `contact_multiple_surfaces`, `orchestrator`, `restaurant_finder`, `rizzcharts`) to use the new `a2ui-agent` package name and path. - Update python imports in all samples from `a2ui.a2ui_extension` to `a2ui.extension.a2ui_extension`. Verification: - Manually run the orchestration agent and client - All workflow are working as expected.
1 parent 4256db4 commit df770eb

34 files changed

Lines changed: 1492 additions & 1570 deletions

.gemini/GEMINI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ The A2UI repository is organized into several key directories:
2121
- `angular/`: Clients using Angular.
2222
- `mcp/`: MCP server samples (e.g., `flight_booking`).
2323
- `a2a_agents/`: Contains source code for A2A extension integrations.
24-
- `python/a2ui_extension/`: Python implementation of the A2UI A2A extension.
25-
- `java/`: Java implementation of the A2UI A2A extension.
24+
- `python/a2ui_agent/`: Python implementation of the A2UI agent library.
25+
- `java/`: Java implementation of the A2UI agent library.
2626
- `renderers/`: Contains renderer libraries.
2727
- `lit/`: The shared Lit renderer library used by the Lit clients.
2828
- `tools/`: Helper tools for development.

.github/workflows/python_samples_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ on:
2020
- main
2121
paths:
2222
- 'samples/agent/adk/**'
23-
- 'a2a_agents/python/a2ui_extension/**'
23+
- 'a2a_agents/python/a2ui_agent/**'
2424
pull_request:
2525
paths:
2626
- 'samples/agent/adk/**'
27-
- 'a2a_agents/python/a2ui_extension/**'
27+
- 'a2a_agents/python/a2ui_agent/**'
2828

2929
jobs:
3030
build:

a2a_agents/python/a2ui_extension/README.md renamed to a2a_agents/python/a2ui_agent/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
1-
# A2UI Extension Implementation
1+
# A2UI Agent Implementation
22

3-
a2ui_extension.py is the Python implementation of the a2ui extension.
4-
send_a2ui_to_client_toolset.py is an example Python implementation of using ADK toolcalls to implement A2UI.
3+
The `a2a_agents/python/a2ui_agent/` is the Python implementation of the a2ui agent library.
4+
5+
### Extension Components (`src/a2ui/extension`)
6+
7+
The `src/a2ui/extension` directory contains the core logic for the A2UI agent extension:
8+
9+
* **`a2ui_extension.py`**: Core utilities for extension management and A2UI part handling.
10+
* **`a2ui_schema_utils.py`**: Schema manipulation helpers.
11+
* **`send_a2ui_to_client_toolset.py`**: An example implementation of using ADK toolcalls to implement A2UI.
512

613
## Running Tests
714

8-
1. Navigate to the a2ui_extension dir:
15+
1. Navigate to the a2ui_agent dir:
916

1017
```bash
11-
cd a2a_agents/python/a2ui_extension
18+
cd a2a_agents/python/a2ui_agent
1219
```
1320

1421
2. Run the tests
1522

1623
```bash
17-
uv run --with pytest pytest tests/*.py
24+
uv run --with pytest pytest tests/
1825
```
1926

2027
## Disclaimer

a2a_agents/python/a2ui_extension/pyproject.toml renamed to a2a_agents/python/a2ui_agent/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
2-
name = "a2ui"
2+
name = "a2ui-agent"
33
version = "0.1.0"
4-
description = "A2UI Extension"
4+
description = "A2UI Agent"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
@@ -15,6 +15,9 @@ dependencies = [
1515
requires = ["hatchling"]
1616
build-backend = "hatchling.build"
1717

18+
[tool.hatch.build.targets.wheel]
19+
packages = ["src/a2ui"]
20+
1821
[[tool.uv.index]]
1922
url = "https://pypi.org/simple"
2023
default = true
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

a2a_agents/python/a2ui_extension/src/a2ui/a2ui_extension.py renamed to a2a_agents/python/a2ui_agent/src/a2ui/extension/a2ui_extension.py

File renamed without changes.

a2a_agents/python/a2ui_extension/src/a2ui/a2ui_schema_utils.py renamed to a2a_agents/python/a2ui_agent/src/a2ui/extension/a2ui_schema_utils.py

File renamed without changes.

a2a_agents/python/a2ui_extension/src/a2ui/send_a2ui_to_client_toolset.py renamed to a2a_agents/python/a2ui_agent/src/a2ui/extension/send_a2ui_to_client_toolset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ async def get_schema(ctx: ReadonlyContext) -> dict[str, Any]:
8585
import jsonschema
8686

8787
from a2a import types as a2a_types
88-
from a2ui.a2ui_extension import create_a2ui_part
89-
from a2ui.a2ui_schema_utils import wrap_as_json_array
88+
from a2ui.extension.a2ui_extension import create_a2ui_part
89+
from a2ui.extension.a2ui_schema_utils import wrap_as_json_array
9090
from google.adk.a2a.converters import part_converter
9191
from google.adk.agents.readonly_context import ReadonlyContext
9292
from google.adk.models import LlmRequest
File renamed without changes.

0 commit comments

Comments
 (0)