mirror of
https://github.com/open-webui/open-webui
synced 2025-06-03 19:27:12 +00:00
Merge 3510b3b4bd
into 343dac91c9
This commit is contained in:
commit
bb14543a6e
@ -1761,7 +1761,15 @@ async def process_chat_response(
|
||||
|
||||
delta = choices[0].get("delta", {})
|
||||
delta_tool_calls = delta.get("tool_calls", None)
|
||||
|
||||
if delta_tool_calls and content_blocks and content_blocks[-1]["type"] == "reasoning" and "duration" not in content_blocks[-1]:
|
||||
reasoning_block = content_blocks[-1]
|
||||
reasoning_block["ended_at"] = time.time()
|
||||
reasoning_block["duration"] = int(reasoning_block["ended_at"] - reasoning_block["started_at"])
|
||||
content_blocks.append({"type": "text", "content": ""})
|
||||
await event_emitter({
|
||||
"type": "chat:completion",
|
||||
"data": {"content": serialize_content_blocks(content_blocks)},
|
||||
})
|
||||
if delta_tool_calls:
|
||||
for delta_tool_call in delta_tool_calls:
|
||||
tool_call_index = delta_tool_call.get(
|
||||
|
Loading…
Reference in New Issue
Block a user