refac
This commit is contained in:
@@ -107,6 +107,7 @@ from open_webui.utils.filter import (
|
||||
)
|
||||
from open_webui.utils.code_interpreter import execute_code_jupyter
|
||||
from open_webui.utils.payload import apply_system_prompt_to_body
|
||||
from open_webui.utils.response import normalize_usage
|
||||
from open_webui.utils.mcp.client import MCPClient
|
||||
|
||||
|
||||
@@ -3121,10 +3122,11 @@ async def process_chat_response(
|
||||
else:
|
||||
choices = data.get("choices", [])
|
||||
|
||||
# 17421
|
||||
# 17421 - Normalize usage data to standard format
|
||||
usage = data.get("usage", {}) or {}
|
||||
usage.update(data.get("timings", {})) # llama.cpp
|
||||
if usage:
|
||||
usage = normalize_usage(usage)
|
||||
await event_emitter(
|
||||
{
|
||||
"type": "chat:completion",
|
||||
|
||||
Reference in New Issue
Block a user