Skip to content

Commit 312208b

Browse files
committed
feat: add logprobs field to StreamChoices for enhanced token probability information
1 parent 4e879b4 commit 312208b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chat_stream.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ type StreamDelta struct {
5151
// StreamChoices represents a choice in the chat completion stream.
5252
type StreamChoices struct {
5353
Index int `json:"index"` // Index of the choice.
54-
Delta StreamDelta // Delta information.
55-
FinishReason string `json:"finish_reason"` // Reason for finishing the generation.
54+
Delta StreamDelta // Delta information for the choice.
55+
FinishReason string `json:"finish_reason,omitempty"` // Reason for finishing the generation.
56+
Logprobs Logprobs `json:"logprobs,omitempty"` // Log probabilities for the generated tokens.
5657
}
5758

5859
// StreamChatCompletionResponse represents a single response from a streaming chat completion API call.

0 commit comments

Comments
 (0)