Skip to content

docs: Improve streaming documentation with event diagrams and correct types#1780

Closed
darshjme wants to merge 2 commits intoopenai:masterfrom
darshjme:docs/streaming-improvements
Closed

docs: Improve streaming documentation with event diagrams and correct types#1780
darshjme wants to merge 2 commits intoopenai:masterfrom
darshjme:docs/streaming-improvements

Conversation

@darshjme
Copy link
Copy Markdown

Summary

Addresses #860 -- the streaming documentation uses convenience event names (textCreated, textDelta, toolCallCreated) without explaining how they relate to the raw SSE events (thread.message.delta, thread.run.step.delta, etc.) from the API reference. This makes it hard to discover events like thread.run.completed or thread.run.requires_action that don't have convenience wrappers.

Changes:

  • helpers.md: Added a full Responses API streaming section with Mermaid sequence diagrams showing the event lifecycle, an event type reference table, and a tool-call flow diagram
  • helpers.md: Added a mapping table connecting each Assistant convenience event to its underlying SSE event(s), plus a Mermaid sequence diagram for the Assistant streaming lifecycle
  • helpers.md: Added a raw event listener example showing how to use .on('event', ...) for events like thread.run.completed and thread.run.requires_action
  • README.md: Expanded the streaming section with a Mermaid sequence diagram and examples showing both .on() typed event listeners and for await...of iteration

Test plan

  • Verify Mermaid diagrams render correctly on GitHub
  • Confirm event type names match the SDK source (src/resources/responses/responses.ts, src/lib/AssistantStream.ts)
  • Check all code examples for TypeScript correctness

Addresses #860 by clarifying the relationship between raw SSE events
and the SDK's convenience event listeners.

Changes:
- Add Responses API streaming section to helpers.md with Mermaid
  sequence diagrams showing the event lifecycle
- Add event type reference table for Responses streaming
- Add mapping table showing how Assistant convenience events (textDelta,
  toolCallCreated, etc.) relate to raw SSE events (thread.message.delta,
  thread.run.step.delta, etc.)
- Add Mermaid diagram for Assistant streaming lifecycle
- Add raw event listener example for Assistants (thread.run.completed,
  thread.run.requires_action) that were previously undocumented
- Update README streaming section with Mermaid diagram and typed event
  examples
@darshjme darshjme requested a review from a team as a code owner March 19, 2026 15:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4720553dd3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@darshjme darshjme closed this Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant