Skip to content

Commit 0aebad8

Browse files
authored
Do not filter out the usage updates. (#39381)
* Allow usage updates * Add changelog entry * Fix typo in CHANGELOG.md
1 parent cba2d62 commit 0aebad8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sdk/ai/azure-ai-inference/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bugs Fixed
1010

11+
* Fix a bug that caused filtering of a package with token usage from Azure OpenAI models in the streaming mode.
12+
1113
## 1.0.0b7 (2025-01-15)
1214

1315
### Features Added

sdk/ai/azure-ai-inference/azure/ai/inference/models/_patch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def _deserialize_and_add_to_queue(self, element: bytes) -> bool:
378378

379379
# We skip any update that has a None or empty choices list
380380
# (this is what OpenAI Python SDK does)
381-
if update.choices:
381+
if update.choices or update.usage:
382382

383383
# We update all empty content strings to None
384384
# (this is what OpenAI Python SDK does)

0 commit comments

Comments
 (0)