Skip to content

Commit 942c850

Browse files
committed
added AgentSkill
1 parent 7cebbc5 commit 942c850

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

docs/migrations/v1_0/README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ pip install --upgrade a2a-sdk
5757

5858
## 2. Types
5959

60-
[Types](https://github.com/a2aproject/a2a-python/blob/main/src/a2a/types/a2a_pb2.pyi) have migrated from Pydantic models to Protobuf-based classes to align with the A2A spec's proto-first design and adopt ProtoJSON as the canonical JSON serialization standard, ensuring consistent cross-implementation interoperability.
60+
[Types](https://github.com/a2aproject/a2a-python/blob/main/src/a2a/types/a2a_pb2.pyi) have migrated from Pydantic models to Protobuf-based classes to align with the A2A spec's proto-first design and to adopt ProtoJSON as the canonical JSON serialization standard, ensuring consistent cross-implementation interoperability.
6161

6262

6363
### Enum values: `snake_case``SCREAMING_SNAKE_CASE`
6464

65-
All the enum values are now [standardized](https://a2a-protocol.org/v1.0.0/specification/#55-json-field-naming-convention) to use `SCREAMING_SNAKE_CASE` format.
65+
All enum values are now [standardized](https://a2a-protocol.org/v1.0.0/specification/#55-json-field-naming-convention) to use `SCREAMING_SNAKE_CASE` format.
6666

6767
This affects every enum in the SDK: `TaskState`, `Role`.
6868

@@ -95,9 +95,9 @@ Constructing messages is simplified in v1.0. The old API required wrapping conte
9595
| File (URI) | `Part(FilePart(file=FileWithUri(uri=..., ...)))` | `Part(url=..., ...)` |
9696
| Structured data | `Part(DataPart(data=..., ...))` | `Part(data=..., ...)` |
9797

98-
> **Note on file bytes**: In v0.3 `FileWithBytes.bytes` was a **base64-encoded string**. In v1.0 `Part.raw` is raw **`bytes`** — no base64 encoding needed.
99-
100-
> **Note on structured data**: In v0.3 `DataPart.data` was a plain `dict`. In v1.0 `Part.data` is a `google.protobuf.Value`, so use `ParseDict` to convert from a Python dict.
98+
**Note**:
99+
* When using `File (bytes)` in v1.0, the data serialisatinon (via base64 encoding) is not required as A2A now uses Protobuf that automatically does it for you.
100+
* In v1.0, `Part.DataPart.data` is renamed to `Part.data` and is of type `google.protobuf.Value`. Use `ParseDict` to convert a Python dict into a suitable value. Check the examples below for better understanding.
101101

102102
**Before (v0.3):**
103103
```python
@@ -189,7 +189,7 @@ message = new_text_message(text="What's the weather in Warsaw?", role=Role.ROLE_
189189
### AgentCard Structure
190190

191191
Key changes:
192-
- Added `AgentInterface` class to support multiple transport bindings via the newly added `supported_interfaces` field in AgentCard.
192+
- Added an `AgentInterface` class to support multiple transport bindings via the newly added `supported_interfaces` field in AgentCard.
193193
- The `url` parameter in `AgentCard` is removed and is now part of `AgentInterface`.
194194
- Accepted values for `AgentInterface.protocol_binding`: `'JSONRPC'`, `'HTTP+JSON'`, `'GRPC'`
195195
- The `AgentCard.supports_authenticated_extended_card` field is renamed to `AgentCapabilities.extended_agent_card`.
@@ -200,6 +200,16 @@ Key changes:
200200
```python
201201
from a2a.types import AgentCard, AgentCapabilities, AgentSkill
202202

203+
skill = AgentSkill(
204+
id='hello_world',
205+
name='Hello World',
206+
description='Returns a Hello World message.',
207+
tags=['hello', 'world'],
208+
input_modes=['text/plain'],
209+
output_modes=['text/plain'],
210+
examples=['hello world'],
211+
)
212+
203213
agent_card = AgentCard(
204214
name='Hello World Agent',
205215
description='Returns Hello, World!',
@@ -222,6 +232,16 @@ agent_card = AgentCard(
222232
```python
223233
from a2a.types import AgentCard, AgentCapabilities, AgentInterface, AgentSkill
224234

235+
skill = AgentSkill(
236+
id='hello_world',
237+
name='Hello World',
238+
description='Returns a Hello World message.',
239+
tags=['hello', 'world'],
240+
input_modes=['text/plain'],
241+
output_modes=['text/plain'],
242+
examples=['hello world', 'Hello, World!'], # moved from AgentCard.examples
243+
)
244+
225245
agent_card = AgentCard(
226246
name='Hello World Agent',
227247
description='Returns Hello, World!',

0 commit comments

Comments
 (0)