Migrate all DataBase to DBState

This commit is contained in:
kwaroran
2024-10-24 01:59:57 +09:00
parent 4e9190f1b5
commit b3fddb814e
65 changed files with 331 additions and 434 deletions

View File

@@ -1,6 +1,5 @@
import { get } from "svelte/store";
import type { OpenAIChat } from "..";
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database.svelte";
import { getDatabase, type Chat, type character, type groupChat } from "../../storage/database.svelte";
import { tokenize, type ChatTokenizer } from "../../tokenizer";
import { requestChatData } from "../request";
import { HypaProcesser } from "./hypamemory";
@@ -18,7 +17,7 @@ export async function supaMemory(
tokenizer:ChatTokenizer,
arg:{asHyper?:boolean} = {}
): Promise<{ currentTokens: number; chats: OpenAIChat[]; error?:string; memory?:string;lastId?:string}>{
const db = get(DataBase)
const db = getDatabase()
currentTokens += 10