Skip to content

Commit 34e1edf

Browse files
committed
docs(helpers): make async client usage more clear
closes #1639
1 parent 153e4a4 commit 34e1edf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

helpers.md

+4
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ It also supports all aforementioned [parsing helpers](#parsing-helpers).
139139
Unlike `.create(stream=True)`, the `.stream()` method requires usage within a context manager to prevent accidental leakage of the response:
140140

141141
```py
142+
from openai import AsyncOpenAI
143+
144+
client = AsyncOpenAI()
145+
142146
async with client.beta.chat.completions.stream(
143147
model='gpt-4o-2024-08-06',
144148
messages=[...],

0 commit comments

Comments
 (0)