Skip to content

Commit 25e4b65

Browse files
authored
[DOCS] Fix README sample for resposne streaming (#600)
The focus of these changes is to fix the Response streaming sample in the README, which drifted from the current API.
1 parent 4b53727 commit 25e4b65

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,19 @@ await foreach (StreamingResponseUpdate update
519519
},
520520
}))
521521
{
522-
if (update is StreamingResponseItemUpdate itemUpdate
522+
if (update is StreamingResponseOutputItemAddedUpdate itemUpdate
523523
&& itemUpdate.Item is ReasoningResponseItem reasoningItem)
524524
{
525525
Console.WriteLine($"[Reasoning] ({reasoningItem.Status})");
526526
}
527-
else if (update is StreamingResponseContentPartDeltaUpdate deltaUpdate)
527+
else if (update is StreamingResponseOutputItemAddedUpdate itemDone
528+
&& itemDone.Item is ReasoningResponseItem reasoningDone)
528529
{
529-
Console.Write(deltaUpdate.Text);
530+
Console.WriteLine($"[Reasoning DONE] ({reasoningDone.Status})");
531+
}
532+
else if (update is StreamingResponseOutputTextDeltaUpdate delta)
533+
{
534+
Console.Write(delta.Delta);
530535
}
531536
}
532537
```

0 commit comments

Comments
 (0)