mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
fix: fixed missing text in the explanation feature (#19829)
This commit is contained in:
@@ -624,14 +624,17 @@ def stream_chunks_handler(stream: aiohttp.StreamReader):
|
||||
yield line
|
||||
else:
|
||||
yield b"data: {}"
|
||||
yield b"\n"
|
||||
else:
|
||||
# Normal mode: check if line exceeds limit
|
||||
if len(line) > max_buffer_size:
|
||||
skip_mode = True
|
||||
yield b"data: {}"
|
||||
yield b"\n"
|
||||
log.info(f"Skip mode triggered, line size: {len(line)}")
|
||||
else:
|
||||
yield line
|
||||
yield b"\n"
|
||||
|
||||
# Save the last incomplete fragment
|
||||
buffer = lines[-1]
|
||||
@@ -646,5 +649,6 @@ def stream_chunks_handler(stream: aiohttp.StreamReader):
|
||||
# Process remaining buffer data
|
||||
if buffer and not skip_mode:
|
||||
yield buffer
|
||||
yield b"\n"
|
||||
|
||||
return yield_safe_stream_chunks()
|
||||
|
||||
Reference in New Issue
Block a user