Skip to content

Commit

Permalink
fix(core): Use the correct docs URL for regular nodes when used as to…
Browse files Browse the repository at this point in the history
…ols (#11529)
  • Loading branch information
netroy authored Nov 4, 2024
1 parent 097c254 commit a092b8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/workflow/src/NodeHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/workflow/test/NodeHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3693,6 +3693,7 @@ describe('NodeHelpers', () => {
AI: ['Tools'],
Tools: ['Other Tools'],
},
resources: {},
});
});

Expand Down Expand Up @@ -3775,6 +3776,9 @@ describe('NodeHelpers', () => {
subcategories: {
Existing: ['Category'],
},
resources: {
primaryDocumentation: [{ url: 'https://example.com' }],
},
};
const result = convertNodeToAiTool(fullNodeWrapper);
expect(result.description.codex).toEqual({
Expand All @@ -3783,6 +3787,9 @@ describe('NodeHelpers', () => {
AI: ['Tools'],
Tools: ['Other Tools'],
},
resources: {
primaryDocumentation: [{ url: 'https://example.com' }],
},
});
});

Expand Down

0 comments on commit a092b8e

Please sign in to comment.