feat: Add nodeAsTool description overrides for tool version (no-changelog) (#14048)

This commit is contained in:
Charlie Kolb
2025-03-20 10:09:33 +01:00
committed by GitHub
parent c06ce765f1
commit 996026f358
3 changed files with 47 additions and 5 deletions

View File

@@ -312,10 +312,16 @@ export class LoadNodesAndCredentials {
*/
createAiTools() {
const usableNodes: Array<INodeTypeBaseDescription | INodeTypeDescription> =
this.types.nodes.filter((nodetype) => nodetype.usableAsTool === true);
this.types.nodes.filter((nodeType) => nodeType.usableAsTool);
for (const usableNode of usableNodes) {
const description = deepCopy(usableNode);
const description =
typeof usableNode.usableAsTool === 'object'
? ({
...deepCopy(usableNode),
...usableNode.usableAsTool?.replacements,
} as INodeTypeBaseDescription)
: deepCopy(usableNode);
const wrapped = this.convertNodeToAiTool({ description }).description;
this.types.nodes.push(wrapped);
@@ -505,7 +511,7 @@ export class LoadNodesAndCredentials {
categories: ['AI'],
subcategories: {
AI: ['Tools'],
Tools: ['Other Tools'],
Tools: item.description.codex?.subcategories?.Tools ?? ['Other Tools'],
},
resources,
};