mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-27 09:54:47 +08:00
refactor: remove unused detectClaudeMaxCacheBillingOutcomeForUsage function
This commit is contained in:
@@ -13,23 +13,6 @@ type claudeMaxCacheBillingOutcome struct {
|
|||||||
Simulated bool
|
Simulated bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// detectClaudeMaxCacheBillingOutcomeForUsage only returns whether Claude Max policy
|
|
||||||
// should influence downstream override decisions. It does not mutate usage.
|
|
||||||
func detectClaudeMaxCacheBillingOutcomeForUsage(usage ClaudeUsage, parsed *ParsedRequest, group *Group, model string) claudeMaxCacheBillingOutcome {
|
|
||||||
var out claudeMaxCacheBillingOutcome
|
|
||||||
if !shouldApplyClaudeMaxBillingRulesForUsage(group, model, parsed) {
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
if hasCacheCreationTokens(usage) {
|
|
||||||
// Upstream already returned cache creation usage; keep original usage.
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
if shouldSimulateClaudeMaxUsageForUsage(usage, parsed) {
|
|
||||||
out.Simulated = true
|
|
||||||
}
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
func applyClaudeMaxCacheBillingPolicyToUsage(usage *ClaudeUsage, parsed *ParsedRequest, group *Group, model string, accountID int64) claudeMaxCacheBillingOutcome {
|
func applyClaudeMaxCacheBillingPolicyToUsage(usage *ClaudeUsage, parsed *ParsedRequest, group *Group, model string, accountID int64) claudeMaxCacheBillingOutcome {
|
||||||
var out claudeMaxCacheBillingOutcome
|
var out claudeMaxCacheBillingOutcome
|
||||||
if usage == nil || !shouldApplyClaudeMaxBillingRulesForUsage(group, model, parsed) {
|
if usage == nil || !shouldApplyClaudeMaxBillingRulesForUsage(group, model, parsed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user