feat: show normalized prompt cache hit rates
Token usage previously showed cache reads and writes without a comparable hit rate. Activity usage now calculates a weighted cache hit rate using OpenAI-compatible input totals and Anthropic's separately reported input, cache-read, and cache-write tokens, then shows it in totals and grouped details. Release note: Token 用量统计新增缓存命中率,并针对 OpenAI 兼容接口与 Anthropic Messages 的不同上报口径进行归一化计算。
This commit is contained in:
@@ -379,6 +379,7 @@ export type TokenUsageRecord = {
|
||||
output: number
|
||||
cacheRead: number
|
||||
cacheWrite: number
|
||||
cacheInput?: number
|
||||
totalTokens: number
|
||||
}
|
||||
|
||||
@@ -389,6 +390,7 @@ export type TokenUsageSummary = {
|
||||
output: number
|
||||
cacheRead: number
|
||||
cacheWrite: number
|
||||
cacheInput?: number
|
||||
totalTokens: number
|
||||
}
|
||||
records: TokenUsageRecord[]
|
||||
|
||||
Reference in New Issue
Block a user