aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx')
-rw-r--r--src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
index d919b5f7f..34a1ade2e 100644
--- a/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
+++ b/src/client/views/nodes/chatbot/chatboxcomponents/ChatBox.tsx
@@ -650,16 +650,8 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
citation: JSON.stringify(citation, null, 2),
});
- // Try to find the document
- let doc: Doc | undefined;
-
// First try to find the document using the document manager's chunk ID lookup
- const parentDocId = this.docManager.getDocIdByChunkId(chunkId);
- if (parentDocId) {
- doc = this.docManager.getDocument(parentDocId);
- console.log(`Found document by chunk ID lookup: ${parentDocId}`);
- }
-
+ const doc: Doc | undefined = this.docManager.getDocByChunkId(chunkId);
if (!doc) {
console.warn(`Document not found for citation with chunk_id: ${chunkId}`);
return;
@@ -989,32 +981,13 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
componentWillUnmount() {
this.removeScrollListener();
}
-
- /**
- * Getter that retrieves all linked documents for the current document.
- */
- @computed get linkedDocs(): Doc[] {
- const docIds = this.docManager.listDocs();
- const docs: Doc[] = [];
-
- // Get documents from the document manager using the getDocument method
- docIds.forEach(id => {
- const doc = this.docManager.getDocument(id);
- if (doc) {
- docs.push(doc);
- }
- });
-
- return docs;
- }
-
/**
* Getter that retrieves document IDs of linked documents that have PDF_chunker–parsed content.
*/
@computed
get docIds(): string[] {
// Use the document manager to get all document IDs
- return Array.from(this.docManager.listDocs());
+ return Array.from(this.docManager.listDocs);
}
/**
@@ -1023,7 +996,8 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
@computed
get summaries(): string {
// Use the document manager to get all summaries
- return this.docManager.getAllDocumentSummaries();
+ console.log(this.docManager.listDocs);
+ return JSON.stringify(this.docManager.listDocs);
}
/**
@@ -1064,7 +1038,7 @@ export class ChatBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
};
retrieveDocIds = (): string[] => {
- return Array.from(this.docManager.listDocs());
+ return Array.from(this.docManager.docIds);
};
/**