diff --git a/src/leapfrogai_api/backend/types.py b/src/leapfrogai_api/backend/types.py index 742463248..76c2b2fff 100644 --- a/src/leapfrogai_api/backend/types.py +++ b/src/leapfrogai_api/backend/types.py @@ -132,7 +132,9 @@ class CompletionChoice(BaseModel): description="Log probabilities for the generated tokens. Only returned if requested.", ) finish_reason: str | None = Field( - None, description="The reason why the completion finished.", example="length" + default=None, + description="The reason why the model stopped generating tokens.", + examples=["stop", "length"], ) @@ -268,7 +270,7 @@ class ChatStreamChoice(BaseModel): default=ChatDelta(), description="The delta content for this streaming choice." ) finish_reason: str | None = Field( - default="", + default=None, description="The reason why the model stopped generating tokens.", examples=["stop", "length"], ) diff --git a/src/leapfrogai_sdk/__init__.py b/src/leapfrogai_sdk/__init__.py index 946c37b42..aa1631997 100644 --- a/src/leapfrogai_sdk/__init__.py +++ b/src/leapfrogai_sdk/__init__.py @@ -11,6 +11,7 @@ from leapfrogai_sdk.audio.audio_pb2_grpc import Audio, AudioServicer, AudioStub from leapfrogai_sdk.chat.chat_pb2 import ( ChatCompletionChoice, + ChatCompletionFinishReason, ChatCompletionRequest, ChatCompletionResponse, ChatItem,