mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac: fallback to reasoning content
This commit is contained in:
parent
82a16f1305
commit
4bb5b39410
1 changed files with 22 additions and 16 deletions
|
|
@ -1490,8 +1490,6 @@ async def process_chat_response(
|
|||
TASKS.FOLLOW_UP_GENERATION in tasks
|
||||
and tasks[TASKS.FOLLOW_UP_GENERATION]
|
||||
):
|
||||
|
||||
print("Generating follow ups")
|
||||
res = await generate_follow_ups(
|
||||
request,
|
||||
{
|
||||
|
|
@ -1505,10 +1503,12 @@ async def process_chat_response(
|
|||
|
||||
if res and isinstance(res, dict):
|
||||
if len(res.get("choices", [])) == 1:
|
||||
follow_ups_string = (
|
||||
res.get("choices", [])[0]
|
||||
.get("message", {})
|
||||
.get("content", "")
|
||||
response_message = res.get("choices", [])[0].get(
|
||||
"message", {}
|
||||
)
|
||||
|
||||
follow_ups_string = response_message.get(
|
||||
"content", response_message.get("reasoning_content", "")
|
||||
)
|
||||
else:
|
||||
follow_ups_string = ""
|
||||
|
|
@ -1568,13 +1568,16 @@ async def process_chat_response(
|
|||
|
||||
if res and isinstance(res, dict):
|
||||
if len(res.get("choices", [])) == 1:
|
||||
title_string = (
|
||||
res.get("choices", [])[0]
|
||||
.get("message", {})
|
||||
.get(
|
||||
"content",
|
||||
response_message = res.get("choices", [])[0].get(
|
||||
"message", {}
|
||||
)
|
||||
|
||||
title_string = response_message.get(
|
||||
"content",
|
||||
response_message.get(
|
||||
"reasoning_content",
|
||||
message.get("content", user_message),
|
||||
)
|
||||
),
|
||||
)
|
||||
else:
|
||||
title_string = ""
|
||||
|
|
@ -1628,10 +1631,13 @@ async def process_chat_response(
|
|||
|
||||
if res and isinstance(res, dict):
|
||||
if len(res.get("choices", [])) == 1:
|
||||
tags_string = (
|
||||
res.get("choices", [])[0]
|
||||
.get("message", {})
|
||||
.get("content", "")
|
||||
response_message = res.get("choices", [])[0].get(
|
||||
"message", {}
|
||||
)
|
||||
|
||||
tags_string = response_message.get(
|
||||
"content",
|
||||
response_message.get("reasoning_content", ""),
|
||||
)
|
||||
else:
|
||||
tags_string = ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue