feat: Add export/import functions for chat history, promt and knowledge
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user