Unverified Commit 16620f43 authored by kczimm's avatar kczimm Committed by GitHub
Browse files

do not exclude `object` field in CompletionStreamResponse (#6196)

parent 3b08fe2b
...@@ -301,7 +301,7 @@ class OpenAIServingCompletion(OpenAIServing): ...@@ -301,7 +301,7 @@ class OpenAIServingCompletion(OpenAIServing):
else: else:
chunk.usage = None 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" yield f"data: {response_json}\n\n"
if (request.stream_options if (request.stream_options
...@@ -314,7 +314,7 @@ class OpenAIServingCompletion(OpenAIServing): ...@@ -314,7 +314,7 @@ class OpenAIServingCompletion(OpenAIServing):
usage=usage, usage=usage,
) )
final_usage_data = (final_usage_chunk.model_dump_json( 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" yield f"data: {final_usage_data}\n\n"
except ValueError as e: except ValueError as e:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment