mirror of
https://github.com/open-webui/open-webui
synced 2025-03-04 11:29:59 +00:00
fix: openai usage display issue
This commit is contained in:
parent
b964b175d4
commit
7e2b2ec761
@ -1487,6 +1487,16 @@ async def process_chat_response(
|
||||
else:
|
||||
choices = data.get("choices", [])
|
||||
if not choices:
|
||||
usage = data.get("usage", {})
|
||||
if usage:
|
||||
await event_emitter(
|
||||
{
|
||||
"type": "chat:completion",
|
||||
"data": {
|
||||
"usage": usage,
|
||||
},
|
||||
}
|
||||
)
|
||||
continue
|
||||
|
||||
delta = choices[0].get("delta", {})
|
||||
|
Loading…
Reference in New Issue
Block a user