Skip to content

Conversation

lucasalencarxisto-stack

This PR adds two new async streaming examples under examples/:

  • async_responses_stream.py – Demonstrates async streaming with the Responses API, which is now the recommended primary API.

  • async_chat_stream.py – Shows async streaming with Chat Completions, still supported indefinitely for users migrating gradually.

Both scripts:

  • Use AsyncOpenAI and asyncio.run(...).

  • Include a Rye shebang to follow the contributing guide.

  • Provide minimal, working async loops that print incremental events/chunks for demo purposes.

These additions improve developer experience by providing clear, runnable async/streaming examples for both the new and legacy APIs without modifying existing examples.

@lucasalencarxisto-stack lucasalencarxisto-stack requested a review from a team as a code owner September 19, 2025 00:00
@lucasalencarxisto-stack
Copy link
Author

Hi team, thanks for maintaining this project! 🙌
I noticed there wasn’t an async streaming example for the new Responses API, so I added one, along with a matching Chat Completions async streaming example for users still on that API. Hopefully this makes it easier for newcomers to try async/streaming right away. Feedback is very welcome!

@lucasalencarxisto-stack lucasalencarxisto-stack force-pushed the docs/examples-async-responses-stream branch from 30bae1d to c7c2686 Compare September 19, 2025 00:21
@lucasalencarxisto-stack lucasalencarxisto-stack force-pushed the docs/examples-async-responses-stream branch from c7c2686 to 57e5a0e Compare September 19, 2025 00:29
Copy link
Author

@lucasalencarxisto-stack lucasalencarxisto-stack left a comment

Choose a reason for hiding this comment

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

Just updated the PR to include the actual file contents (previously empty by mistake). The examples are now complete and ready for review. Thanks for your time! 🙌

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.

1 participant