mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix(usage): 修复 Gemini total 重复累加 cache_read 并补充测试
- write.rs: Gemini usage 提取 total 时不再叠加 cachedContentTokenCount - 补充 Claude 大 cache_read 场景下 input_tokens 不被扣减的测试 - 补充前端 getEffectiveInputTokens 对 Claude 格式不减 cache_read 的测试
This commit is contained in:
@@ -26,4 +26,14 @@ describe('usage token normalization', () => {
|
||||
api_format: 'openai:chat',
|
||||
})).toBe(80)
|
||||
})
|
||||
|
||||
it('does not subtract cache read tokens for Claude usage', () => {
|
||||
expect(getEffectiveInputTokens({
|
||||
input_tokens: 4941,
|
||||
cache_creation_input_tokens: 687,
|
||||
cache_read_input_tokens: 52873,
|
||||
output_tokens: 973,
|
||||
api_format: 'claude:chat',
|
||||
})).toBe(4941)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user