[pull] main from openai:main by pull[bot] · Pull Request #106 · gitupdates/openai-python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
18 changes: 13 additions & 5 deletions examples/async_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@


async def main() -> None:
stream = await client.completions.create(
model="gpt-3.5-turbo-instruct",
prompt="Say this is a test",
stream = await client.chat.completions.create(
model="gpt-5.5",
messages=[
{
"role": "user",
"content": "Say this is a test",
},
],
stream=True,
)
async for completion in stream:
print(completion.choices[0].text, end="")
async for chunk in stream:
if not chunk.choices:
continue

print(chunk.choices[0].delta.content, end="")
print()


Expand Down
6 changes: 3 additions & 3 deletions examples/demo.py
Loading