fix: exclude null fields from streaming chunks for Open WebUI compatibility
OpenAI's API omits null fields in streaming chunks, but Tatlock was including them (content: null, reasoning_content: null). This caused parsing issues in Open WebUI's streaming handler. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ async def _stream_response(
|
||||
"""
|
||||
try:
|
||||
async for chunk in service.create_chat_completion_stream(request):
|
||||
yield f"data: {chunk.model_dump_json()}\n\n"
|
||||
yield f"data: {chunk.model_dump_json(exclude_none=True)}\n\n"
|
||||
|
||||
yield "data: [DONE]\n\n"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user