Commit 9de1581
committed
fix(python): add missing thinking events to Event union
The Event union type was missing the following event types that are
defined as BaseEvent subclasses:
- ThinkingStartEvent
- ThinkingEndEvent
- ThinkingTextMessageStartEvent
- ThinkingTextMessageContentEvent
- ThinkingTextMessageEndEvent
This caused validation errors when using TypeAdapter[Event] to parse
events from models that emit thinking events (e.g., Claude with
extended thinking).
Also adds a test to ensure all BaseEvent subclasses are included in
the Event union, preventing similar issues in the future.1 parent 137e58a commit 9de1581
2 files changed
+32
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
282 | 285 | | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
| 290 | + | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
599 | 625 | | |
| 626 | + | |
600 | 627 | | |
601 | 628 | | |
0 commit comments