AI-310: add streaming sample for @temporalio/openai-agents#488
Draft
xumaple wants to merge 1 commit into
Draft
Conversation
87a001b to
1c30408
Compare
Add a streaming scenario to the openai-agents samples: a Workflow that hosts a
WorkflowStream and runs an agent with run(agent, input, { stream: true }), a
Worker configured with the streaming topic, and a client that subscribes to the
model stream events live from outside the Workflow via WorkflowStreamClient.
1c30408 to
99e58ee
Compare
DABH
reviewed
Jul 1, 2026
| plugins: [ | ||
| new OpenAIAgentsPlugin({ | ||
| modelProvider: new OpenAIProvider({ apiKey }), | ||
| modelParams: { streamingTopic, streamingBatchInterval: '200 milliseconds' }, |
There was a problem hiding this comment.
The worker is setting streamingBatchInterval here but the client just passes { streamingTopic } - I think that means the interval doesn't actually get set (worker-side plugin modelParams don't enter the sandbox?). Can you double check the examples for this?
| OPENAI_API_KEY=sk-... npx ts-node src/streaming/worker.ts | ||
|
|
||
| # In another terminal, start the streaming client: | ||
| npx ts-node src/streaming/client.ts |
There was a problem hiding this comment.
The client needs OPENAI_API_KEY too (client.ts: 14-17), prefix with OPENAI_API_KEY=sk-... ?
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.
Adds a streaming scenario to the openai-agents samples, demonstrating
run(agent, input, { stream: true })over a Workflow Stream: a Workflow that hosts aWorkflowStream, a Worker configured with the streaming topic, and a client that subscribes to model stream events live from outside the Workflow.Draft until
@temporalio/openai-agents(with streaming) and@temporalio/workflow-streamspublish — CI is red against the published packages until then.