quick fix

This commit is contained in:
Kai Wu 2025-08-05 14:25:16 -07:00
parent f02fda0bd7
commit edd57785a1
3 changed files with 55 additions and 10 deletions

View file

@ -111,7 +111,8 @@ async def stream_and_store_openai_completion(
final_logprobs = OpenAIChoiceLogprobs(content=logprobs_content) if logprobs_content else None
# Ensure finish_reason is a string as required by OpenAIChoice
finish_reason = choice_data["finish_reason"] or "unknown"
# Using explicit None check to guarantee a string value
finish_reason = choice_data["finish_reason"] if choice_data["finish_reason"] is not None else "unknown"
assembled_choices.append(
OpenAIChoice(
finish_reason=finish_reason,