Claude: set cache TTL to 1h

This commit is contained in:
Cohee
2025-05-23 20:11:10 +03:00
parent 449522c3aa
commit 22afd570fc
2 changed files with 5 additions and 4 deletions

View File

@@ -869,7 +869,7 @@ export function cachingAtDepthForClaude(messages, cachingAtDepth) {
if (messages[i].role !== previousRoleName) {
if (depth === cachingAtDepth || depth === cachingAtDepth + 2) {
const content = messages[i].content;
content[content.length - 1].cache_control = { type: 'ephemeral' };
content[content.length - 1].cache_control = { type: 'ephemeral', ttl: '1h' };
}
if (depth === cachingAtDepth + 2) {