From a092b8e972e1253d92df416f19096a045858e7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 4 Nov 2024 12:31:17 +0100 Subject: [PATCH] fix(core): Use the correct docs URL for regular nodes when used as tools (#11529) --- packages/workflow/src/NodeHelpers.ts | 3 +++ packages/workflow/test/NodeHelpers.test.ts | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index 85431c6897..e21f2b7e1a 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -432,12 +432,15 @@ export function convertNodeToAiTool< } } + const resources = item.description.codex?.resources ?? {}; + item.description.codex = { categories: ['AI'], subcategories: { AI: ['Tools'], Tools: ['Other Tools'], }, + resources, }; return item; } diff --git a/packages/workflow/test/NodeHelpers.test.ts b/packages/workflow/test/NodeHelpers.test.ts index 81b7af5de6..09e036fc94 100644 --- a/packages/workflow/test/NodeHelpers.test.ts +++ b/packages/workflow/test/NodeHelpers.test.ts @@ -3693,6 +3693,7 @@ describe('NodeHelpers', () => { AI: ['Tools'], Tools: ['Other Tools'], }, + resources: {}, }); }); @@ -3775,6 +3776,9 @@ describe('NodeHelpers', () => { subcategories: { Existing: ['Category'], }, + resources: { + primaryDocumentation: [{ url: 'https://example.com' }], + }, }; const result = convertNodeToAiTool(fullNodeWrapper); expect(result.description.codex).toEqual({ @@ -3783,6 +3787,9 @@ describe('NodeHelpers', () => { AI: ['Tools'], Tools: ['Other Tools'], }, + resources: { + primaryDocumentation: [{ url: 'https://example.com' }], + }, }); });