better amazon bedrock caching with anthropic models

This commit is contained in:
Dax Raad
2025-06-29 19:26:50 -04:00
parent 98ee5a3d87
commit ca48a4f0fb
3 changed files with 18 additions and 0 deletions

View File

@@ -882,8 +882,12 @@ export namespace Session {
reasoning: 0,
cache: {
write: (metadata?.["anthropic"]?.["cacheCreationInputTokens"] ??
// @ts-expect-error
metadata?.["bedrock"]?.["usage"]?.["cacheWriteInputTokens"] ??
0) as number,
read: (metadata?.["anthropic"]?.["cacheReadInputTokens"] ??
// @ts-expect-error
metadata?.["bedrock"]?.["usage"]?.["cacheReadInputTokens"] ??
0) as number,
},
}