Skip to content

Commit 2efdf05

Browse files
committed
add ## 5. Supporting v0.3 Clients
1 parent 722bbf1 commit 2efdf05

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

docs/migrations/v1_0/README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ This guide covers the breaking changes introduced in `a2a-sdk` v1.0 and explains
1212
2. [Types](#2-types)
1313
3. [Server: DefaultRequestHandler](#3-server-defaultrequesthandler)
1414
4. [Server: Application Setup](#4-server-application-setup)
15-
5. [Client: Creating a Client](#5-client-creating-a-client)
16-
6. [Client: Send Message](#6-client-send-message)
17-
7. [Client: Push Notifications Config](#7-client-push-notifications-config)
18-
8. [Helper Utilities](#8-helper-utilities)
15+
5. [Supporting v0.3 Clients](#5-supporting-v03-clients)
16+
6. [Client: Creating a Client](#6-client-creating-a-client)
17+
7. [Client: Send Message](#7-client-send-message)
18+
8. [Client: Push Notifications Config](#8-client-push-notifications-config)
19+
9. [Helper Utilities](#9-helper-utilities)
1920

2021
---
2122

@@ -238,7 +239,30 @@ uvicorn.run(app, host=host, port=port)
238239
239240
---
240241

241-
## 5. Client: Creating a Client
242+
## 5. Supporting v0.3 Clients
243+
244+
If you cannot update all clients at once, you can run a v1.0 server that simultaneously accepts v0.3 connections. Two changes are needed.
245+
246+
**1. Add the v0.3 AgentInterface to `supported_interfaces` in your `AgentCard`**:
247+
248+
```python
249+
supported_interfaces=[
250+
AgentInterface(protocol_binding='JSONRPC', protocol_version='0.3', url='http://localhost:9999/'),
251+
]
252+
```
253+
254+
**2. Enable the compat flag** on the relevant route factory:
255+
256+
```python
257+
create_jsonrpc_routes(request_handler, rpc_url='/', enable_v0_3_compat=True)
258+
create_rest_routes(request_handler, enable_v0_3_compat=True)
259+
```
260+
261+
> For a full working example see [`samples/hello_world_agent.py`](../../../samples/hello_world_agent.py). For known limitations see [issue #742](https://github.com/a2aproject/a2a-python/issues/742).
262+
263+
---
264+
265+
## 6. Client: Creating a Client
242266

243267
The `A2AClient` class has been removed. Use the new `create_client()` factory function.
244268

@@ -276,7 +300,7 @@ async with client:
276300
277301
---
278302

279-
## 6. Client: Send Message
303+
## 7. Client: Send Message
280304

281305
The key change in `BaseClient` is the return type of `send_message()`: it **now returns `AsyncIterator[StreamResponse]`** (v0.3 returned `AsyncIterator[ClientEvent | Message]`).
282306

@@ -309,7 +333,7 @@ Each `StreamResponse` yields exactly one of: `task`, `message`, `status_update`,
309333
310334
---
311335

312-
## 7. Client: Push Notifications Config
336+
## 8. Client: Push Notifications Config
313337

314338
`ClientConfig.push_notification_config` is now **singular** (a single `TaskPushNotificationConfig` or `None`), not a list.
315339

@@ -329,7 +353,7 @@ config = ClientConfig(
329353

330354
---
331355

332-
## 8. Helper Utilities
356+
## 9. Helper Utilities
333357

334358
A new `a2a.helpers` module consolidates helper functions into a single import. Most were previously available under `a2a.utils.*`; a few are new in v1.0.
335359

0 commit comments

Comments
 (0)