This commit is contained in:
Timothy Jaeryang Baek 2025-07-07 23:51:01 +04:00
parent 78dce85b03
commit 3a9d5b0494

View file

@ -2217,6 +2217,7 @@ async def process_chat_response(
content_blocks[-1]["type"] == "code_interpreter"
and retries < MAX_RETRIES
):
await event_emitter(
{
"type": "chat:completion",
@ -2349,9 +2350,7 @@ async def process_chat_response(
)
try:
res = await generate_chat_completion(
request,
{
new_form_data = {
"model": model_id,
"stream": True,
"messages": [
@ -2363,12 +2362,16 @@ async def process_chat_response(
),
},
],
},
}
res = await generate_chat_completion(
request,
new_form_data,
user,
)
if isinstance(res, StreamingResponse):
await stream_body_handler(res)
await stream_body_handler(res, new_form_data)
else:
break
except Exception as e: