Skip to content

Commit

Permalink
chore(docs): fix typo in example snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Aug 14, 2024
1 parent 85e8935 commit 4e83b57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/openai/resources/beta/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def stream(
) as stream:
for event in stream:
if event.type == "content.delta":
print(event.content, flush=True, end="")
print(event.delta, flush=True, end="")
```
When the context manager is entered, a `ChatCompletionStream` instance is returned which, like `.create(stream=True)` is an iterator. The full list of events that are yielded by the iterator are outlined in [these docs](https://github.com/openai/openai-python/blob/main/helpers.md#chat-completions-events).
Expand Down Expand Up @@ -404,7 +404,7 @@ def stream(
) as stream:
async for event in stream:
if event.type == "content.delta":
print(event.content, flush=True, end="")
print(event.delta, flush=True, end="")
```
When the context manager is entered, an `AsyncChatCompletionStream` instance is returned which, like `.create(stream=True)` is an async iterator. The full list of events that are yielded by the iterator are outlined in [these docs](https://github.com/openai/openai-python/blob/main/helpers.md#chat-completions-events).
Expand Down

0 comments on commit 4e83b57

Please sign in to comment.