Skip to content

Commit

Permalink
feat: usage struct add CompletionTokensDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuangls committed Sep 26, 2024
1 parent e095df5 commit e57b5ea
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ package openai

// Usage Represents the total token usage per request to OpenAI.
type Usage 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 *CompletionTokensDetails `json:"completion_tokens_details"`
}

// CompletionTokensDetails Breakdown of tokens used in a completion.
type CompletionTokensDetails struct {
ReasoningTokens int `json:"reasoning_tokens"`
}

0 comments on commit e57b5ea

Please sign in to comment.