Consuming a streaming response
Spot why the streamed chunks produce no text.
Codepython
stream = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hi"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].message.content, end="")What is the bug in consuming the stream?