Commit 6722743
Generate dedicated Python session event types (#1063)
* Generate dedicated Python session event types
Align Python session event generation with the newer Go-style dedicated per-event payload model instead of the old merged quicktype Data shape. This updates the runtime/tests for typed payloads while preserving compatibility aliases and legacy Data behavior for existing callers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review and CI follow-ups
Fix the generated Python docstring escaping that CodeQL flagged, correct dotted-key normalization in the Data compatibility shim, update the stale Go local-cli docs snippet for the newer typed event API, and apply the Python formatter change required by CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Clarify typed Python event examples
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Align Python generator formats
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix SDK test formatting
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use runtime checks in Python README
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use isinstance in Python event examples
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use isinstance for broadcast events
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use match for Python event data
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Python SDK Ruff failures
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove Python session event shims
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Preserve Python event helper types
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Node.js lint and generated file drift
Normalize trailing whitespace in pyDocstringLiteral to prevent
cross-platform codegen drift, and reformat test file with Prettier.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Regenerate Python events and fix doc example
- Regenerate session_events.py to match latest schema (removes
session.import_legacy, adds reasoning_tokens to AssistantUsageData)
- Update docs/setup/local-cli.md Python example to use match-based
type narrowing with None check, consistent with python/README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 68f46b3 commit 6722743
File tree
15 files changed
+5305
-3028
lines changed- docs/setup
- nodejs/test
- python
- copilot
- generated
- e2e
- testharness
- samples
- scripts/codegen
15 files changed
+5305
-3028
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
103 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
120 | | - | |
121 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
60 | 63 | | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
| 341 | + | |
336 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
337 | 350 | | |
338 | 351 | | |
339 | 352 | | |
| |||
347 | 360 | | |
348 | 361 | | |
349 | 362 | | |
350 | | - | |
351 | | - | |
| 363 | + | |
| 364 | + | |
352 | 365 | | |
353 | | - | |
| 366 | + | |
354 | 367 | | |
355 | | - | |
| 368 | + | |
356 | 369 | | |
357 | | - | |
| 370 | + | |
358 | 371 | | |
359 | | - | |
| 372 | + | |
360 | 373 | | |
361 | 374 | | |
362 | | - | |
363 | | - | |
| 375 | + | |
| 376 | + | |
364 | 377 | | |
365 | 378 | | |
366 | | - | |
367 | | - | |
| 379 | + | |
| 380 | + | |
368 | 381 | | |
369 | 382 | | |
370 | 383 | | |
| |||
547 | 560 | | |
548 | 561 | | |
549 | 562 | | |
550 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
551 | 566 | | |
552 | 567 | | |
553 | 568 | | |
| |||
577 | 592 | | |
578 | 593 | | |
579 | 594 | | |
580 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
581 | 598 | | |
582 | 599 | | |
583 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments