You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`TextPart` is no longer needed; use `Part(text=...)` directly
102
104
105
+
> **Example**: [`helloworld/test_client.py` in PR #474](https://github.com/a2aproject/a2a-samples/pull/474/files#diff-f62c07d3b00364a3100b7effb3e2a1cca0624277d3e40da1bdb07bb46b6a8cef)
106
+
103
107
### AgentCard Structure
104
108
105
109
The `AgentCard` has been significantly restructured to support multiple transport interfaces.
106
110
107
-
#### `url` → `supported_interfaces`
108
-
109
-
The top-level `url` field is replaced by a list of `AgentInterface` objects, each describing a specific transport endpoint.
111
+
Key differences:
112
+
-`url` is gone; use `supported_interfaces` with one or more `AgentInterface` entries
113
+
-`AgentCapabilities.input_modes` and `AgentCapabilities.output_modes` are removed from `AgentCapabilities`; use `AgentCard.default_input_modes` / `AgentCard.default_output_modes` for card-level defaults, or `AgentSkill.input_modes` / `AgentSkill.output_modes` for per-skill overrides
114
+
-`supports_authenticated_extended_card` is no longer a top-level `AgentCard` field; it has moved into `AgentCapabilities` and is renamed to `extended_agent_card`
-`examples` field has moved to `AgentSkill.examples` (set it per skill instead)
110
117
111
118
**Before (v0.3):**
112
119
```python
@@ -117,15 +124,16 @@ agent_card = AgentCard(
117
124
description='...',
118
125
url='http://localhost:9999/',
119
126
version='1.0.0',
120
-
default_input_modes=['text'],
121
-
default_output_modes=['text'],
127
+
default_input_modes=['text/plain'],
128
+
default_output_modes=['text/plain'],
122
129
supports_authenticated_extended_card=True,
123
130
capabilities=AgentCapabilities(
124
-
input_modes=['text'],
125
-
output_modes=['text'],
131
+
input_modes=['text/plain'],
132
+
output_modes=['text/plain'],
126
133
streaming=True,
127
134
),
128
135
skills=[skill],
136
+
examples=['example'],
129
137
)
130
138
```
131
139
@@ -143,8 +151,8 @@ agent_card = AgentCard(
143
151
)
144
152
],
145
153
version='1.0.0',
146
-
default_input_modes=['text'],
147
-
default_output_modes=['text'],
154
+
default_input_modes=['text/plain'],
155
+
default_output_modes=['text/plain'],
148
156
capabilities=AgentCapabilities(
149
157
streaming=True,
150
158
extended_agent_card=True,
@@ -153,11 +161,7 @@ agent_card = AgentCard(
153
161
)
154
162
```
155
163
156
-
Key differences:
157
-
-`url` is gone; use `supported_interfaces` with one or more `AgentInterface` entries
158
-
-`AgentCapabilities.input_modes` and `AgentCapabilities.output_modes` are removed
159
-
-`supports_authenticated_extended_card` is no longer a top-level `AgentCard` field; it has moved into `AgentCapabilities` and is renamed to `extended_agent_card`
The `ClientTaskManager` class and `Consumers` abstraction have been removed. Response handling is now done directly by iterating the stream returned from `send_message()`.
278
+
> **Example**: [`a2a-mcp-without-framework/client/agent.py` in PR #509](https://github.com/a2aproject/a2a-samples/pull/509/files#diff-56cfce97ff9686166e4b14790ffb7ed46f4c14519261ce5c18365a53cf05e9aa) (`create_client()` usage)
287
279
288
280
---
289
281
@@ -297,7 +289,7 @@ There is now a single `send_message()` method on the client that returns a strea
-`MessageSendParams` wrapper is gone; `message` is a field directly on `SendMessageRequest`
344
-
- Response chunks are `StreamResponse` proto messages; use `HasField()` to check the payload type
336
+
-`send_message()` returns `AsyncIterator[StreamResponse]`; iterate with `async for`
337
+
- Each `StreamResponse` has a `payload` oneof — use `HasField()` to check which field is set (`'task'`, `'message'`, `'status_update'`, `'artifact_update'`)
345
338
- Agent outputs should now be published as **Artifacts**, not status message text
346
339
340
+
> **Example**: [`helloworld/test_client.py` in PR #474](https://github.com/a2aproject/a2a-samples/pull/474/files#diff-f62c07d3b00364a3100b7effb3e2a1cca0624277d3e40da1bdb07bb46b6a8cef)
341
+
347
342
---
348
343
349
344
## 7. Client: Push Notifications Config
@@ -368,26 +363,23 @@ config = ClientConfig(
368
363
369
364
## 8. Helper Utilities
370
365
371
-
A new `a2a.helpers` module provides convenience functions previously scattered across`a2a.utils.*` and adds new helpers for v1.0 proto types.
366
+
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.
372
367
373
368
```python
374
369
from a2a.helpers import (
375
-
# --- moved from a2a.utils.* ---
376
-
new_text_message, # was a2a.utils.message.new_agent_text_message; gained role param
377
-
new_message, # was a2a.utils.message.new_agent_parts_message; gained role param
378
-
get_message_text, # was a2a.utils.message.get_message_text
379
-
new_text_artifact, # was a2a.utils.artifact.new_text_artifact; gained artifact_id param
380
-
new_artifact, # was a2a.utils.artifact.new_artifact; gained artifact_id param
381
-
get_artifact_text, # was a2a.utils.artifact.get_artifact_text
382
-
get_text_parts, # was a2a.utils.parts.get_text_parts
383
-
new_task_from_user_message, # was a2a.utils.task.new_task; renamed, now validates role == ROLE_USER
384
-
385
-
# --- new in v1.0 ---
370
+
display_agent_card, # print a human-readable summary of an AgentCard to stdout
371
+
get_artifact_text, # join all text parts of an Artifact into a single string (delimiter='\n')
372
+
get_message_text, # join all text parts of a Message into a single string (delimiter='\n')
373
+
get_stream_response_text, # extract text from a StreamResponse proto message
374
+
get_text_parts, # return a list of raw text strings from a sequence of Parts (skips non-text parts)
375
+
new_artifact, # create an Artifact from a list of Parts, name, optional description and artifact_id
376
+
new_message, # create a Message from a list of Parts with role (default ROLE_AGENT), optional task_id/context_id
386
377
new_task, # create a Task with explicit task_id, context_id, and state
378
+
new_task_from_user_message, # create a TASK_STATE_SUBMITTED Task from a user Message; raises if role != ROLE_USER or parts are empty
379
+
new_text_artifact, # create an Artifact with a single text Part, name, optional description and artifact_id
387
380
new_text_artifact_update_event, # create a TaskArtifactUpdateEvent with a text artifact
381
+
new_text_message, # create a Message with a single text Part; role defaults to ROLE_AGENT
388
382
new_text_status_update_event, # create a TaskStatusUpdateEvent with a text message
389
-
get_stream_response_text, # extract text from a StreamResponse proto message
390
-
display_agent_card, # print a human-readable summary of an AgentCard to stdout
0 commit comments