From c88bd4a531b73a52e7bf0f02d1866e9ad60368b2 Mon Sep 17 00:00:00 2001 From: examon Date: Thu, 30 Jul 2026 09:42:49 +0000 Subject: [PATCH 1/2] docs: correct the Python and Go event data model tip The Python/Go tip in the streaming events reference described a single `Data` class/struct with every field optional, where fields that are not populated for an event come back as `None`/`nil`. Both bindings use a separate data type per event, so code written against that tip does not work: in Go `event.Data` is the `SessionEventData` interface and reading a field off it does not compile, and in Python `event.data` is a per-event dataclass, so reading a field that belongs to another event raises `AttributeError` instead of returning `None`. The tip was accurate when it was added and went stale when both bindings moved to per-event data types. Describe the per-event model instead, using the wording the same file already uses for .NET, and correct the copy of the same sentence that the docs style guide uses as its example of a language-qualified callout. --- .github/instructions/docs-style.instructions.md | 2 +- docs/features/streaming-events.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/instructions/docs-style.instructions.md b/.github/instructions/docs-style.instructions.md index 32ea46fbf..7f586e85d 100644 --- a/.github/instructions/docs-style.instructions.md +++ b/.github/instructions/docs-style.instructions.md @@ -49,7 +49,7 @@ When a callout applies to a specific language, put the qualifier as bold text in ```markdown > [!TIP] -> **(Python / Go)** These SDKs use a single `Data` class/struct with all fields optional. +> **(Python / Go)** These SDKs use separate, per-event data types. ``` ## Lists diff --git a/docs/features/streaming-events.md b/docs/features/streaming-events.md index 69e12e6dc..e2981b6d0 100644 --- a/docs/features/streaming-events.md +++ b/docs/features/streaming-events.md @@ -210,7 +210,7 @@ session.on(AssistantMessageDeltaEvent.class, event -> > [!TIP] -> **(Python / Go)** These SDKs use a single `Data` class/struct with all possible fields as optional/nullable. Only the fields listed in the tables below are populated for each event type—the rest will be `None` / `nil`. +> **(Python / Go)** These SDKs use separate, per-event data types (e.g., `AssistantMessageDeltaData`), so only the relevant fields exist on each type. > > [!TIP] > **(.NET)** The .NET SDK uses separate, strongly-typed data classes per event (e.g., `AssistantMessageDeltaData`), so only the relevant fields exist on each type. From ab0c274f9bfbb32656159738e8ecfba25f5b2e75 Mon Sep 17 00:00:00 2001 From: examon Date: Thu, 30 Jul 2026 10:55:14 +0000 Subject: [PATCH 2/2] docs: use 'for example' instead of 'e.g.' per style guide --- docs/features/streaming-events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/streaming-events.md b/docs/features/streaming-events.md index e2981b6d0..e5f140260 100644 --- a/docs/features/streaming-events.md +++ b/docs/features/streaming-events.md @@ -210,7 +210,7 @@ session.on(AssistantMessageDeltaEvent.class, event -> > [!TIP] -> **(Python / Go)** These SDKs use separate, per-event data types (e.g., `AssistantMessageDeltaData`), so only the relevant fields exist on each type. +> **(Python / Go)** These SDKs use separate, per-event data types (for example, `AssistantMessageDeltaData`), so only the relevant fields exist on each type. > > [!TIP] > **(.NET)** The .NET SDK uses separate, strongly-typed data classes per event (e.g., `AssistantMessageDeltaData`), so only the relevant fields exist on each type.