docs: Improve streaming documentation with event diagrams and correct types#1780
Closed
darshjme wants to merge 2 commits intoopenai:masterfrom
Closed
docs: Improve streaming documentation with event diagrams and correct types#1780darshjme wants to merge 2 commits intoopenai:masterfrom
darshjme wants to merge 2 commits intoopenai:masterfrom
Conversation
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
There was a problem hiding this comment.
💡 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 likethread.run.completedorthread.run.requires_actionthat don't have convenience wrappers.Changes:
.on('event', ...)for events likethread.run.completedandthread.run.requires_action.on()typed event listeners andfor await...ofiterationTest plan
src/resources/responses/responses.ts,src/lib/AssistantStream.ts)