René's URL Explorer Experiment


Title: Add openai_agents streaming sample by jssmith · Pull Request #301 · temporalio/samples-python · GitHub

Open Graph Title: Add openai_agents streaming sample by jssmith · Pull Request #301 · temporalio/samples-python

X Title: Add openai_agents streaming sample by jssmith · Pull Request #301 · temporalio/samples-python

Description: Summary Adds an openai_agents/streaming/ sample demonstrating buffered token streaming for OpenAI Agents-backed workflows via temporalio.contrib.workflow_streams (experimental, contrib/pubsub branch of sdk-python). The OpenAI Agents plugin's ModelActivityParameters carries a streaming_event_topic; the model activity publishes raw TResponseStreamEvents to that topic, batched over streaming_event_batch_interval (default 100ms). The workflow emits a sentinel on a done topic when Runner.run_streamed finishes; subscribers iterate (events, done) and break on the sentinel. race_with_workflow handles the case where the workflow fails before publishing the sentinel. Two scenarios: stream_text — text-delta events from a simple haiku agent stream_items — agent-update / handoff / tool-call events across a multi-agent workflow with a joke-rating activity This is the second half of #299. Independent of the workflow_streams basics (separate PR), though both target the same sdk-python contrib branch. Test plan Build sdk-python from contrib/pubsub and install into the samples uv environment OPENAI_API_KEY=... uv run openai_agents/streaming/run_worker.py uv run openai_agents/streaming/run_stream_text_workflow.py — verify text deltas print as small bursts uv run openai_agents/streaming/run_stream_items_workflow.py — verify agent-update / tool-call / message-output events render in order

