diff options
| author | A.J. Shulman <Shulman.aj@gmail.com> | 2025-04-24 13:21:00 -0400 |
|---|---|---|
| committer | A.J. Shulman <Shulman.aj@gmail.com> | 2025-04-24 13:21:00 -0400 |
| commit | 5ce2263849bfb901e276a4c5fc8ca2dbd8b80350 (patch) | |
| tree | 34d4ac121cb13f141fcdb63325446d9c125813c4 /src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts | |
| parent | 321977e670cbdf10f6c49fc9071e3260a8bd4aae (diff) | |
attempt at linking docs but listing metadata doesn't work
Diffstat (limited to 'src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts b/src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts index c954226e4..4eeac3c6a 100644 --- a/src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts +++ b/src/client/views/nodes/chatbot/utils/AgentDocumentManager.ts @@ -90,7 +90,7 @@ export class AgentDocumentManager { */ public initializeFindDocsFreeform() { // Reset collections - this.documentsById.clear(); + //this.documentsById.clear(); try { // Use the LinkManager approach which is proven to work in ChatBox @@ -109,6 +109,7 @@ export class AgentDocumentManager { linkedDocs.forEach((doc: Doc) => { if (doc) { this.processDocument(doc); + console.log('Processed linked document:', doc.id, doc.title, doc.type); } }); @@ -164,6 +165,11 @@ export class AgentDocumentManager { } } + public addCustomId(doc: Doc, id: string) { + doc.id = id; + doc.DOCUMENT_ID_FIELD = id; + } + /** * Process a document by ensuring it has an ID and adding it to the appropriate collections * @param doc The document to process @@ -730,7 +736,7 @@ export class AgentDocumentManager { // Get metadata for all documents const documentsMetadata: Record<string, any> = {}; for (const doc of this.documentsById.values()) { - documentsMetadata.add(this.extractDocumentMetadata(doc)); + documentsMetadata.add(this.extractDocumentMetadata(doc) ?? { documentId: doc.layoutDoc.id, title: doc.layoutDoc.title, type: doc.layoutDoc.type }); } return { |
