mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
78dce85b03
commit
3a9d5b0494
1 changed files with 17 additions and 14 deletions
|
|
@ -2217,6 +2217,7 @@ async def process_chat_response(
|
||||||
content_blocks[-1]["type"] == "code_interpreter"
|
content_blocks[-1]["type"] == "code_interpreter"
|
||||||
and retries < MAX_RETRIES
|
and retries < MAX_RETRIES
|
||||||
):
|
):
|
||||||
|
|
||||||
await event_emitter(
|
await event_emitter(
|
||||||
{
|
{
|
||||||
"type": "chat:completion",
|
"type": "chat:completion",
|
||||||
|
|
@ -2349,9 +2350,7 @@ async def process_chat_response(
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
res = await generate_chat_completion(
|
new_form_data = {
|
||||||
request,
|
|
||||||
{
|
|
||||||
"model": model_id,
|
"model": model_id,
|
||||||
"stream": True,
|
"stream": True,
|
||||||
"messages": [
|
"messages": [
|
||||||
|
|
@ -2363,12 +2362,16 @@ async def process_chat_response(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
|
|
||||||
|
res = await generate_chat_completion(
|
||||||
|
request,
|
||||||
|
new_form_data,
|
||||||
user,
|
user,
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(res, StreamingResponse):
|
if isinstance(res, StreamingResponse):
|
||||||
await stream_body_handler(res)
|
await stream_body_handler(res, new_form_data)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue