feat(AI Agent Tool Node): Add Agent Tool (#17108)

This commit is contained in:
Mutasem Aldmour
2025-07-09 11:41:58 +02:00
committed by GitHub
parent 3be5823b97
commit f67581b74d
14 changed files with 500 additions and 116 deletions

View File

@@ -75,16 +75,16 @@ export function isToolsInstance(model: unknown): model is Tool {
}
export function getPromptInputByType(options: {
ctx: IExecuteFunctions;
ctx: IExecuteFunctions | ISupplyDataFunctions;
i: number;
promptTypeKey: string;
inputKey: string;
}) {
const { ctx, i, promptTypeKey, inputKey } = options;
const prompt = ctx.getNodeParameter(promptTypeKey, i) as string;
const promptType = ctx.getNodeParameter(promptTypeKey, i, 'define') as string;
let input;
if (prompt === 'auto') {
if (promptType === 'auto') {
input = ctx.evaluateExpression('{{ $json["chatInput"] }}', i) as string;
} else {
input = ctx.getNodeParameter(inputKey, i) as string;
@@ -186,7 +186,7 @@ export function escapeSingleCurlyBrackets(text?: string): string | undefined {
}
export const getConnectedTools = async (
ctx: IExecuteFunctions | IWebhookFunctions,
ctx: IExecuteFunctions | IWebhookFunctions | ISupplyDataFunctions,
enforceUniqueNames: boolean,
convertStructuredTool: boolean = true,
escapeCurlyBrackets: boolean = false,