Skip to content

Commit

Permalink
🐛fix: Fix conditional judgment error
Browse files Browse the repository at this point in the history
  • Loading branch information
MartialBE committed Oct 4, 2024
1 parent 044288b commit 75ee288
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion relay/relay_util/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (q *Quota) completedQuotaConsumption(usage *types.Usage, tokenName string,
completionTokens := usage.CompletionTokens
hitsCache := false

if usage.PromptTokensDetails != nil ||
if usage.PromptTokensDetails != nil &&
usage.PromptTokensDetails.CachedTokens > 0 {
promptTokens -= int(math.Ceil(float64(usage.PromptTokensDetails.CachedTokens) / 2))
hitsCache = true
Expand Down

0 comments on commit 75ee288

Please sign in to comment.