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
Copy file name to clipboardExpand all lines: docs/migrations/v1_0/README.md
+18-71Lines changed: 18 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,104 +86,51 @@ This affects every enum in the SDK: `TaskState`, `Role`.
86
86
87
87
### Message and Part construction
88
88
89
-
Constructing messages is simplified in v1.0. The old API required wrapping content in an intermediate type (`TextPart`, `FilePart`, `DataPart`) before placing it inside a `Part`. In v1.0, the wrapper types are removed and all content fields are set directly on the unified `Part` message.
89
+
Constructing messages is simplified in v1.0. The old API required wrapping content in an intermediate type (`TextPart`, `FilePart`, `DataPart`) before placing it inside a `Part`. In v1.0, the wrapper types are removed and content types are set directly on the `Part`.
90
90
91
-
| Part type | v0.3 | v1.0 |
92
-
|---|---|---|
93
-
| Text |`Part(TextPart(text=...))`|`Part(text=...)`|
| Structured data |`Part(DataPart(data={...}))`|`Part(data=json_format.ParseDict({...}, Value()))`|
97
-
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 `json_format.ParseDict` to convert from a Python dict.
91
+
Key changes:
92
+
-`Part(TextPart(text=...))` → `Part(text=...)` (flat union field)
0 commit comments