We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I noticed a small but important issue in the streaming responses documentation, specifically in the async example.
In the async version of the streaming code, the following two issues appear:
Current code: async def main(): stream = client.responses.create(...) # Missing 'await' for event in stream: # Should be 'async for' print(event)
async def main(): stream = client.responses.create(...) # Missing 'await' for event in stream: # Should be 'async for' print(event)
Suggested fix: async def main(): stream = await client.responses.create(...) async for event in stream: print(event)
any
Python 3.8+
v1.72.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
Hi,
I noticed a small but important issue in the streaming responses documentation, specifically in the async example.
In the async version of the streaming code, the following two issues appear:
Current code:
async def main(): stream = client.responses.create(...) # Missing 'await' for event in stream: # Should be 'async for' print(event)
Suggested fix:
async def main():
stream = await client.responses.create(...)
async for event in stream:
print(event)
To Reproduce
Code snippets
OS
any
Python version
Python 3.8+
Library version
v1.72.0
The text was updated successfully, but these errors were encountered: