mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-15 09:31:21 +00:00
fix: replies cut off at the token limit on a Responses API connection lose their token usage (#33619)
When a streamed reply from a Responses API connection stopped early, for example at the token limit or through a content filter, its token counts were lost. The chat showed no usage for that reply and the admin analytics recorded zero tokens for it. Such replies now keep the usage the provider reported, the same as replies that finished normally. Fixes #33615
This commit is contained in:
parent
fa09d74644
commit
aa1326eaea
1 changed files with 1 additions and 1 deletions
|
|
@ -835,7 +835,7 @@ def handle_responses_streaming_event(
|
|||
|
||||
return current_output, None
|
||||
|
||||
elif event_type == 'response.completed':
|
||||
elif event_type in ('response.completed', 'response.incomplete'):
|
||||
# State Machine Event: Completed
|
||||
response_data = data.get('response', {})
|
||||
final_output = response_data.get('output')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue