streaming example with openai agents sdk#1055
Merged
deathbyknowledge merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
|
commit: |
bf3041e to
63dd2d1
Compare
mattzcarey
approved these changes
Mar 4, 2026
Comment on lines
+49
to
+50
| @callable({ streaming: true }) | ||
| async chat(stream: StreamingResponse, userMessage: string) { |
Contributor
There was a problem hiding this comment.
TIL you can do this so easily.
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.
This PR adds a streaming chat example using
openai/agents, which closes #481 and #530.It uses the
Agentclass and the native@callable({ streaming: true })decorator without the AI SDK or any other dependency.The example is fairly straightforward streaming chat with a single
getWeathertool.For reviewers: most files are just boilerplate so you'll want to take a look at:
openai-sdk/streaming-chat/src/client.tsxopenai-sdk/streaming-chat/src/server.ts