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