Add claude 1 hour caching

This commit is contained in:
Kwaroran
2025-06-02 21:48:54 +09:00
parent 7b46c90035
commit 9a44084e96

View File

@@ -3077,10 +3077,18 @@ async function requestClaude(arg:RequestDataArgumentExtended):Promise<requestDat
} }
if(chat.cache){ if(chat.cache){
if(db.claude1HourCaching){
formatedChat.content[0].cache_control = {
type: 'ephemeral',
ttl: "1h"
}
}
else{
formatedChat.content[0].cache_control = { formatedChat.content[0].cache_control = {
type: 'ephemeral' type: 'ephemeral'
} }
} }
}
claudeChat.push(formatedChat) claudeChat.push(formatedChat)
} }
} }