chore: Update npm dependency versions and add export/import functions for chat history and knowledge

This commit is contained in:
n4ze3m
2024-05-08 12:13:16 +05:30
parent 88ad1fcab7
commit 11147fd951
5 changed files with 66 additions and 1 deletions

View File

@@ -190,3 +190,16 @@ export const deleteSource = async (id: string, source_id: string) => {
await db.deleteSource(id, source_id)
await deleteVectorByFileId(`vector:${id}`, source_id)
}
export const exportKnowledge = async () => {
const db = new PageAssistKnowledge()
const data = await db.getAll()
return data
}
export const importKnowledge = async (data: Knowledge[]) => {
const db = new PageAssistKnowledge()
for (const d of data) {
await db.create(d)
}
}