diff --git a/src/lang/en.ts b/src/lang/en.ts
index 34ecfa64..147bdd81 100644
--- a/src/lang/en.ts
+++ b/src/lang/en.ts
@@ -1065,4 +1065,10 @@ export const languageEnglish = {
cachePoint: "Cache Point",
all: "All",
showFolderNameInIcon: "Show Folder Name in Icon",
+ claudeCachingRetrival: "Claude Caching Retrival",
+ claudeCachingRetrivalDesc: "Extends the cache time for Claude Caching, by requesting every 4 minutes. this can reduce the cache miss rate, but it can increase the cost if its not used properly.",
+ automaticCachePoint: "Automatic Cache Point",
+ automaticCachePointDesc: "Automatically creates cache point after the chat ends, if the caching point doesn't exist.",
+ experimentalChatCompression: "Experimental Chat Data Handling",
+ experimentalChatCompressionDesc: "Compresses the unused chat data and saves in seperate file.",
}
diff --git a/src/lib/Setting/Pages/AdvancedSettings.svelte b/src/lib/Setting/Pages/AdvancedSettings.svelte
index cda9460c..42afafd7 100644
--- a/src/lib/Setting/Pages/AdvancedSettings.svelte
+++ b/src/lib/Setting/Pages/AdvancedSettings.svelte
@@ -160,6 +160,16 @@
+
+
+
+
+
+
+
+
+
+
{/if}
{#if DBState.db.showUnrecommended}
diff --git a/src/ts/process/index.svelte.ts b/src/ts/process/index.svelte.ts
index 0f0bbee4..cfc36580 100644
--- a/src/ts/process/index.svelte.ts
+++ b/src/ts/process/index.svelte.ts
@@ -498,6 +498,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
})
}
+ let hasCachePoint = false
if(promptTemplate){
const template = promptTemplate
@@ -637,6 +638,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
break
}
case 'cache':{
+ hasCachePoint = true
break
}
}
@@ -1135,6 +1137,21 @@ export async function sendChat(chatProcessIndex = -1,arg:{
chats = systemizeChat(chats)
}
pushPrompts(chats)
+
+ if(DBState.db.automaticCachePoint && !hasCachePoint){
+ let pointer = formated.length - 1
+ let depthRemaining = 3
+ while(pointer >= 0){
+ if(depthRemaining === 0){
+ break
+ }
+ if(formated[pointer].role === 'user'){
+ formated[pointer].cachePoint = true
+ depthRemaining--
+ }
+ pointer--
+ }
+ }
break
}
case 'memory':{
diff --git a/src/ts/storage/database.svelte.ts b/src/ts/storage/database.svelte.ts
index ae03ee56..f0af181d 100644
--- a/src/ts/storage/database.svelte.ts
+++ b/src/ts/storage/database.svelte.ts
@@ -925,6 +925,8 @@ export interface Database{
},
localActivationInGlobalLorebook: boolean
showFolderName: boolean
+ automaticCachePoint: boolean
+ chatCompression: boolean
}
interface SeparateParameters{