Change DataBase inside svelte to DBState for performance
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase } from "../storage/database.svelte";
|
||||
import { selectedCharID } from "../stores";
|
||||
import { alertInput, alertMd, alertNormal, alertSelect, alertToast } from "../alert";
|
||||
import { sayTTS } from "./tts";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, type Chat, type character } from "src/ts/storage/database";
|
||||
import { DataBase, type Chat, type character } from "src/ts/storage/database.svelte";
|
||||
import { HypaProcesser } from '../memory/hypamemory'
|
||||
import type { OpenAIChat } from "..";
|
||||
import { stringlizeChat } from "../stringlize";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { OpenAIChat } from ".";
|
||||
import type { character } from "../storage/database";
|
||||
import type { character } from "../storage/database.svelte";
|
||||
import { risuChatParser } from "./scripts";
|
||||
|
||||
export function exampleMessage(char:character, userName:string):OpenAIChat[]{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import localforage from "localforage";
|
||||
import { selectSingleFile } from "../../util";
|
||||
import { v4 } from "uuid";
|
||||
import { DataBase } from "../../storage/database";
|
||||
import { DataBase } from "../../storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { checkImageType } from "../../parser";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setDatabase } from 'src/ts/storage/database';
|
||||
import { DataBase, setDatabase } from 'src/ts/storage/database.svelte';
|
||||
import { selectedCharID } from 'src/ts/stores';
|
||||
import { get } from 'svelte/store';
|
||||
import { doingChat, sendChat } from '..';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { findCharacterbyId } from "../util";
|
||||
import { alertConfirm, alertError, alertSelectChar } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase, setDatabase } from "../storage/database";
|
||||
import { DataBase, setDatabase } from "../storage/database.svelte";
|
||||
import { selectedCharID } from "../stores";
|
||||
|
||||
export async function addGroupChar(){
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { DataBase, setDatabase, type character, type MessageGenerationInfo, type Chat } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character, type MessageGenerationInfo, type Chat } from "../storage/database.svelte";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import { ChatTokenizer, tokenize, tokenizeNum } from "../tokenizer";
|
||||
import { language } from "../../lang";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { writeInlayImage } from "./files/image";
|
||||
import type { character } from "../storage/database";
|
||||
import type { character } from "../storage/database.svelte";
|
||||
import { generateAIImage } from "./stableDiff";
|
||||
|
||||
const imggenRegex = [/<ImgGen="(.+?)">/gi, /{{ImgGen="(.+?)"}}/gi] as const
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import {selectedCharID} from '../stores'
|
||||
import { DataBase, setDatabase, type Message, type loreBook } from "../storage/database";
|
||||
import { DataBase, setDatabase, type Message, type loreBook } from "../storage/database.svelte";
|
||||
import { tokenize } from "../tokenizer";
|
||||
import { checkNullish, selectSingleFile } from "../util";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getChatVar, hasher, risuChatParser, setChatVar, type simpleCharacterArgument } from "../parser";
|
||||
import { LuaEngine, LuaFactory } from "wasmoon";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase, type Chat, type character, type groupChat } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase, type Chat, type character, type groupChat } from "../storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { ReloadGUIPointer, selectedCharID } from "../stores";
|
||||
import { alertError, alertInput, alertNormal } from "../alert";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { HypaProcesser } from "./hypamemory";
|
||||
import { language } from "src/lang";
|
||||
import type { ChatTokenizer } from "src/ts/tokenizer";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
|
||||
const maxRecentChatQuery = 4;
|
||||
export async function hanuraiMemory(chats:OpenAIChat[],arg:{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, type Chat, type character, type groupChat } from "src/ts/storage/database";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "src/ts/storage/database.svelte";
|
||||
import type { OpenAIChat } from "..";
|
||||
import type { ChatTokenizer } from "src/ts/tokenizer";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { OpenAIChat } from "..";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database.svelte";
|
||||
import { tokenize, type ChatTokenizer } from "../../tokenizer";
|
||||
import { requestChatData } from "../request";
|
||||
import { HypaProcesser } from "./hypamemory";
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as path from "@tauri-apps/api/path";
|
||||
import { exists, readTextFile } from "@tauri-apps/plugin-fs";
|
||||
import { alertClear, alertError, alertMd, alertWait } from "src/ts/alert";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
let serverRunning = false;
|
||||
|
||||
export function checkLocalModel():Promise<string>{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
export function getGenerationModelString(){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setDatabase } from "src/ts/storage/database"
|
||||
import { DataBase, setDatabase } from "src/ts/storage/database.svelte"
|
||||
import type { OpenAIChat } from ".."
|
||||
import { get } from "svelte/store"
|
||||
import { globalFetch } from "src/ts/storage/globalApi"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { language } from "src/lang"
|
||||
import { alertConfirm, alertError, alertModuleSelect, alertNormal, alertStore } from "../alert"
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentCharacter, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database"
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentCharacter, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database.svelte"
|
||||
import { AppendableBuffer, downloadFile, isNodeServer, isTauri, readImage, saveAsset } from "../storage/globalApi"
|
||||
import { get } from "svelte/store"
|
||||
import { selectSingleFile, sleep } from "../util"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { tokenizeAccurate } from "../tokenizer";
|
||||
import { DataBase, presetTemplate, setDatabase, type Database } from "../storage/database";
|
||||
import { DataBase, presetTemplate, setDatabase, type Database } from "../storage/database.svelte";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
import type { OobaChatCompletionRequestParams } from "../model/ooba";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { MultiModal, OpenAIChat, OpenAIChatFull } from ".";
|
||||
import { DataBase, type character } from "../storage/database";
|
||||
import { DataBase, type character } from "../storage/database.svelte";
|
||||
import { pluginProcess } from "../plugins/plugins";
|
||||
import { language } from "../../lang";
|
||||
import { stringlizeAINChat, stringlizeChat, getStopStrings, unstringlizeAIN, unstringlizeChat } from "./stringlize";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import { DataBase, setDatabase, type character, type customscript, type groupChat, type Database } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character, type customscript, type groupChat, type Database } from "../storage/database.svelte";
|
||||
import { downloadFile } from "../storage/globalApi";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store"
|
||||
import { DataBase, type character } from "../storage/database"
|
||||
import { DataBase, type character } from "../storage/database.svelte"
|
||||
import { requestChatData } from "./request"
|
||||
import { alertError } from "../alert"
|
||||
import { globalFetch, readImage } from "../storage/globalApi"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { OpenAIChat } from ".";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
import { getUserName } from "../util";
|
||||
|
||||
export function multiChatReplacer(){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Template } from '@huggingface/jinja';
|
||||
import type { OpenAIChat } from '..';
|
||||
import { get } from 'svelte/store';
|
||||
import { DataBase, getCurrentCharacter } from 'src/ts/storage/database';
|
||||
import { DataBase, getCurrentCharacter } from 'src/ts/storage/database.svelte';
|
||||
import { getUserName } from 'src/ts/util';
|
||||
|
||||
export const chatTemplates = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database";
|
||||
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database.svelte";
|
||||
import { defaultAutoSuggestPrefixOoba, defaultAutoSuggestPrompt, defaultAutoSuggestPromptOoba } from "src/ts/storage/defaultPrompts";
|
||||
import { get } from "svelte/store";
|
||||
import { prebuiltNAIpresets, prebuiltPresets } from "./templates";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { risuChatParser } from "src/ts/parser"
|
||||
import { DataBase } from "src/ts/storage/database"
|
||||
import { DataBase } from "src/ts/storage/database.svelte"
|
||||
import { get } from "svelte/store"
|
||||
|
||||
export function convertInterfaceToSchema(int:string){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Database } from 'src/ts/storage/database'
|
||||
import type { Database } from 'src/ts/storage/database.svelte'
|
||||
|
||||
export function templateCheck(db:Database){
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { botPreset } from "../../storage/database";
|
||||
import type { botPreset } from "../../storage/database.svelte";
|
||||
import type { NAISettings } from "../models/nai";
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseChatML, risuChatParser } from "../parser";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, type Chat, type character } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, type Chat, type character } from "../storage/database.svelte";
|
||||
import { tokenize } from "../tokenizer";
|
||||
import { getModuleTriggers } from "./modules";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { alertError } from "../alert";
|
||||
import { DataBase, getCurrentCharacter, type character } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, type character } from "../storage/database.svelte";
|
||||
import { runTranslator, translateVox } from "../translator/translator";
|
||||
import { globalFetch, loadAsset } from "../storage/globalApi";
|
||||
import { language } from "src/lang";
|
||||
|
||||
Reference in New Issue
Block a user