feat: full integration

This commit is contained in:
Timothy J. Baek 2024-01-07 01:40:36 -08:00
parent 28c1192ac0
commit 9634e2da3e
6 changed files with 116 additions and 25 deletions

View file

@ -186,8 +186,11 @@
const _chatId = JSON.parse(JSON.stringify($chatId));
// TODO: update below to include all ancestral files
const docs = history.messages[parentId].files.filter((item) => item.type === 'file');
console.log(history.messages[parentId]);
const docs = history.messages[parentId]?.files?.filter((item) => item.type === 'doc') ?? [];
console.log(docs);
if (docs.length > 0) {
const query = history.messages[parentId].content;
@ -207,6 +210,8 @@
return `${a}${context.documents.join(' ')}\n`;
}, '');
console.log(contextString);
history.messages[parentId].raContent = RAGTemplate(contextString, query);
history.messages[parentId].contexts = relevantContexts;
await tick();