From 5ba557fb9456e6eb911975d17ff5db14204a99d3 Mon Sep 17 00:00:00 2001 From: Vikash Vardhan Date: Sun, 16 Aug 2026 01:17:38 +0000 Subject: [PATCH] Fix #315: Support `openai api --json completions.create ...` --- src/openai/types/completion_choice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openai/types/completion_choice.py b/src/openai/types/completion_choice.py index bbe873bfef..4f3526cdfd 100644 --- a/src/openai/types/completion_choice.py +++ b/src/openai/types/completion_choice.py @@ -19,7 +19,7 @@ class Logprobs(BaseModel): class CompletionChoice(BaseModel): - finish_reason: Literal["stop", "length", "content_filter"] + finish_reason: Optional[Literal["stop", "length", "content_filter"]] = None """The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop