[Bugfix] fix missing 'finish_reason': null in streaming chat (#19662)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-06-16 22:10:39 +08:00
committed by GitHub
parent c3fec47bb7
commit 836d4ce140

View File

@ -873,7 +873,7 @@ class OpenAIServingChat(OpenAIServing):
total_tokens=num_prompt_tokens + completion_tokens,
)
data = chunk.model_dump_json(exclude_none=True)
data = chunk.model_dump_json(exclude_unset=True)
yield f"data: {data}\n\n"
# once the final token is handled, if stream_options.include_usage