co-authored by
Fares
parent
35fbde0a3f
commit
a610d77137
@@ -111,6 +111,7 @@ from open_webui.utils.misc import (
|
||||
get_last_user_message_item,
|
||||
get_message_list,
|
||||
get_output_text,
|
||||
get_response_error_detail,
|
||||
get_reasoning_details,
|
||||
get_system_message,
|
||||
is_string_allowed,
|
||||
@@ -5958,6 +5959,9 @@ async def streaming_chat_response_handler(response, ctx):
|
||||
await stream_body_handler(res, new_form_data)
|
||||
output[:0] = prior_output
|
||||
prior_output = []
|
||||
elif getattr(res, 'status_code', 200) >= 400:
|
||||
await emit_message_error(get_message_error_content(get_response_error_detail(res)))
|
||||
break
|
||||
else:
|
||||
break
|
||||
except Exception as e:
|
||||
@@ -6142,6 +6146,9 @@ async def streaming_chat_response_handler(response, ctx):
|
||||
|
||||
if isinstance(res, StreamingResponse):
|
||||
await stream_body_handler(res, new_form_data)
|
||||
elif getattr(res, 'status_code', 200) >= 400:
|
||||
await emit_message_error(get_message_error_content(get_response_error_detail(res)))
|
||||
break
|
||||
else:
|
||||
break
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user