mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-11 20:05:19 +00:00
fix: fixed missing text in the explanation feature (#19829)
This commit is contained in:
parent
44e41806f2
commit
c24b1207a0
1 changed files with 4 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue