diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 6a3e4b6f5b..50d8617298 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -4784,6 +4784,9 @@ async def streaming_chat_response_handler(response, ctx): 'content': [{'type': 'output_text', 'text': initial_content}], } ] + if not continuing: + # the client needs this item before the first delta arrives + await event_emitter({'type': 'chat:completion', 'data': {'output': output}}) else: output = []