mirror of
https://github.com/open-webui/open-webui
synced 2025-01-01 08:42:14 +00:00
fix
This commit is contained in:
parent
b1b2a6d78c
commit
cf0aca1487
@ -528,7 +528,14 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
event_emitter = None
|
event_emitter = None
|
||||||
if "session_id" in metadata:
|
if (
|
||||||
|
"session_id" in metadata
|
||||||
|
and metadata["session_id"]
|
||||||
|
and "chat_id" in metadata
|
||||||
|
and metadata["chat_id"]
|
||||||
|
and "message_id" in metadata
|
||||||
|
and metadata["message_id"]
|
||||||
|
):
|
||||||
event_emitter = get_event_emitter(metadata)
|
event_emitter = get_event_emitter(metadata)
|
||||||
|
|
||||||
if event_emitter:
|
if event_emitter:
|
||||||
@ -701,6 +708,7 @@ async def process_chat_response(request, response, user, events, metadata, tasks
|
|||||||
return {"status": True, "task_id": task_id}
|
return {"status": True, "task_id": task_id}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# Fallback to the original response
|
# Fallback to the original response
|
||||||
async def stream_wrapper(original_generator, events):
|
async def stream_wrapper(original_generator, events):
|
||||||
def wrap_item(item):
|
def wrap_item(item):
|
||||||
|
Loading…
Reference in New Issue
Block a user