diff options
author | bobzel <zzzman@gmail.com> | 2025-04-23 22:02:51 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-04-23 22:02:51 -0400 |
commit | 0e6d7b45c14301d426f85eeef0a96ab8dceebc25 (patch) | |
tree | 5eb67dd31b631189caf6ceb1192088c8e934349a /src/client/views/nodes/chatbot/tools/GetDocsTool.ts | |
parent | db2029602586985b7113fa436851b19746eac673 (diff) | |
parent | 78ac87b8acf63079071e5e8805692ed8c30042ce (diff) |
Merge branch 'master' into aarav_edit
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/GetDocsTool.ts')
-rw-r--r-- | src/client/views/nodes/chatbot/tools/GetDocsTool.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/nodes/chatbot/tools/GetDocsTool.ts b/src/client/views/nodes/chatbot/tools/GetDocsTool.ts index 05482a66e..42a7747d3 100644 --- a/src/client/views/nodes/chatbot/tools/GetDocsTool.ts +++ b/src/client/views/nodes/chatbot/tools/GetDocsTool.ts @@ -40,7 +40,10 @@ export class GetDocsTool extends BaseTool<GetDocsToolParamsType> { } async execute(args: ParametersType<GetDocsToolParamsType>): Promise<Observation[]> { - const docs = args.document_ids.map(doc_id => DocCast(DocServer.GetCachedRefField(doc_id))); + const docs = args.document_ids + .map(doc_id => DocCast(DocServer.GetCachedRefField(doc_id))) + .filter(d => d) + .map(d => d!); const collection = Docs.Create.FreeformDocument(docs, { title: args.title }); this._docView._props.addDocTab(collection, OpenWhere.addRight); return [{ type: 'text', text: `Collection created in Dash called ${args.title}` }]; |