Add Prediction field (#970)
* Add Prediction field to ChatCompletionRequest * Include prediction tokens in response
This commit is contained in:
7
chat.go
7
chat.go
@@ -273,6 +273,8 @@ type ChatCompletionRequest struct {
|
||||
ReasoningEffort string `json:"reasoning_effort,omitempty"`
|
||||
// Metadata to store with the completion.
|
||||
Metadata map[string]string `json:"metadata,omitempty"`
|
||||
// Configuration for a predicted output.
|
||||
Prediction *Prediction `json:"prediction,omitempty"`
|
||||
}
|
||||
|
||||
type StreamOptions struct {
|
||||
@@ -340,6 +342,11 @@ type LogProbs struct {
|
||||
Content []LogProb `json:"content"`
|
||||
}
|
||||
|
||||
type Prediction struct {
|
||||
Content string `json:"content"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type FinishReason string
|
||||
|
||||
const (
|
||||
|
||||
@@ -13,8 +13,10 @@ type Usage struct {
|
||||
|
||||
// CompletionTokensDetails Breakdown of tokens used in a completion.
|
||||
type CompletionTokensDetails struct {
|
||||
AudioTokens int `json:"audio_tokens"`
|
||||
ReasoningTokens int `json:"reasoning_tokens"`
|
||||
AudioTokens int `json:"audio_tokens"`
|
||||
ReasoningTokens int `json:"reasoning_tokens"`
|
||||
AcceptedPredictionTokens int `json:"accepted_prediction_tokens"`
|
||||
RejectedPredictionTokens int `json:"rejected_prediction_tokens"`
|
||||
}
|
||||
|
||||
// PromptTokensDetails Breakdown of tokens used in the prompt.
|
||||
|
||||
Reference in New Issue
Block a user