From e7f616290f20c37121f554303f775a102569bdc7 Mon Sep 17 00:00:00 2001 From: oleg Date: Wed, 5 Jun 2024 14:39:20 +0200 Subject: [PATCH] fix(AI Agent Node): Improve Tools agent empty tool input message (#9622) Signed-off-by: Oleg Ivaniv --- .../nodes/agents/Agent/Agent.node.ts | 13 +++++++------ .../agents/Agent/agents/ToolsAgent/execute.ts | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts index acbdf28cf486d..e4843f356cc0c 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts @@ -190,7 +190,14 @@ const agentTypeProperty: INodeProperties = { name: 'agent', type: 'options', noDataExpression: true, + // eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items options: [ + { + name: 'Tools Agent', + value: 'toolsAgent', + description: + 'Utilized unified Tool calling interface to select the appropriate tools and argument for execution', + }, { name: 'Conversational Agent', value: 'conversationalAgent', @@ -219,12 +226,6 @@ const agentTypeProperty: INodeProperties = { value: 'sqlAgent', description: 'Answers questions about data in an SQL database', }, - { - name: 'Tools Agent', - value: 'toolsAgent', - description: - 'Utilized unified Tool calling interface to select the appropriate tools and argument for execution', - }, ], default: '', }; diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts index 11cc3a4de2047..603f5afb666b5 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts @@ -155,11 +155,19 @@ export async function toolsAgentExecute(this: IExecuteFunctions): Promise