Commit 6e65058
Fix: Use elif to prevent streaming token usage override
Changed the second if statement to elif in _calculate_completions_token_usage
to ensure that streaming_message_token_usage takes precedence over response.usage.
This prevents valid streaming usage data from being silently overwritten when
response has a usage attribute.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent d1ae0b2 commit 6e65058
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
| |||
0 commit comments