kind of working

This commit is contained in:
Kai Wu 2025-07-31 15:19:46 -07:00
parent b63982ef00
commit 3c24be8273
6 changed files with 42 additions and 19 deletions

View file

@ -110,9 +110,11 @@ async def stream_and_store_openai_completion(
logprobs_content = choice_data["logprobs_content_parts"]
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"
assembled_choices.append(
OpenAIChoice(
finish_reason=choice_data["finish_reason"],
finish_reason=finish_reason,
index=choice_idx,
message=message,
logprobs=final_logprobs,