Skip to content

Commit cb83bdd

Browse files
committed
docs: refine Intro and expand v1.0 migration guide
1 parent 68b7dea commit cb83bdd

1 file changed

Lines changed: 39 additions & 16 deletions

File tree

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 — see the [A2A protocol 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)
@@ -20,27 +22,40 @@ This guide covers the breaking changes introduced in `a2a-sdk` v1.0 and explains
2022

2123
---
2224

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

25-
Update your dependency to the new version:
35+
After updating your configuration file, sync your environment:
36+
37+
* Using UV:
38+
39+
```bash
40+
uv sync
41+
```
2642

27-
```toml
28-
# pyproject.toml — before
29-
dependencies = ["a2a-sdk>=0.3.0"]
43+
* Using pip:
3044

31-
# pyproject.toml — after
32-
dependencies = ["a2a-sdk>=1.0.0"]
45+
```bash
46+
pip install --upgrade a2a-sdk
3347
```
3448

3549
---
3650

3751
## 2. Types
3852

39-
Types are now **Protobuf-based** instead of Pydantic models.
53+
Types have migrated from Pydantic models to Protobuf-based classes.
54+
4055

4156
### Enum values: snake_case → SCREAMING_SNAKE_CASE
4257

43-
All enum values have been renamed from snake_case strings to `SCREAMING_SNAKE_CASE`.
58+
All the enum values are now standardized from snake_case to **SCREAMING_SNAKE_CASE** format.
4459

4560
This affects every enum in the SDK: `TaskState`, `Role`.
4661

@@ -55,6 +70,7 @@ This affects every enum in the SDK: `TaskState`, `Role`.
5570
| `TaskState` | `TaskState.input_required` | `TaskState.TASK_STATE_INPUT_REQUIRED` |
5671
| `TaskState` | `TaskState.auth_required` | `TaskState.TASK_STATE_AUTH_REQUIRED` |
5772
| `TaskState` | `TaskState.rejected` | `TaskState.TASK_STATE_REJECTED` |
73+
|||
5874
| `Role` | *(no equivalent — protobuf default)* | `Role.ROLE_UNSPECIFIED` |
5975
| `Role` | `Role.user` | `Role.ROLE_USER` |
6076
| `Role` | `Role.agent` | `Role.ROLE_AGENT` |
@@ -81,15 +97,22 @@ message = Message(
8197
```
8298

8399
**After (v1.0):**
100+
101+
Using [A2A helper utilities](#helper-utilities)
102+
84103
```python
85104
from a2a.helpers import new_text_message
86105
from a2a.types import Role
87106

88-
# Use the helper for text messages
107+
# Use the helper function to create `Hello` message
89108
message = new_text_message(text="Hello", role=Role.ROLE_USER)
90109

91-
# Or construct directly
92-
from a2a.types import Message, Part
110+
```
111+
112+
Without helper utils, you can still construct directly
113+
114+
```python
115+
from a2a.types import Message, Part, Role
93116
from uuid import uuid4
94117

95118
message = Message(

0 commit comments

Comments
 (0)