Skip to content

Commit ac09578

Browse files
committed
Merge branch 'migration' of https://github.com/sokoliva/a2a-python into migration
2 parents 3393c12 + 7a58bb8 commit ac09578

14 files changed

Lines changed: 40 additions & 2202 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ Install the core SDK and any desired extras using your preferred package manager
6868
| **gRPC Support** | `uv add "a2a-sdk[grpc]"` | `pip install "a2a-sdk[grpc]"` |
6969
| **OpenTelemetry Tracing**| `uv add "a2a-sdk[telemetry]"` | `pip install "a2a-sdk[telemetry]"` |
7070
| **Encryption** | `uv add "a2a-sdk[encryption]"` | `pip install "a2a-sdk[encryption]"` |
71-
| **Vertex AI Task Store** | `uv add "a2a-sdk[vertex]"` | `pip install "a2a-sdk[vertex]"` |
7271
| | | |
7372
| **Database Drivers** | | |
7473
| **PostgreSQL** | `uv add "a2a-sdk[postgresql]"` | `pip install "a2a-sdk[postgresql]"` |

docs/migrations/v1_0/README.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# Migration Guide: v0.3 → v1.0
1+
# A2A Python SDK Migration Guide: v0.3 → v1.0
22

3-
This guide covers the breaking changes introduced in `a2a-sdk` v1.0 and explains how to update your code. The changes reflect updates to the A2A protocol specification: [What's new in v1.0](https://a2a-protocol.org/latest/whats-new-v1/).
3+
The `a2a-sdk` has achieved a major milestone in stability and reliability with the update to full **A2A Protocol v1.0 compatibility**. This guide provides a detailed overview of the breaking changes in version `v1.0` and instructions for migrating your codebase.
44

5-
> **Related guides**: If you use the database persistence layer, also see the [Database Migration Guide](database/).
5+
Beyond protocol support, `v1.0` enhances the developer experience by introducing unified helper utilities for easier object creation and adopting Starlette route factory functions for more flexible server configuration.
6+
7+
This documentation details the technical upgrades and architectural modifications introduced in A2A Python SDK v1.0; For developers using the database persistence layer, please refer to the [Database Migration Guide](database/) for specific update instructions.
68

79
---
810

911
## Table of Contents
1012

11-
1. [Package Dependency](#1-package-dependency)
13+
1. [Update Dependency](#1-package-dependency)
1214
2. [Types](#2-types)
1315
3. [Server: DefaultRequestHandler](#3-server-defaultrequesthandler)
1416
4. [Server: Application Setup](#4-server-application-setup)
@@ -22,27 +24,40 @@ This guide covers the breaking changes introduced in `a2a-sdk` v1.0 and explains
2224

2325
---
2426

25-
## 1. Package Dependency
27+
## 1. Update Dependencies
28+
29+
(UV users) To upgrade to the latest version of the `a2a-sdk`, update the dependencies section in your `pyproject.toml` file.
30+
31+
| File | Before (`v0.3`) | After (`v1.0`) |
32+
|------------------|-----------------------------------|-----------------------------------|
33+
| `pyproject.toml` | dependencies = ["a2a-sdk>=0.3.0"] | dependencies = ["a2a-sdk>=1.0.0"] |
34+
35+
**Installation**
2636

27-
Update your dependency to the new version:
37+
After updating your configuration file, sync your environment:
38+
39+
* Using UV:
40+
41+
```bash
42+
uv sync
43+
```
2844

29-
```toml
30-
# pyproject.toml — before
31-
dependencies = ["a2a-sdk>=0.3.0"]
45+
* Using pip:
3246

33-
# pyproject.toml — after
34-
dependencies = ["a2a-sdk>=1.0.0"]
47+
```bash
48+
pip install --upgrade a2a-sdk
3549
```
3650

3751
---
3852

3953
## 2. Types
4054

41-
Types are now **Protobuf-based** instead of Pydantic models.
55+
Types have migrated from Pydantic models to Protobuf-based classes.
56+
4257

4358
### Enum values: snake_case → SCREAMING_SNAKE_CASE
4459

45-
All enum values have been renamed from snake_case strings to `SCREAMING_SNAKE_CASE`.
60+
All the enum values are now standardized from snake_case to **SCREAMING_SNAKE_CASE** format.
4661

4762
This affects every enum in the SDK: `TaskState`, `Role`.
4863

@@ -57,6 +72,7 @@ This affects every enum in the SDK: `TaskState`, `Role`.
5772
| `TaskState` | `TaskState.input_required` | `TaskState.TASK_STATE_INPUT_REQUIRED` |
5873
| `TaskState` | `TaskState.auth_required` | `TaskState.TASK_STATE_AUTH_REQUIRED` |
5974
| `TaskState` | `TaskState.rejected` | `TaskState.TASK_STATE_REJECTED` |
75+
|||
6076
| `Role` | *(no equivalent — protobuf default)* | `Role.ROLE_UNSPECIFIED` |
6177
| `Role` | `Role.user` | `Role.ROLE_USER` |
6278
| `Role` | `Role.agent` | `Role.ROLE_AGENT` |
@@ -83,15 +99,22 @@ message = Message(
8399
```
84100

85101
**After (v1.0):**
102+
103+
Using [A2A helper utilities](#helper-utilities)
104+
86105
```python
87106
from a2a.helpers import new_text_message
88107
from a2a.types import Role
89108

90-
# Use the helper for text messages
109+
# Use the helper function to create `Hello` message
91110
message = new_text_message(text="Hello", role=Role.ROLE_USER)
92111

93-
# Or construct directly
94-
from a2a.types import Message, Part
112+
```
113+
114+
Without helper utils, you can still construct directly
115+
116+
```python
117+
from a2a.types import Message, Part, Role
95118
from uuid import uuid4
96119

97120
message = Message(

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ mysql = ["sqlalchemy[asyncio,aiomysql]>=2.0.0"]
4343
signing = ["PyJWT>=2.0.0"]
4444
sqlite = ["sqlalchemy[asyncio,aiosqlite]>=2.0.0"]
4545
db-cli = ["alembic>=1.14.0"]
46-
vertex = ["google-cloud-aiplatform>=1.140.0"]
4746

4847
sql = ["a2a-sdk[postgresql,mysql,sqlite]"]
4948

@@ -55,7 +54,6 @@ all = [
5554
"a2a-sdk[telemetry]",
5655
"a2a-sdk[signing]",
5756
"a2a-sdk[db-cli]",
58-
"a2a-sdk[vertex]",
5957
]
6058

6159
[project.urls]

src/a2a/contrib/__init__.py

Whitespace-only changes.

src/a2a/contrib/tasks/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)