Skip to content

Commit

Permalink
openai: add completion_tokens_details to usage response (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc authored Sep 12, 2024
1 parent c578cf8 commit f95868f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions llms/openai/internal/openaiclient/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ type ChatCompletionChoice struct {

// ChatUsage is the usage of a chat completion request.
type ChatUsage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
CompletionTokensDetails struct {
ReasoningTokens int `json:"reasoning_tokens"`
} `json:"completion_tokens_details"`
}

// ChatCompletionResponse is a response to a chat request.
Expand Down

0 comments on commit f95868f

Please sign in to comment.