feat: handle large stream chunks responses

This commit is contained in:
Shirasawa
2025-11-03 09:45:28 +00:00
parent 49d57ae82b
commit 89c0e150c8
3 changed files with 76 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ from open_webui.utils.payload import (
)
from open_webui.utils.misc import (
convert_logit_bias_input_to_json,
handle_large_stream_chunks,
)
from open_webui.utils.auth import get_admin_user, get_verified_user
@@ -952,7 +953,7 @@ async def generate_chat_completion(
if "text/event-stream" in r.headers.get("Content-Type", ""):
streaming = True
return StreamingResponse(
r.content,
handle_large_stream_chunks(r.content),
status_code=r.status,
headers=dict(r.headers),
background=BackgroundTask(