Skip to content

AI-310: add streaming sample for @temporalio/openai-agents#488

Draft
xumaple wants to merge 1 commit into
mainfrom
maplexu/AI-310-openai-agents-streaming-samples
Draft

AI-310: add streaming sample for @temporalio/openai-agents#488
xumaple wants to merge 1 commit into
mainfrom
maplexu/AI-310-openai-agents-streaming-samples

Conversation

@xumaple

@xumaple xumaple commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Adds a streaming scenario to the openai-agents samples, demonstrating run(agent, input, { stream: true }) over a Workflow Stream: a Workflow that hosts a WorkflowStream, 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-streams publish — CI is red against the published packages until then.

@xumaple xumaple force-pushed the maplexu/AI-310-openai-agents-streaming-samples branch from 87a001b to 1c30408 Compare June 30, 2026 16:51
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.
@xumaple xumaple force-pushed the maplexu/AI-310-openai-agents-streaming-samples branch from 1c30408 to 99e58ee Compare June 30, 2026 17:06
plugins: [
new OpenAIAgentsPlugin({
modelProvider: new OpenAIProvider({ apiKey }),
modelParams: { streamingTopic, streamingBatchInterval: '200 milliseconds' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The client needs OPENAI_API_KEY too (client.ts: 14-17), prefix with OPENAI_API_KEY=sk-... ?

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.

2 participants