From 738abb59190d049efe6ab7df72115409ee5c372c Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:01:57 -0500 Subject: [PATCH] docs(readme): update examples (#893) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3861b7db2b..96865aba78 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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