do not exclude object field in CompletionStreamResponse (#6196)

This commit is contained in:
kczimm 2024-07-07 21:32:57 -05:00 committed by GitHub
parent 3b08fe2b13
commit 16620f439d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -301,7 +301,7 @@ class OpenAIServingCompletion(OpenAIServing):
else:
chunk.usage = None
response_json = chunk.model_dump_json(exclude_unset=True)
response_json = chunk.model_dump_json(exclude_unset=False)
yield f"data: {response_json}\n\n"
if (request.stream_options
@ -314,7 +314,7 @@ class OpenAIServingCompletion(OpenAIServing):
usage=usage,
)
final_usage_data = (final_usage_chunk.model_dump_json(
exclude_unset=True, exclude_none=True))
exclude_unset=False, exclude_none=True))
yield f"data: {final_usage_data}\n\n"
except ValueError as e: