mirror of
https://github.com/open-webui/open-webui
synced 2025-05-22 05:53:20 +00:00
refac
This commit is contained in:
parent
1e67956db9
commit
d9f17225ef
@ -1172,7 +1172,7 @@ async def process_chat_response(
|
|||||||
|
|
||||||
reasoning_duration = block.get("duration", None)
|
reasoning_duration = block.get("duration", None)
|
||||||
|
|
||||||
if reasoning_duration:
|
if reasoning_duration is not None:
|
||||||
if raw:
|
if raw:
|
||||||
content = f'{content}\n<{block["tag"]}>{block["content"]}</{block["tag"]}>\n'
|
content = f'{content}\n<{block["tag"]}>{block["content"]}</{block["tag"]}>\n'
|
||||||
else:
|
else:
|
||||||
@ -1315,6 +1315,14 @@ async def process_chat_response(
|
|||||||
"content": leftover_content,
|
"content": leftover_content,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
content_blocks.append(
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"content": "",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Remove the block if content is empty
|
# Remove the block if content is empty
|
||||||
content_blocks.pop()
|
content_blocks.pop()
|
||||||
@ -1326,6 +1334,13 @@ async def process_chat_response(
|
|||||||
"content": leftover_content,
|
"content": leftover_content,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
content_blocks.append(
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"content": "",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# Clean processed content
|
# Clean processed content
|
||||||
content = re.sub(
|
content = re.sub(
|
||||||
|
Loading…
Reference in New Issue
Block a user