Replace cloneDeep to native structuredclone and remove unused import

This commit is contained in:
kwaroran
2024-04-25 01:17:14 +09:00
parent cc744853d2
commit 11b1d4d4f3
22 changed files with 85 additions and 115 deletions

View File

@@ -3,7 +3,6 @@ import type { OpenAIChat } from "..";
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database";
import { tokenize, type ChatTokenizer } from "../../tokenizer";
import { requestChatData } from "../request";
import { cloneDeep } from "lodash";
import { HypaProcesser } from "./hypamemory";
import { stringlizeChat } from "../stringlize";
import { globalFetch } from "src/ts/storage/globalApi";
@@ -74,7 +73,7 @@ export async function supaMemory(
for(let j=0;j<HypaData.length;j++){
let i =0;
let countTokens = currentTokens
let countChats = cloneDeep(chats)
let countChats = structuredClone(chats)
while(true){
if(countChats.length === 0){
break