From d0e09ff3526e4f6b9aad824fad1020d083a87631 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Wed, 10 Jul 2024 15:13:46 -0400 Subject: document upload works --- src/client/views/nodes/ChatBox/ChatBox.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/client/views/nodes/ChatBox/ChatBox.tsx') diff --git a/src/client/views/nodes/ChatBox/ChatBox.tsx b/src/client/views/nodes/ChatBox/ChatBox.tsx index 9f4e6f07e..2283aad56 100644 --- a/src/client/views/nodes/ChatBox/ChatBox.tsx +++ b/src/client/views/nodes/ChatBox/ChatBox.tsx @@ -53,7 +53,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { this.openai = this.initializeOpenAI(); this.history = [{ role: ASSISTANT_ROLE.ASSISTANT, text: 'Welcome to the Document Analyser Assistant! Link a document or ask questions to get started.' }]; this.openai = this.initializeOpenAI(); - this.getLinkedDocs(); + this.getOtherDocs(); this.vectorstore = new Vectorstore(); reaction( @@ -64,13 +64,12 @@ export class ChatBox extends ViewBoxAnnotatableComponent() { ); } - getLinkedDocs = async () => { - const visual_docs = (CollectionFreeFormDocumentView.from(this._props.DocumentView?.())?._props.parent as CollectionFreeFormView)?.childDocs.filter(doc => doc != this.Document); - console.log('All Docs:', visual_docs); + getOtherDocs = async () => { + const visible_docs = (CollectionFreeFormDocumentView.from(this._props.DocumentView?.())?._props.parent as CollectionFreeFormView)?.childDocs.filter(doc => doc != this.Document); + console.log('All Docs:', visible_docs); - visual_docs?.forEach(async doc => { + visible_docs?.forEach(async doc => { const local_file_path: string = CsvCast(doc.data, PDFCast(doc.data)).url?.pathname; - if (local_file_path) { const { document_json } = await Networking.PostToServer('/createDocument', { file_path: local_file_path }); const ai_document: AI_Document = convertToAIDocument(document_json); -- cgit v1.2.3-70-g09d2