n8n/packages/@n8n/nodes-langchain/nodes/agents/Agent/AgentTool.node.ts
Elias Meire ab2c8b56ab
feat(core): Generate HITL tool nodes for sendAndWait operations (#22315)
Co-authored-by: yehorkardash <yehor.kardash@n8n.io>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-01-23 10:04:11 +00:00

37 lines
1.1 KiB
TypeScript

import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
import { VersionedNodeType } from 'n8n-workflow';
import { AgentToolV2 } from './V2/AgentToolV2.node';
import { AgentToolV3 } from './V3/AgentToolV3.node';
export class AgentTool extends VersionedNodeType {
constructor() {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'AI Agent Tool',
name: 'agentTool',
icon: 'fa:robot',
iconColor: 'black',
group: ['transform'],
description: 'Generates an action plan and executes it. Can use external tools.',
codex: {
alias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],
categories: ['AI'],
subcategories: {
AI: ['Tools'],
Tools: ['Recommended Tools'],
},
},
defaultVersion: 3,
};
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
// Should have the same versioning as Agent node
// because internal agent logic often checks for node version
2.2: new AgentToolV2(baseDescription),
3: new AgentToolV3(baseDescription),
};
super(nodeVersions, baseDescription);
}
}