Migrate to svelte 5

This commit is contained in:
kwaroran
2024-10-23 02:31:37 +09:00
parent e434c7ab96
commit c7330719ad
120 changed files with 2398 additions and 2033 deletions

View File

@@ -1,8 +1,7 @@
import { Template } from '@huggingface/jinja';
import type { OpenAIChat } from '..';
import { get } from 'svelte/store';
import { DataBase } from 'src/ts/storage/database';
import { CurrentCharacter } from 'src/ts/stores';
import { DataBase, getCurrentCharacter } from 'src/ts/storage/database';
import { getUserName } from 'src/ts/util';
export const chatTemplates = {
@@ -31,7 +30,7 @@ export const applyChatTemplate = (messages:OpenAIChat[], arg:{
custom?: string
} = {}) => {
const db = get(DataBase)
const currentChar = get(CurrentCharacter)
const currentChar = getCurrentCharacter()
const type = arg.type ?? db.instructChatTemplate
if(!type){
throw new Error('Template type is not set')