diff options
author | A.J. Shulman <Shulman.aj@gmail.com> | 2025-05-21 12:38:55 -0400 |
---|---|---|
committer | A.J. Shulman <Shulman.aj@gmail.com> | 2025-05-21 12:38:55 -0400 |
commit | 0e98320d3b237f1927b9f1367494dccd7f66eda9 (patch) | |
tree | 112fc95b0dfd2da8a93a37bbb2e1139067c993bd /src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx | |
parent | 9437753fdebfc7c4b172eeda53610c08abe7287a (diff) |
Added codebase search and retrieval to Vectorstore
Summary indexing: Added functionality to embed and index file summaries from file_summaries.json in Pinecone
Vector search: Implemented semantic search to find the top 5 most relevant files for a query
Content retrieval: Added method to fetch full file content from file_content.json
API endpoints:
/getFileSummaries - Retrieves all file summaries
/getFileContent - Fetches file content by path
/getRawFileContent - Returns content as plain text to avoid JSON parsing errors
Error handling: Added comprehensive error handling and debugging throughout
Initialization: Implemented proper async initialization sequence with verification
Performance: Added streaming for large files to improve memory efficiency
Testing: Added automated test queries to validate functionality
Diffstat (limited to 'src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx')
-rw-r--r-- | src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx index 91a7adf24..470f94a8d 100644 --- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx +++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx @@ -164,7 +164,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { }); // Process the document first to ensure it has a valid ID - this.docManager.processDocument(newLinkedDoc); + await this.docManager.processDocument(newLinkedDoc); // Add the document to the vectorstore which will also register chunks await this.vectorstore.addAIDoc(newLinkedDoc, this.updateProgress); @@ -648,7 +648,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const { foundChunk, doc, dataDoc } = this.docManager.getSimplifiedChunkById(chunkId); console.log('doc: ', doc); console.log('dataDoc: ', dataDoc); - if (!foundChunk) { + if (!foundChunk || !doc) { if (doc) { console.warn(`Chunk not found in document, ${doc.id}, for chunk ID: ${chunkId}`); DocumentManager.Instance.showDocument(doc, { willZoomCentered: true }, () => {}); @@ -1102,8 +1102,8 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { // If there are stored doc IDs in our list of docs to add, process them if (this._linked_docs_to_add.size > 0) { - this._linked_docs_to_add.forEach(doc => { - this.docManager.processDocument(doc); + this._linked_docs_to_add.forEach(async doc => { + await this.docManager.processDocument(doc); }); } } |