diff options
| author | A.J. Shulman <Shulman.aj@gmail.com> | 2025-04-27 13:14:49 -0400 |
|---|---|---|
| committer | A.J. Shulman <Shulman.aj@gmail.com> | 2025-04-27 13:14:49 -0400 |
| commit | 3ef3d40506348d9fd537cc8f4aea975b9770689f (patch) | |
| tree | afe779e8240e88c8b20ff6b68ac45840a927ee76 /src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts | |
| parent | 5ce2263849bfb901e276a4c5fc8ca2dbd8b80350 (diff) | |
new attempt with new citation unification
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts b/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts index 4b751acc0..e6c2421e5 100644 --- a/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts +++ b/src/client/views/nodes/chatbot/tools/DocumentMetadataTool.ts @@ -417,9 +417,9 @@ export class DocumentMetadataTool extends BaseTool<DocumentMetadataToolParamsTyp const title = String(args.title); const data = String(args.data); - const createdDoc = this._docManager.createDocInDash(docType, title, data); + const id = this._docManager.createDocInDash(docType, data, { title: title }); - if (!createdDoc) { + if (!id) { return [ { type: 'text', @@ -427,18 +427,14 @@ export class DocumentMetadataTool extends BaseTool<DocumentMetadataToolParamsTyp }, ]; } - - // Update our local document maps with the new document - this._docManager.processDocument(createdDoc); - // Get the created document's metadata - const createdMetadata = this._docManager.extractDocumentMetadata(this._docManager.createAgentDoc(createdDoc)); + const createdMetadata = this._docManager.extractDocumentMetadata(id); return [ { type: 'text', text: `Document created successfully. -Document ID: ${createdDoc.id} +Document ID: ${id} Type: ${docType} Title: "${title}" @@ -447,9 +443,9 @@ You can now use the "edit" action to modify additional properties of this docume Next steps: 1. Use the "getFieldOptions" action to understand available editable/addable fields/properties and their dependencies. -2. To modify this document, use: { action: "edit", documentId: "${createdDoc.id}", fieldEdits: [{"fieldName":"property","fieldValue":"value"}] } +2. To modify this document, use: { action: "edit", documentId: "${id}", fieldEdits: [{"fieldName":"property","fieldValue":"value"}] } 3. To add styling, consider setting backgroundColor, fontColor, or other properties -4. For text documents, you can edit the content with: { action: "edit", documentId: "${createdDoc.id}", fieldEdits: [{"fieldName":"text","fieldValue":"New content"}] } +4. For text documents, you can edit the content with: { action: "edit", documentId: "${id}", fieldEdits: [{"fieldName":"text","fieldValue":"New content"}] } Full metadata for the created document: ${JSON.stringify(createdMetadata, null, 2)}`, |
