feat: sync deployed v1.0.0-rc.38-custom.42
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
1 parent
aa6c3f50f4
commit
ceddfd3d6b
828 files changed
+122253
-13702
No files matched your search
@@ -50,7 +50,7 @@ func MergeUsageNonZero(current *Usage, incoming *Usage) *Usage {
|
||||
details.CacheWriteTokens > 0 ||
|
||||
details.TextTokens > 0 ||
|
||||
details.AudioTokens > 0 ||
|
||||
details.ImageTokens > 0 {
|
||||
details.ImageTokens > 0 || details.CachedTokensDetails != nil {
|
||||
if current.InputTokensDetails == nil {
|
||||
current.InputTokensDetails = &InputTokenDetails{}
|
||||
}
|
||||
@@ -286,6 +286,25 @@ func mergeGeminiTokenDetails(current []GeminiPromptTokensDetails, incoming []Gem
|
||||
}
|
||||
|
||||
func mergeInputTokenDetails(current *InputTokenDetails, incoming InputTokenDetails) {
|
||||
if incoming.CachedTokensDetails != nil {
|
||||
// Unlike legacy scalar counters, these optional fields explicitly report
|
||||
// zero. Merge only present modalities and detach the resulting snapshot.
|
||||
merged := current.Clone()
|
||||
if merged.CachedTokensDetails == nil {
|
||||
merged.CachedTokensDetails = &CachedTokenDetails{}
|
||||
}
|
||||
details := incoming.Clone().CachedTokensDetails
|
||||
if details.TextTokens != nil {
|
||||
merged.CachedTokensDetails.TextTokens = details.TextTokens
|
||||
}
|
||||
if details.ImageTokens != nil {
|
||||
merged.CachedTokensDetails.ImageTokens = details.ImageTokens
|
||||
}
|
||||
if details.AudioTokens != nil {
|
||||
merged.CachedTokensDetails.AudioTokens = details.AudioTokens
|
||||
}
|
||||
current.CachedTokensDetails = merged.CachedTokensDetails
|
||||
}
|
||||
if incoming.CachedTokens > 0 {
|
||||
current.CachedTokens = incoming.CachedTokens
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user