Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
import chat completion reason
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthelaw committed Sep 16, 2024
1 parent e679a8c commit 62e1a33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/leapfrogai_api/backend/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)


Expand Down Expand Up @@ -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"],
)
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 62e1a33

Please sign in to comment.