forked from open-webui/open-webui
feat: full integration
This commit is contained in:
parent
28c1192ac0
commit
9634e2da3e
6 changed files with 116 additions and 25 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue