feat: modelfile builder tagName field added

This commit is contained in:
Timothy J. Baek committed 2023-12-03 10:59:47 -08:00
1 parent 382827c71d
commit 12d7ae96b9
4 files changed
+141 -31

No files matched your search

+21 -3
View File
@@ -4,7 +4,17 @@
import { onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import { config, user, showSettings, settings, models, db, chats, chatId } from '$lib/stores';
import {
config,
user,
showSettings,
settings,
models,
db,
chats,
chatId,
modelfiles
} from '$lib/stores';
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
import Sidebar from '$lib/components/layout/Sidebar.svelte';
@@ -78,7 +88,7 @@
};
const getDB = async () => {
const _db = await openDB('Chats', 1, {
const DB = await openDB('Chats', 1, {
upgrade(db) {
const store = db.createObjectStore('chats', {
keyPath: 'id',
@@ -89,7 +99,7 @@
});
return {
db: _db,
db: DB,
getChatById: async function (id) {
return await this.db.get('chats', id);
},
@@ -162,6 +172,14 @@
let _db = await getDB();
await db.set(_db);
await modelfiles.set(
JSON.parse(localStorage.getItem('modelfiles') ?? JSON.stringify($modelfiles))
);
modelfiles.subscribe(async () => {
await models.set(await getModels());
});
await tick();
loaded = true;
});