Open Graph Description: Summary Adds an openai_agents/streaming/ sample demonstrating buffered token streaming for OpenAI Agents-backed workflows via temporalio.contrib.workflow_streams (experimental, contrib/pubsub branc...

X Description: Summary Adds an openai_agents/streaming/ sample demonstrating buffered token streaming for OpenAI Agents-backed workflows via temporalio.contrib.workflow_streams (experimental, contrib/pubsub branc...

Opengraph URL: https://github.com/temporalio/samples-python/pull/301

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0e1ed094-14f3-d0f0-6e3e-fafc926879ec
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD71A:2A9EAA:14818E:1BF96C:6A4D2879
html-safe-nonced5c72355a8f643ce46b6125374e4377e2fe96235336f4ad0ef43006e8546c842
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzFBOjJBOUVBQToxNDgxOEU6MUJGOTZDOjZBNEQyODc5IiwidmlzaXRvcl9pZCI6IjY0NDA0ODIwODk4MjUyODIxNjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1d68e37b76551fe107148125856d156878fa3be5104e11914a370bc646f9fbd6
hovercard-subject-tagpull_request:3606237576
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/temporalio/samples-python/pull/301/files
twitter:imagehttps://avatars.githubusercontent.com/u/782994?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/782994?s=400&v=4
og:image:altSummary Adds an openai_agents/streaming/ sample demonstrating buffered token streaming for OpenAI Agents-backed workflows via temporalio.contrib.workflow_streams (experimental, contrib/pubsub branc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/temporalio/samples-python git https://github.com/temporalio/samples-python.git
octolytics-dimension-user_id56493103
octolytics-dimension-user_logintemporalio
octolytics-dimension-repository_id454557884
octolytics-dimension-repository_nwotemporalio/samples-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id454557884
octolytics-dimension-repository_network_root_nwotemporalio/samples-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release93f17a978ee60bc4668e1d7b90e6bd2d622261fd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/temporalio/samples-python/pull/301/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftemporalio%2Fsamples-python%2Fpull%2F301%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftemporalio%2Fsamples-python%2Fpull%2F301%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=temporalio%2Fsamples-python
Reloadhttps://github.com/temporalio/samples-python/pull/301/files
Reloadhttps://github.com/temporalio/samples-python/pull/301/files
Reloadhttps://github.com/temporalio/samples-python/pull/301/files
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
temporalio https://github.com/temporalio
samples-pythonhttps://github.com/temporalio/samples-python
Notifications https://github.com/login?return_to=%2Ftemporalio%2Fsamples-python
Fork 112 https://github.com/login?return_to=%2Ftemporalio%2Fsamples-python
Star 358 https://github.com/login?return_to=%2Ftemporalio%2Fsamples-python
Code https://github.com/temporalio/samples-python
Issues 28 https://github.com/temporalio/samples-python/issues
Pull requests 54 https://github.com/temporalio/samples-python/pulls
Actions https://github.com/temporalio/samples-python/actions
Security and quality 0 https://github.com/temporalio/samples-python/security
Insights https://github.com/temporalio/samples-python/pulse
Code https://github.com/temporalio/samples-python
Issues https://github.com/temporalio/samples-python/issues
Pull requests https://github.com/temporalio/samples-python/pulls
Actions https://github.com/temporalio/samples-python/actions
Security and quality https://github.com/temporalio/samples-python/security
Insights https://github.com/temporalio/samples-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftemporalio%2Fsamples-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftemporalio%2Fsamples-python%2Fissues%2Fnew%2Fchoose
jssmithhttps://github.com/jssmith
temporalio:mainhttps://github.com/temporalio/samples-python/tree/main
jssmith:openai-agents-streaming-samplehttps://github.com/jssmith/temporal-samples-python/tree/openai-agents-streaming-sample
Conversation 0 https://github.com/temporalio/samples-python/pull/301
Commits 2 https://github.com/temporalio/samples-python/pull/301/commits
Checks 10 https://github.com/temporalio/samples-python/pull/301/checks
Files changed https://github.com/temporalio/samples-python/pull/301/files
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
Add openai_agents streaming sample https://github.com/temporalio/samples-python/pull/301/files#top
Show all changes 2 commits https://github.com/temporalio/samples-python/pull/301/files
30048a6 Add openai_agents streaming sample jssmith Apr 30, 2026 https://github.com/temporalio/samples-python/pull/301/commits/30048a67690dedda4e733e762829fc80054a8439
3ddf52c samples: openai_agents streaming review polish jssmith Apr 30, 2026 https://github.com/temporalio/samples-python/pull/301/commits/3ddf52cab5b809f56038161d0d76886475abe5ff
Clear filters https://github.com/temporalio/samples-python/pull/301/files
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
README.md https://github.com/temporalio/samples-python/pull/301/files#diff-eeb24d88bba0bdfa0ca9e202395fdd703207cb01254d01c76f78eab428c79c41
README.md https://github.com/temporalio/samples-python/pull/301/files#diff-9aa5229076bf04f980b1a724c66bf81319e5f8e749b64c347e8e1a84b64cdcd5
__init__.py https://github.com/temporalio/samples-python/pull/301/files#diff-3bd5d0f00389fb647a42f480165a17ec143a36bdf813106e32d3ff389b6ffaeb
__init__.py https://github.com/temporalio/samples-python/pull/301/files#diff-fa44f0d6aba63c8957ff177265cc6a96d1f6d63fdf11451107a4828efb72cf2c
joke_activities.py https://github.com/temporalio/samples-python/pull/301/files#diff-c780d69b7be8d4f2768a61f6e7a392370e121c08324578a733218d783b4bcc8b
run_stream_items_workflow.py https://github.com/temporalio/samples-python/pull/301/files#diff-1623e26919ce5dea41e2f53d946a68334b6faeb0ceb42a26ac31c7cae3688acd
run_stream_text_workflow.py https://github.com/temporalio/samples-python/pull/301/files#diff-0370151422494a9f4266aa5ff70774182de0966ae5e8f413b5937277d2811d80
run_worker.py https://github.com/temporalio/samples-python/pull/301/files#diff-193b398e50332b820559c5ab2df5d91404e4a4d7320a2f9a37e10b5bc752ee41
shared.py https://github.com/temporalio/samples-python/pull/301/files#diff-ebac298245a4a25d09e46eb723747894ae4836ed72eacd4235e858717e1487f6
__init__.py https://github.com/temporalio/samples-python/pull/301/files#diff-2006d463850e9dc77445ff322ad651355e00b550581dd5a68cda2f1eb37f9505
stream_items_workflow.py https://github.com/temporalio/samples-python/pull/301/files#diff-fc46cf52def6ab6100576a06d40dcf399dc2f3d94f1acf6a36bc098ecdc8fc04
stream_text_workflow.py https://github.com/temporalio/samples-python/pull/301/files#diff-96e3137c6fe69a4c46be4ee38893163a24a3c19353792a687893bc01f2b621e5
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/README.mdhttps://github.com/temporalio/samples-python/pull/301/files#diff-eeb24d88bba0bdfa0ca9e202395fdd703207cb01254d01c76f78eab428c79c41
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/pull/301/files#diff-eeb24d88bba0bdfa0ca9e202395fdd703207cb01254d01c76f78eab428c79c41
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/README.mdhttps://github.com/temporalio/samples-python/pull/301/files#diff-9aa5229076bf04f980b1a724c66bf81319e5f8e749b64c347e8e1a84b64cdcd5
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/__init__.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-3bd5d0f00389fb647a42f480165a17ec143a36bdf813106e32d3ff389b6ffaeb
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/__init__.py
Open in desktop https://desktop.github.com
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/activities/__init__.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-fa44f0d6aba63c8957ff177265cc6a96d1f6d63fdf11451107a4828efb72cf2c
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/activities/__init__.py
Open in desktop https://desktop.github.com
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/activities/joke_activities.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-c780d69b7be8d4f2768a61f6e7a392370e121c08324578a733218d783b4bcc8b
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/activities/joke_activities.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/run_stream_items_workflow.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-1623e26919ce5dea41e2f53d946a68334b6faeb0ceb42a26ac31c7cae3688acd
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/run_stream_items_workflow.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/run_stream_text_workflow.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-0370151422494a9f4266aa5ff70774182de0966ae5e8f413b5937277d2811d80
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/run_stream_text_workflow.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/run_worker.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-193b398e50332b820559c5ab2df5d91404e4a4d7320a2f9a37e10b5bc752ee41
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/run_worker.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/shared.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-ebac298245a4a25d09e46eb723747894ae4836ed72eacd4235e858717e1487f6
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/shared.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/temporalio/samples-python/pull/301/{{ revealButtonHref }}
https://github.com/temporalio/samples-python/blob/main/.github/CODEOWNERS#L20
openai_agents/streaming/workflows/__init__.pyhttps://github.com/temporalio/samples-python/pull/301/files#diff-2006d463850e9dc77445ff322ad651355e00b550581dd5a68cda2f1eb37f9505
View file https://github.com/temporalio/samples-python/blob/3ddf52cab5b809f56038161d0d76886475abe5ff/openai_agents/streaming/workflows/__init__.py
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
Please reload this pagehttps://github.com/temporalio/samples-python/pull/301/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.