feat: Add export/import functions for chat history, promt and knowledge

This commit is contained in:
n4ze3m
2024-05-08 13:42:59 +05:30
parent 11147fd951
commit 677aa6ef51
11 changed files with 159 additions and 22 deletions

View File

@@ -444,3 +444,15 @@ export const importChatHistory = async (
}
}
}
export const exportPrompts = async () => {
const db = new PageAssitDatabase()
return await db.getAllPrompts()
}
export const importPrompts = async (prompts: Prompts) => {
const db = new PageAssitDatabase()
for (const prompt of prompts) {
await db.addPrompt(prompt)
}
}