Add supamemory max chunk size and remove deprecated

This commit is contained in:
kwaroran
2024-04-08 23:42:30 +09:00
parent 74385237ab
commit 8d094d5b66
6 changed files with 16 additions and 10 deletions

View File

@@ -266,7 +266,10 @@ export async function supaMemory(
while(currentTokens > maxContextTokens){
const beforeToken = currentTokens
let maxChunkSize = maxContextTokens > 3500 ? 1200 : Math.floor(maxContextTokens / 3)
let maxChunkSize = Math.floor(maxContextTokens / 3)
if(db.maxSupaChunkSize > maxChunkSize){
maxChunkSize = db.maxSupaChunkSize
}
let summarized = false
let chunkSize = 0
let stringlizedChat = ''