Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ stream = client.chat.completions.create(
messages=[{"role": "user", "content": "Say this is a test"}],
stream=True,
)
for chunk in stream:
for part in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")
print(part.choices[0].delta.content)
```

The async client uses the exact same interface.
Expand All @@ -111,9 +111,9 @@ stream = await client.chat.completions.create(
messages=[{"role": "user", "content": "Say this is a test"}],
stream=True,
)
async for chunk in stream:
async for part in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")
print(part.choices[0].delta.content)
```

## Module-level client
Expand Down