@n8n/n8n-nodes-langchain 2.0.2 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/credentials/McpOAuth2Api.credentials.js +1 -2
  2. package/dist/credentials/McpOAuth2Api.credentials.js.map +1 -1
  3. package/dist/nodes/agents/Agent/Agent.node.js +4 -2
  4. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  5. package/dist/nodes/agents/Agent/AgentTool.node.js +4 -2
  6. package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -1
  7. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +1 -1
  8. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
  9. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +1 -1
  10. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
  11. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js +99 -0
  12. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js.map +1 -0
  13. package/dist/nodes/agents/Agent/V3/AgentV3.node.js +9 -2
  14. package/dist/nodes/agents/Agent/V3/AgentV3.node.js.map +1 -1
  15. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +1 -1
  16. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -1
  17. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +1 -3
  18. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -1
  19. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js +4 -0
  20. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js.map +1 -1
  21. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +1 -1
  22. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
  23. package/dist/nodes/chains/ChainLLM/methods/config.js +10 -2
  24. package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -1
  25. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +11 -3
  26. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
  27. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +9 -3
  28. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
  29. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +3 -0
  30. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
  31. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +66 -15
  32. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
  33. package/dist/nodes/trigger/ChatTrigger/templates.js +1 -2
  34. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -1
  35. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +2 -2
  36. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -1
  37. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js +64 -0
  38. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js.map +1 -0
  39. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js +72 -0
  40. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js.map +1 -0
  41. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js +94 -0
  42. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js.map +1 -0
  43. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js +75 -0
  44. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js.map +1 -0
  45. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js +129 -0
  46. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js.map +1 -0
  47. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -1
  48. package/dist/nodes/vendors/GoogleGemini/actions/router.js +4 -0
  49. package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -1
  50. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +184 -11
  51. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -1
  52. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +10 -3
  53. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -1
  54. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -1
  55. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +131 -26
  56. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -1
  57. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js +1 -1
  58. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -1
  59. package/dist/types/credentials.json +1 -1
  60. package/dist/types/nodes.json +9 -8
  61. package/dist/utils/agent-execution/buildSteps.js +67 -8
  62. package/dist/utils/agent-execution/buildSteps.js.map +1 -1
  63. package/dist/utils/agent-execution/createEngineRequests.js +27 -5
  64. package/dist/utils/agent-execution/createEngineRequests.js.map +1 -1
  65. package/dist/utils/agent-execution/types.js +24 -0
  66. package/dist/utils/agent-execution/types.js.map +1 -1
  67. package/dist/utils/descriptions.js +21 -1
  68. package/dist/utils/descriptions.js.map +1 -1
  69. package/package.json +10 -10
@@ -32,8 +32,7 @@ class McpOAuth2Api {
32
32
  displayName: "Use Dynamic Client Registration",
33
33
  name: "useDynamicClientRegistration",
34
34
  type: "boolean",
35
- default: true,
36
- required: true
35
+ default: true
37
36
  }
38
37
  ];
39
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../credentials/McpOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nexport class McpOAuth2Api implements ICredentialType {\n\tname = 'mcpOAuth2Api';\n\n\textends = ['oAuth2Api'];\n\n\tdisplayName = 'MCP OAuth2 API';\n\n\tdocumentationUrl = 'mcp';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Use Dynamic Client Registration',\n\t\t\tname: 'useDynamicClientRegistration',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\trequired: true,\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,aAAwC;AAAA,EAA9C;AACN,gBAAO;AAEP,mBAAU,CAAC,WAAW;AAEtB,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,UAAU;AAAA,MACX;AAAA,IACD;AAAA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../credentials/McpOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nexport class McpOAuth2Api implements ICredentialType {\n\tname = 'mcpOAuth2Api';\n\n\textends = ['oAuth2Api'];\n\n\tdisplayName = 'MCP OAuth2 API';\n\n\tdocumentationUrl = 'mcp';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Use Dynamic Client Registration',\n\t\t\tname: 'useDynamicClientRegistration',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,aAAwC;AAAA,EAA9C;AACN,gBAAO;AAEP,mBAAU,CAAC,WAAW;AAEtB,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,IACD;AAAA;AACD;","names":[]}
@@ -48,7 +48,7 @@ class Agent extends import_n8n_workflow.VersionedNodeType {
48
48
  ]
49
49
  }
50
50
  },
51
- defaultVersion: 3
51
+ defaultVersion: 3.1
52
52
  };
53
53
  const nodeVersions = {
54
54
  1: new import_AgentV1.AgentV1(baseDescription),
@@ -64,7 +64,9 @@ class Agent extends import_n8n_workflow.VersionedNodeType {
64
64
  2: new import_AgentV2.AgentV2(baseDescription),
65
65
  2.1: new import_AgentV2.AgentV2(baseDescription),
66
66
  2.2: new import_AgentV2.AgentV2(baseDescription),
67
- 3: new import_AgentV3.AgentV3(baseDescription)
67
+ 2.3: new import_AgentV2.AgentV2(baseDescription),
68
+ 3: new import_AgentV3.AgentV3(baseDescription),
69
+ 3.1: new import_AgentV3.AgentV3(baseDescription)
68
70
  // IMPORTANT Reminder to update AgentTool
69
71
  };
70
72
  super(nodeVersions, baseDescription);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/agents/Agent/Agent.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentV1 } from './V1/AgentV1.node';\nimport { AgentV2 } from './V2/AgentV2.node';\nimport { AgentV3 } from './V3/AgentV3.node';\n\nexport class Agent extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent',\n\t\t\tname: 'agent',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Agents', 'Root Nodes'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaultVersion: 3,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t1: new AgentV1(baseDescription),\n\t\t\t1.1: new AgentV1(baseDescription),\n\t\t\t1.2: new AgentV1(baseDescription),\n\t\t\t1.3: new AgentV1(baseDescription),\n\t\t\t1.4: new AgentV1(baseDescription),\n\t\t\t1.5: new AgentV1(baseDescription),\n\t\t\t1.6: new AgentV1(baseDescription),\n\t\t\t1.7: new AgentV1(baseDescription),\n\t\t\t1.8: new AgentV1(baseDescription),\n\t\t\t1.9: new AgentV1(baseDescription),\n\t\t\t2: new AgentV2(baseDescription),\n\t\t\t2.1: new AgentV2(baseDescription),\n\t\t\t2.2: new AgentV2(baseDescription),\n\t\t\t3: new AgentV3(baseDescription),\n\t\t\t// IMPORTANT Reminder to update AgentTool\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,qBAAwB;AACxB,qBAAwB;AACxB,qBAAwB;AAEjB,MAAM,cAAc,sCAAkB;AAAA,EAC5C,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,UAAU,YAAY;AAAA,QAC5B;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA,MACxD,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA;AAAA,IAE/B;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/agents/Agent/Agent.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentV1 } from './V1/AgentV1.node';\nimport { AgentV2 } from './V2/AgentV2.node';\nimport { AgentV3 } from './V3/AgentV3.node';\n\nexport class Agent extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent',\n\t\t\tname: 'agent',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Agents', 'Root Nodes'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaultVersion: 3.1,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t1: new AgentV1(baseDescription),\n\t\t\t1.1: new AgentV1(baseDescription),\n\t\t\t1.2: new AgentV1(baseDescription),\n\t\t\t1.3: new AgentV1(baseDescription),\n\t\t\t1.4: new AgentV1(baseDescription),\n\t\t\t1.5: new AgentV1(baseDescription),\n\t\t\t1.6: new AgentV1(baseDescription),\n\t\t\t1.7: new AgentV1(baseDescription),\n\t\t\t1.8: new AgentV1(baseDescription),\n\t\t\t1.9: new AgentV1(baseDescription),\n\t\t\t2: new AgentV2(baseDescription),\n\t\t\t2.1: new AgentV2(baseDescription),\n\t\t\t2.2: new AgentV2(baseDescription),\n\t\t\t2.3: new AgentV2(baseDescription),\n\t\t\t3: new AgentV3(baseDescription),\n\t\t\t3.1: new AgentV3(baseDescription),\n\t\t\t// IMPORTANT Reminder to update AgentTool\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,qBAAwB;AACxB,qBAAwB;AACxB,qBAAwB;AAEjB,MAAM,cAAc,sCAAkB;AAAA,EAC5C,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,UAAU,YAAY;AAAA,QAC5B;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA,MACxD,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA;AAAA,IAEjC;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
@@ -23,6 +23,7 @@ __export(AgentTool_node_exports, {
23
23
  module.exports = __toCommonJS(AgentTool_node_exports);
24
24
  var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_AgentToolV2 = require("./V2/AgentToolV2.node");
26
+ var import_AgentToolV3 = require("./V3/AgentToolV3.node");
26
27
  class AgentTool extends import_n8n_workflow.VersionedNodeType {
27
28
  constructor() {
28
29
  const baseDescription = {
@@ -40,12 +41,13 @@ class AgentTool extends import_n8n_workflow.VersionedNodeType {
40
41
  Tools: ["Other Tools"]
41
42
  }
42
43
  },
43
- defaultVersion: 2.2
44
+ defaultVersion: 3
44
45
  };
45
46
  const nodeVersions = {
46
47
  // Should have the same versioning as Agent node
47
48
  // because internal agent logic often checks for node version
48
- 2.2: new import_AgentToolV2.AgentToolV2(baseDescription)
49
+ 2.2: new import_AgentToolV2.AgentToolV2(baseDescription),
50
+ 3: new import_AgentToolV3.AgentToolV3(baseDescription)
49
51
  };
50
52
  super(nodeVersions, baseDescription);
51
53
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/agents/Agent/AgentTool.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentToolV2 } from './V2/AgentToolV2.node';\n\nexport class AgentTool extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent Tool',\n\t\t\tname: 'agentTool',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Tools'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaultVersion: 2.2,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t// Should have the same versioning as Agent node\n\t\t\t// because internal agent logic often checks for node version\n\t\t\t2.2: new AgentToolV2(baseDescription),\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,yBAA4B;AAErB,MAAM,kBAAkB,sCAAkB;AAAA,EAChD,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,OAAO;AAAA,UACZ,OAAO,CAAC,aAAa;AAAA,QACtB;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA;AAAA;AAAA,MAGxD,KAAK,IAAI,+BAAY,eAAe;AAAA,IACrC;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/agents/Agent/AgentTool.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentToolV2 } from './V2/AgentToolV2.node';\nimport { AgentToolV3 } from './V3/AgentToolV3.node';\n\nexport class AgentTool extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent Tool',\n\t\t\tname: 'agentTool',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Tools'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaultVersion: 3,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t// Should have the same versioning as Agent node\n\t\t\t// because internal agent logic often checks for node version\n\t\t\t2.2: new AgentToolV2(baseDescription),\n\t\t\t3: new AgentToolV3(baseDescription),\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,yBAA4B;AAC5B,yBAA4B;AAErB,MAAM,kBAAkB,sCAAkB;AAAA,EAChD,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,OAAO;AAAA,UACZ,OAAO,CAAC,aAAa;AAAA,QACtB;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA;AAAA;AAAA,MAGxD,KAAK,IAAI,+BAAY,eAAe;AAAA,MACpC,GAAG,IAAI,+BAAY,eAAe;AAAA,IACnC;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
@@ -336,7 +336,7 @@ class AgentV1 {
336
336
  default: "toolsAgent"
337
337
  },
338
338
  {
339
- ...import_descriptions.promptTypeOptions,
339
+ ...import_descriptions.promptTypeOptionsDeprecated,
340
340
  displayOptions: {
341
341
  hide: {
342
342
  "@version": [{ _cnd: { lte: 1.2 } }],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/agents/Agent/V1/AgentV1.node.ts"],"sourcesContent":["import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tINodeInputConfiguration,\n\tINodeInputFilter,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeProperties,\n\tNodeConnectionType,\n\tINodeTypeBaseDescription,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { conversationalAgentProperties } from '../agents/ConversationalAgent/description';\nimport { conversationalAgentExecute } from '../agents/ConversationalAgent/execute';\nimport { openAiFunctionsAgentProperties } from '../agents/OpenAiFunctionsAgent/description';\nimport { openAiFunctionsAgentExecute } from '../agents/OpenAiFunctionsAgent/execute';\nimport { planAndExecuteAgentProperties } from '../agents/PlanAndExecuteAgent/description';\nimport { planAndExecuteAgentExecute } from '../agents/PlanAndExecuteAgent/execute';\nimport { reActAgentAgentProperties } from '../agents/ReActAgent/description';\nimport { reActAgentAgentExecute } from '../agents/ReActAgent/execute';\nimport { sqlAgentAgentProperties } from '../agents/SqlAgent/description';\nimport { sqlAgentAgentExecute } from '../agents/SqlAgent/execute';\nimport { toolsAgentProperties } from '../agents/ToolsAgent/V1/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V1/execute';\n\n// Function used in the inputs expression to figure out which inputs to\n// display based on the agent type\nfunction getInputs(\n\tagent:\n\t\t| 'toolsAgent'\n\t\t| 'conversationalAgent'\n\t\t| 'openAiFunctionsAgent'\n\t\t| 'planAndExecuteAgent'\n\t\t| 'reActAgent'\n\t\t| 'sqlAgent',\n\thasOutputParser?: boolean,\n): Array<NodeConnectionType | INodeInputConfiguration> {\n\tinterface SpecialInput {\n\t\ttype: NodeConnectionType;\n\t\tfilter?: INodeInputFilter;\n\t\trequired?: boolean;\n\t}\n\n\tconst getInputData = (\n\t\tinputs: SpecialInput[],\n\t): Array<NodeConnectionType | INodeInputConfiguration> => {\n\t\tconst displayNames: { [key: string]: string } = {\n\t\t\tai_languageModel: 'Model',\n\t\t\tai_memory: 'Memory',\n\t\t\tai_tool: 'Tool',\n\t\t\tai_outputParser: 'Output Parser',\n\t\t};\n\n\t\treturn inputs.map(({ type, filter }) => {\n\t\t\tconst isModelType = type === ('ai_languageModel' as NodeConnectionType);\n\t\t\tlet displayName = type in displayNames ? displayNames[type] : undefined;\n\t\t\tif (\n\t\t\t\tisModelType &&\n\t\t\t\t['openAiFunctionsAgent', 'toolsAgent', 'conversationalAgent'].includes(agent)\n\t\t\t) {\n\t\t\t\tdisplayName = 'Chat Model';\n\t\t\t}\n\t\t\tconst input: INodeInputConfiguration = {\n\t\t\t\ttype,\n\t\t\t\tdisplayName,\n\t\t\t\trequired: isModelType,\n\t\t\t\tmaxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)\n\t\t\t\t\t? 1\n\t\t\t\t\t: undefined,\n\t\t\t};\n\n\t\t\tif (filter) {\n\t\t\t\tinput.filter = filter;\n\t\t\t}\n\n\t\t\treturn input;\n\t\t});\n\t};\n\n\tlet specialInputs: SpecialInput[] = [];\n\n\tif (agent === 'conversationalAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAnthropic',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAwsBedrock',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGroq',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatLemonade',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOllama',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleGemini',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleVertex',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatMistralCloud',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatDeepSeek',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenRouter',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatVercelAiGateway',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatXAiGrok',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.modelSelector',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'toolsAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAnthropic',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAwsBedrock',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatLemonade',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatMistralCloud',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOllama',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGroq',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleVertex',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleGemini',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatDeepSeek',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenRouter',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatVercelAiGateway',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatXAiGrok',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'openAiFunctionsAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'reActAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'sqlAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'planAndExecuteAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t}\n\n\tif (hasOutputParser === false) {\n\t\tspecialInputs = specialInputs.filter((input) => input.type !== 'ai_outputParser');\n\t}\n\treturn ['main', ...getInputData(specialInputs)];\n}\n\nconst agentTypeProperty: INodeProperties = {\n\tdisplayName: 'Agent',\n\tname: 'agent',\n\ttype: 'options',\n\tnoDataExpression: true,\n\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\toptions: [\n\t\t{\n\t\t\tname: 'Tools Agent',\n\t\t\tvalue: 'toolsAgent',\n\t\t\tdescription:\n\t\t\t\t'Utilizes structured tool schemas for precise and reliable tool selection and execution. Recommended for complex tasks requiring accurate and consistent tool usage, but only usable with models that support tool calling.',\n\t\t},\n\t\t{\n\t\t\tname: 'Conversational Agent',\n\t\t\tvalue: 'conversationalAgent',\n\t\t\tdescription:\n\t\t\t\t'Describes tools in the system prompt and parses JSON responses for tool calls. More flexible but potentially less reliable than the Tools Agent. Suitable for simpler interactions or with models not supporting structured schemas.',\n\t\t},\n\t\t{\n\t\t\tname: 'OpenAI Functions Agent',\n\t\t\tvalue: 'openAiFunctionsAgent',\n\t\t\tdescription:\n\t\t\t\t\"Leverages OpenAI's function calling capabilities to precisely select and execute tools. Excellent for tasks requiring structured outputs when working with OpenAI models.\",\n\t\t},\n\t\t{\n\t\t\tname: 'Plan and Execute Agent',\n\t\t\tvalue: 'planAndExecuteAgent',\n\t\t\tdescription:\n\t\t\t\t'Creates a high-level plan for complex tasks and then executes each step. Suitable for multi-stage problems or when a strategic approach is needed.',\n\t\t},\n\t\t{\n\t\t\tname: 'ReAct Agent',\n\t\t\tvalue: 'reActAgent',\n\t\t\tdescription:\n\t\t\t\t'Combines reasoning and action in an iterative process. Effective for tasks that require careful analysis and step-by-step problem-solving.',\n\t\t},\n\t\t{\n\t\t\tname: 'SQL Agent',\n\t\t\tvalue: 'sqlAgent',\n\t\t\tdescription:\n\t\t\t\t'Specializes in interacting with SQL databases. Ideal for data analysis tasks, generating queries, or extracting insights from structured data.',\n\t\t},\n\t],\n\tdefault: '',\n};\n\nexport class AgentV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\tversion: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9],\n\t\t\t...baseDescription,\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((agent, hasOutputParser) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(agent, hasOutputParser)\n\t\t\t\t})($parameter.agent, $parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tcredentials: [\n\t\t\t\t{\n\t\t\t\t\tname: 'mySql',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttestedBy: 'mysqlConnectionTest',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t\t'/dataSource': ['mysql'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'postgres',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t\t'/dataSource': ['postgres'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['conversationalAgent', 'toolsAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'Get started faster with our',\n\t\t\t\t\tname: 'preBuiltAgentsCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tcalloutAction: {\n\t\t\t\t\t\t\tlabel: 'pre-built agents',\n\t\t\t\t\t\t\ticon: 'bot',\n\t\t\t\t\t\t\ttype: 'openPreBuiltAgentsCollection',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t\"This node is using Agent that has been deprecated. Please switch to using 'Tools Agent' instead.\",\n\t\t\t\t\tname: 'deprecated',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: [\n\t\t\t\t\t\t\t\t'conversationalAgent',\n\t\t\t\t\t\t\t\t'openAiFunctionsAgent',\n\t\t\t\t\t\t\t\t'planAndExecuteAgent',\n\t\t\t\t\t\t\t\t'reActAgent',\n\t\t\t\t\t\t\t\t'sqlAgent',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Make Conversational Agent the default agent for versions 1.5 and below\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\toptions: agentTypeProperty?.options?.filter(\n\t\t\t\t\t\t(o) => 'value' in o && o.value !== 'toolsAgent',\n\t\t\t\t\t),\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { lte: 1.5 } }] } },\n\t\t\t\t\tdefault: 'conversationalAgent',\n\t\t\t\t},\n\t\t\t\t// Make Tools Agent the default agent for versions 1.6 and 1.7\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { between: { from: 1.6, to: 1.7 } } }] } },\n\t\t\t\t\tdefault: 'toolsAgent',\n\t\t\t\t},\n\t\t\t\t// Make Tools Agent the only agent option for versions 1.8 and above\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 1.8 } }] } },\n\t\t\t\t\tdefault: 'toolsAgent',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...promptTypeOptions,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: { promptType: ['guardrails'], '@version': [{ _cnd: { gte: 1.7 } }] },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.7 } }] },\n\t\t\t\t\t\t// SQL Agent has data source and credentials parameters so we need to include this input there manually\n\t\t\t\t\t\t// to preserve the order\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'For more reliable structured output parsing, consider using the Tools agent',\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t\tagent: [\n\t\t\t\t\t\t\t\t'conversationalAgent',\n\t\t\t\t\t\t\t\t'reActAgent',\n\t\t\t\t\t\t\t\t'planAndExecuteAgent',\n\t\t\t\t\t\t\t\t'openAiFunctionsAgent',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t\tagent: ['toolsAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\n\t\t\t\t...toolsAgentProperties,\n\t\t\t\t...conversationalAgentProperties,\n\t\t\t\t...openAiFunctionsAgentProperties,\n\t\t\t\t...reActAgentAgentProperties,\n\t\t\t\t...sqlAgentAgentProperties,\n\t\t\t\t...planAndExecuteAgentProperties,\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst agentType = this.getNodeParameter('agent', 0, '') as string;\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tif (agentType === 'conversationalAgent') {\n\t\t\treturn await conversationalAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'toolsAgent') {\n\t\t\treturn await toolsAgentExecute.call(this);\n\t\t} else if (agentType === 'openAiFunctionsAgent') {\n\t\t\treturn await openAiFunctionsAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'reActAgent') {\n\t\t\treturn await reActAgentAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'sqlAgent') {\n\t\t\treturn await sqlAgentAgentExecute.call(this);\n\t\t} else if (agentType === 'planAndExecuteAgent') {\n\t\t\treturn await planAndExecuteAgentExecute.call(this, nodeVersion);\n\t\t}\n\n\t\tthrow new NodeOperationError(this.getNode(), `The agent type \"${agentType}\" is not supported`);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwD;AAaxD,0BAKO;AAEP,yBAA8C;AAC9C,qBAA2C;AAC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YAAY;AACpC,aAAO,MAAM,qCAAqB,KAAK,IAAI;AAAA,IAC5C,WAAW,cAAc,uBAAuB;AAC/C,aAAO,MAAM,2CAA2B,KAAK,MAAM,WAAW;AAAA,IAC/D;AAEA,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,mBAAmB,SAAS,oBAAoB;AAAA,EAC9F;AACD;","names":["import_description","import_execute"]}
1
+ {"version":3,"sources":["../../../../../nodes/agents/Agent/V1/AgentV1.node.ts"],"sourcesContent":["import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tINodeInputConfiguration,\n\tINodeInputFilter,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeProperties,\n\tNodeConnectionType,\n\tINodeTypeBaseDescription,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { conversationalAgentProperties } from '../agents/ConversationalAgent/description';\nimport { conversationalAgentExecute } from '../agents/ConversationalAgent/execute';\nimport { openAiFunctionsAgentProperties } from '../agents/OpenAiFunctionsAgent/description';\nimport { openAiFunctionsAgentExecute } from '../agents/OpenAiFunctionsAgent/execute';\nimport { planAndExecuteAgentProperties } from '../agents/PlanAndExecuteAgent/description';\nimport { planAndExecuteAgentExecute } from '../agents/PlanAndExecuteAgent/execute';\nimport { reActAgentAgentProperties } from '../agents/ReActAgent/description';\nimport { reActAgentAgentExecute } from '../agents/ReActAgent/execute';\nimport { sqlAgentAgentProperties } from '../agents/SqlAgent/description';\nimport { sqlAgentAgentExecute } from '../agents/SqlAgent/execute';\nimport { toolsAgentProperties } from '../agents/ToolsAgent/V1/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V1/execute';\n\n// Function used in the inputs expression to figure out which inputs to\n// display based on the agent type\nfunction getInputs(\n\tagent:\n\t\t| 'toolsAgent'\n\t\t| 'conversationalAgent'\n\t\t| 'openAiFunctionsAgent'\n\t\t| 'planAndExecuteAgent'\n\t\t| 'reActAgent'\n\t\t| 'sqlAgent',\n\thasOutputParser?: boolean,\n): Array<NodeConnectionType | INodeInputConfiguration> {\n\tinterface SpecialInput {\n\t\ttype: NodeConnectionType;\n\t\tfilter?: INodeInputFilter;\n\t\trequired?: boolean;\n\t}\n\n\tconst getInputData = (\n\t\tinputs: SpecialInput[],\n\t): Array<NodeConnectionType | INodeInputConfiguration> => {\n\t\tconst displayNames: { [key: string]: string } = {\n\t\t\tai_languageModel: 'Model',\n\t\t\tai_memory: 'Memory',\n\t\t\tai_tool: 'Tool',\n\t\t\tai_outputParser: 'Output Parser',\n\t\t};\n\n\t\treturn inputs.map(({ type, filter }) => {\n\t\t\tconst isModelType = type === ('ai_languageModel' as NodeConnectionType);\n\t\t\tlet displayName = type in displayNames ? displayNames[type] : undefined;\n\t\t\tif (\n\t\t\t\tisModelType &&\n\t\t\t\t['openAiFunctionsAgent', 'toolsAgent', 'conversationalAgent'].includes(agent)\n\t\t\t) {\n\t\t\t\tdisplayName = 'Chat Model';\n\t\t\t}\n\t\t\tconst input: INodeInputConfiguration = {\n\t\t\t\ttype,\n\t\t\t\tdisplayName,\n\t\t\t\trequired: isModelType,\n\t\t\t\tmaxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)\n\t\t\t\t\t? 1\n\t\t\t\t\t: undefined,\n\t\t\t};\n\n\t\t\tif (filter) {\n\t\t\t\tinput.filter = filter;\n\t\t\t}\n\n\t\t\treturn input;\n\t\t});\n\t};\n\n\tlet specialInputs: SpecialInput[] = [];\n\n\tif (agent === 'conversationalAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAnthropic',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAwsBedrock',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGroq',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatLemonade',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOllama',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleGemini',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleVertex',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatMistralCloud',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatDeepSeek',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenRouter',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatVercelAiGateway',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatXAiGrok',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.modelSelector',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'toolsAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAnthropic',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAwsBedrock',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatLemonade',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatMistralCloud',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOllama',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGroq',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleVertex',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatGoogleGemini',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatDeepSeek',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenRouter',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatVercelAiGateway',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatXAiGrok',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'openAiFunctionsAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t\tfilter: {\n\t\t\t\t\tnodes: [\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatOpenAi',\n\t\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmChatAzureOpenAi',\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'reActAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'sqlAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_memory',\n\t\t\t},\n\t\t];\n\t} else if (agent === 'planAndExecuteAgent') {\n\t\tspecialInputs = [\n\t\t\t{\n\t\t\t\ttype: 'ai_languageModel',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_tool',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'ai_outputParser',\n\t\t\t},\n\t\t];\n\t}\n\n\tif (hasOutputParser === false) {\n\t\tspecialInputs = specialInputs.filter((input) => input.type !== 'ai_outputParser');\n\t}\n\treturn ['main', ...getInputData(specialInputs)];\n}\n\nconst agentTypeProperty: INodeProperties = {\n\tdisplayName: 'Agent',\n\tname: 'agent',\n\ttype: 'options',\n\tnoDataExpression: true,\n\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\toptions: [\n\t\t{\n\t\t\tname: 'Tools Agent',\n\t\t\tvalue: 'toolsAgent',\n\t\t\tdescription:\n\t\t\t\t'Utilizes structured tool schemas for precise and reliable tool selection and execution. Recommended for complex tasks requiring accurate and consistent tool usage, but only usable with models that support tool calling.',\n\t\t},\n\t\t{\n\t\t\tname: 'Conversational Agent',\n\t\t\tvalue: 'conversationalAgent',\n\t\t\tdescription:\n\t\t\t\t'Describes tools in the system prompt and parses JSON responses for tool calls. More flexible but potentially less reliable than the Tools Agent. Suitable for simpler interactions or with models not supporting structured schemas.',\n\t\t},\n\t\t{\n\t\t\tname: 'OpenAI Functions Agent',\n\t\t\tvalue: 'openAiFunctionsAgent',\n\t\t\tdescription:\n\t\t\t\t\"Leverages OpenAI's function calling capabilities to precisely select and execute tools. Excellent for tasks requiring structured outputs when working with OpenAI models.\",\n\t\t},\n\t\t{\n\t\t\tname: 'Plan and Execute Agent',\n\t\t\tvalue: 'planAndExecuteAgent',\n\t\t\tdescription:\n\t\t\t\t'Creates a high-level plan for complex tasks and then executes each step. Suitable for multi-stage problems or when a strategic approach is needed.',\n\t\t},\n\t\t{\n\t\t\tname: 'ReAct Agent',\n\t\t\tvalue: 'reActAgent',\n\t\t\tdescription:\n\t\t\t\t'Combines reasoning and action in an iterative process. Effective for tasks that require careful analysis and step-by-step problem-solving.',\n\t\t},\n\t\t{\n\t\t\tname: 'SQL Agent',\n\t\t\tvalue: 'sqlAgent',\n\t\t\tdescription:\n\t\t\t\t'Specializes in interacting with SQL databases. Ideal for data analysis tasks, generating queries, or extracting insights from structured data.',\n\t\t},\n\t],\n\tdefault: '',\n};\n\nexport class AgentV1 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\tversion: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9],\n\t\t\t...baseDescription,\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((agent, hasOutputParser) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(agent, hasOutputParser)\n\t\t\t\t})($parameter.agent, $parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tcredentials: [\n\t\t\t\t{\n\t\t\t\t\tname: 'mySql',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttestedBy: 'mysqlConnectionTest',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t\t'/dataSource': ['mysql'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'postgres',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t\t'/dataSource': ['postgres'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: ['conversationalAgent', 'toolsAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'Get started faster with our',\n\t\t\t\t\tname: 'preBuiltAgentsCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tcalloutAction: {\n\t\t\t\t\t\t\tlabel: 'pre-built agents',\n\t\t\t\t\t\t\ticon: 'bot',\n\t\t\t\t\t\t\ttype: 'openPreBuiltAgentsCollection',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t\"This node is using Agent that has been deprecated. Please switch to using 'Tools Agent' instead.\",\n\t\t\t\t\tname: 'deprecated',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tagent: [\n\t\t\t\t\t\t\t\t'conversationalAgent',\n\t\t\t\t\t\t\t\t'openAiFunctionsAgent',\n\t\t\t\t\t\t\t\t'planAndExecuteAgent',\n\t\t\t\t\t\t\t\t'reActAgent',\n\t\t\t\t\t\t\t\t'sqlAgent',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Make Conversational Agent the default agent for versions 1.5 and below\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\toptions: agentTypeProperty?.options?.filter(\n\t\t\t\t\t\t(o) => 'value' in o && o.value !== 'toolsAgent',\n\t\t\t\t\t),\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { lte: 1.5 } }] } },\n\t\t\t\t\tdefault: 'conversationalAgent',\n\t\t\t\t},\n\t\t\t\t// Make Tools Agent the default agent for versions 1.6 and 1.7\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { between: { from: 1.6, to: 1.7 } } }] } },\n\t\t\t\t\tdefault: 'toolsAgent',\n\t\t\t\t},\n\t\t\t\t// Make Tools Agent the only agent option for versions 1.8 and above\n\t\t\t\t{\n\t\t\t\t\t...agentTypeProperty,\n\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 1.8 } }] } },\n\t\t\t\t\tdefault: 'toolsAgent',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...promptTypeOptionsDeprecated,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: { promptType: ['guardrails'], '@version': [{ _cnd: { gte: 1.7 } }] },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.7 } }] },\n\t\t\t\t\t\t// SQL Agent has data source and credentials parameters so we need to include this input there manually\n\t\t\t\t\t\t// to preserve the order\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'For more reliable structured output parsing, consider using the Tools agent',\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t\tagent: [\n\t\t\t\t\t\t\t\t'conversationalAgent',\n\t\t\t\t\t\t\t\t'reActAgent',\n\t\t\t\t\t\t\t\t'planAndExecuteAgent',\n\t\t\t\t\t\t\t\t'openAiFunctionsAgent',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t\tagent: ['toolsAgent'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\n\t\t\t\t...toolsAgentProperties,\n\t\t\t\t...conversationalAgentProperties,\n\t\t\t\t...openAiFunctionsAgentProperties,\n\t\t\t\t...reActAgentAgentProperties,\n\t\t\t\t...sqlAgentAgentProperties,\n\t\t\t\t...planAndExecuteAgentProperties,\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst agentType = this.getNodeParameter('agent', 0, '') as string;\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tif (agentType === 'conversationalAgent') {\n\t\t\treturn await conversationalAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'toolsAgent') {\n\t\t\treturn await toolsAgentExecute.call(this);\n\t\t} else if (agentType === 'openAiFunctionsAgent') {\n\t\t\treturn await openAiFunctionsAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'reActAgent') {\n\t\t\treturn await reActAgentAgentExecute.call(this, nodeVersion);\n\t\t} else if (agentType === 'sqlAgent') {\n\t\t\treturn await sqlAgentAgentExecute.call(this);\n\t\t} else if (agentType === 'planAndExecuteAgent') {\n\t\t\treturn await planAndExecuteAgentExecute.call(this, nodeVersion);\n\t\t}\n\n\t\tthrow new NodeOperationError(this.getNode(), `The agent type \"${agentType}\" is not supported`);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwD;AAaxD,0BAKO;AAEP,yBAA8C;AAC9C,qBAA2C;AAC3C,IAAAA,sBAA+C;AAC/C,IAAAC,kBAA4C;AAC5C,IAAAD,sBAA8C;AAC9C,IAAAC,kBAA2C;AAC3C,IAAAD,sBAA0C;AAC1C,IAAAC,kBAAuC;AACvC,IAAAD,sBAAwC;AACxC,IAAAC,kBAAqC;AACrC,IAAAD,sBAAqC;AACrC,IAAAC,kBAAkC;AAIlC,SAAS,UACR,OAOA,iBACsD;AAOtD,QAAM,eAAe,CACpB,WACyD;AACzD,UAAM,eAA0C;AAAA,MAC/C,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,iBAAiB;AAAA,IAClB;AAEA,WAAO,OAAO,IAAI,CAAC,EAAE,MAAM,OAAO,MAAM;AACvC,YAAM,cAAc,SAAU;AAC9B,UAAI,cAAc,QAAQ,eAAe,aAAa,IAAI,IAAI;AAC9D,UACC,eACA,CAAC,wBAAwB,cAAc,qBAAqB,EAAE,SAAS,KAAK,GAC3E;AACD,sBAAc;AAAA,MACf;AACA,YAAM,QAAiC;AAAA,QACtC;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,gBAAgB,CAAC,oBAAoB,aAAa,iBAAiB,EAAE,SAAS,IAAI,IAC/E,IACA;AAAA,MACJ;AAEA,UAAI,QAAQ;AACX,cAAM,SAAS;AAAA,MAChB;AAEA,aAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,MAAI,gBAAgC,CAAC;AAErC,MAAI,UAAU,uBAAuB;AACpC,oBAAgB;AAAA,MACf;AAAA,QACC,MAAM;AAAA,QACN,QAAQ;AAAA,UACP,OAAO;AAAA,YACN;A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,IAC/D,WAAW,cAAc,cAAc;AACtC,aAAO,MAAM,kCAAkB,KAAK,IAAI;AAAA,IACzC,WAAW,cAAc,wBAAwB;AAChD,aAAO,MAAM,4CAA4B,KAAK,MAAM,WAAW;AAAA,IAChE,WAAW,cAAc,cAAc;AACtC,aAAO,MAAM,uCAAuB,KAAK,MAAM,WAAW;AAAA,IAC3D,WAAW,cAAc,YAAY;AACpC,aAAO,MAAM,qCAAqB,KAAK,IAAI;AAAA,IAC5C,WAAW,cAAc,uBAAuB;AAC/C,aAAO,MAAM,2CAA2B,KAAK,MAAM,WAAW;AAAA,IAC/D;AAEA,UAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,mBAAmB,SAAS,oBAAoB;AAAA,EAC9F;AACD;","names":["import_description","import_execute"]}
@@ -63,7 +63,7 @@ class AgentV2 {
63
63
  },
64
64
  default: ""
65
65
  },
66
- import_descriptions.promptTypeOptions,
66
+ import_descriptions.promptTypeOptionsDeprecated,
67
67
  {
68
68
  ...import_descriptions.textFromGuardrailsNode,
69
69
  displayOptions: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/agents/Agent/V2/AgentV2.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { getToolsAgentProperties } from '../agents/ToolsAgent/V2/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V2/execute';\nimport { getInputs } from '../utils';\n\nexport class AgentV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [2, 2.1, 2.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(true, hasOutputParser, needsFallback);\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/workflows/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'Get started faster with our',\n\t\t\t\t\tname: 'preBuiltAgentsCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tcalloutAction: {\n\t\t\t\t\t\t\tlabel: 'pre-built agents',\n\t\t\t\t\t\t\ticon: 'bot',\n\t\t\t\t\t\t\ttype: 'openPreBuiltAgentsCollection',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\tpromptTypeOptions,\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['auto'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 2.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...getToolsAgentProperties({ withStreaming: true }),\n\t\t\t],\n\t\t\thints: [\n\t\t\t\t{\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'You are using streaming responses. Make sure to set the response mode to \"Streaming Response\" on the connected trigger node.',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\t\tdisplayCondition: '={{ $parameter[\"enableStreaming\"] === true }}',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\treturn await toolsAgentExecute.call(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AASpC,0BAKO;AAEP,yBAAwC;AACxC,qBAAkC;AAClC,mBAA0B;AAEnB,MAAM,QAA6B;AAAA,EAGzC,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,GAAG,KAAK,GAAG;AAAA,MACrB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA;AAAA,UAEC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,eAAe;AAAA,cACd,OAAO;AAAA,cACP,MAAM;AAAA,cACN,MAAM;AAAA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OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA,UACD,MAAM;AAAA,UACN,UAAU;AAAA,UACV,eAAe;AAAA,UACf,kBAAkB;AAAA,QACnB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,UAAkE;AACvE,WAAO,MAAM,iCAAkB,KAAK,IAAI;AAAA,EACzC;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/agents/Agent/V2/AgentV2.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { getToolsAgentProperties } from '../agents/ToolsAgent/V2/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V2/execute';\nimport { getInputs } from '../utils';\n\nexport class AgentV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [2, 2.1, 2.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(true, hasOutputParser, needsFallback);\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/workflows/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased\n\t\t\t\t\tdisplayName: 'Get started faster with our',\n\t\t\t\t\tname: 'preBuiltAgentsCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\tcalloutAction: {\n\t\t\t\t\t\t\tlabel: 'pre-built agents',\n\t\t\t\t\t\t\ticon: 'bot',\n\t\t\t\t\t\t\ttype: 'openPreBuiltAgentsCollection',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\tpromptTypeOptionsDeprecated,\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['auto'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 2.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...getToolsAgentProperties({ withStreaming: true }),\n\t\t\t],\n\t\t\thints: [\n\t\t\t\t{\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'You are using streaming responses. Make sure to set the response mode to \"Streaming Response\" on the connected trigger node.',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\t\tdisplayCondition: '={{ $parameter[\"enableStreaming\"] === true }}',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\treturn await toolsAgentExecute.call(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AASpC,0BAKO;AAEP,yBAAwC;AACxC,qBAAkC;AAClC,mBAA0B;AAEnB,MAAM,QAA6B;AAAA,EAGzC,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,GAAG,KAAK,GAAG;AAAA,MACrB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA;AAAA,UAEC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,eAAe;AAAA,cACd,OAAO;AAAA,cACP,MAAM;AAAA,cACN,MAAM;AAAA,YACP;AAAA,UACD;AAAA,UACA,SAAS;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,YAAY;AAAA,YAC1B;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,MAAM;AAAA,YACpB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,QAAQ;AAAA,YACtB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,UAC7I,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,iBAAiB,CAAC,IAAI;AAAA,YACvB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,UAClB,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,YACpC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,eAAe,CAAC,IAAI;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA,OAAG,4CAAwB,EAAE,eAAe,KAAK,CAAC;AAAA,MACnD;AAAA,MACA,OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA,UACD,MAAM;AAAA,UACN,UAAU;AAAA,UACV,eAAe;AAAA,UACf,kBAAkB;AAAA,QACnB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,UAAkE;AACvE,WAAO,MAAM,iCAAkB,KAAK,IAAI;AAAA,EACzC;AACD;","names":[]}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var AgentToolV3_node_exports = {};
20
+ __export(AgentToolV3_node_exports, {
21
+ AgentToolV3: () => AgentToolV3
22
+ });
23
+ module.exports = __toCommonJS(AgentToolV3_node_exports);
24
+ var import_n8n_workflow = require("n8n-workflow");
25
+ var import_descriptions = require("../../../../utils/descriptions");
26
+ var import_utils = require("../utils");
27
+ var import_description = require("../agents/ToolsAgent/V3/description");
28
+ var import_execute = require("../agents/ToolsAgent/V3/execute");
29
+ class AgentToolV3 {
30
+ constructor(baseDescription) {
31
+ this.description = {
32
+ ...baseDescription,
33
+ version: [3],
34
+ defaults: {
35
+ name: "AI Agent Tool",
36
+ color: "#404040"
37
+ },
38
+ inputs: `={{
39
+ ((hasOutputParser, needsFallback) => {
40
+ ${import_utils.getInputs.toString()};
41
+ return getInputs(false, hasOutputParser, needsFallback)
42
+ })($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)
43
+ }}`,
44
+ outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool],
45
+ properties: [
46
+ import_descriptions.toolDescription,
47
+ {
48
+ ...import_descriptions.textInput
49
+ },
50
+ {
51
+ displayName: "Require Specific Output Format",
52
+ name: "hasOutputParser",
53
+ type: "boolean",
54
+ default: false,
55
+ noDataExpression: true
56
+ },
57
+ {
58
+ displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${import_n8n_workflow.NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,
59
+ name: "notice",
60
+ type: "notice",
61
+ default: "",
62
+ displayOptions: {
63
+ show: {
64
+ hasOutputParser: [true]
65
+ }
66
+ }
67
+ },
68
+ {
69
+ displayName: "Enable Fallback Model",
70
+ name: "needsFallback",
71
+ type: "boolean",
72
+ default: false,
73
+ noDataExpression: true
74
+ },
75
+ {
76
+ displayName: "Connect an additional language model on the canvas to use it as a fallback if the main model fails",
77
+ name: "fallbackNotice",
78
+ type: "notice",
79
+ default: "",
80
+ displayOptions: {
81
+ show: {
82
+ needsFallback: [true]
83
+ }
84
+ }
85
+ },
86
+ import_description.toolsAgentProperties
87
+ ]
88
+ };
89
+ }
90
+ // Automatically wrapped as a tool
91
+ async execute(response) {
92
+ return await import_execute.toolsAgentExecute.call(this, response);
93
+ }
94
+ }
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = {
97
+ AgentToolV3
98
+ });
99
+ //# sourceMappingURL=AgentToolV3.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/agents/Agent/V3/AgentToolV3.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n\tISupplyDataFunctions,\n\tEngineResponse,\n\tEngineRequest,\n} from 'n8n-workflow';\n\nimport { textInput, toolDescription } from '@utils/descriptions';\n\nimport { getInputs } from '../utils';\nimport { toolsAgentProperties } from '../agents/ToolsAgent/V3/description';\nimport type { RequestResponseMetadata } from '../agents/ToolsAgent/V3/execute';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V3/execute';\n\nexport class AgentToolV3 implements INodeType {\n\tdescription: INodeTypeDescription;\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [3],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent Tool',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(false, hasOutputParser, needsFallback)\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.AiTool],\n\t\t\tproperties: [\n\t\t\t\ttoolDescription,\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttoolsAgentProperties,\n\t\t\t],\n\t\t};\n\t}\n\n\t// Automatically wrapped as a tool\n\tasync execute(\n\t\tthis: IExecuteFunctions | ISupplyDataFunctions,\n\t\tresponse?: EngineResponse<RequestResponseMetadata>,\n\t): Promise<INodeExecutionData[][] | EngineRequest<RequestResponseMetadata>> {\n\t\treturn await toolsAgentExecute.call(this, response);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AAYpC,0BAA2C;AAE3C,mBAA0B;AAC1B,yBAAqC;AAErC,qBAAkC;AAE3B,MAAM,YAAiC;AAAA,EAE7C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,CAAC;AAAA,MACX,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,MAAM;AAAA,MACpC,YAAY;AAAA,QACX;AAAA,QACA;AAAA,UACC,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,UAC7I,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,iBAAiB,CAAC,IAAI;AAAA,YACvB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,eAAe,CAAC,IAAI;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA;AAAA,EAGA,MAAM,QAEL,UAC2E;AAC3E,WAAO,MAAM,iCAAkB,KAAK,MAAM,QAAQ;AAAA,EACnD;AACD;","names":[]}
@@ -30,7 +30,7 @@ class AgentV3 {
30
30
  constructor(baseDescription) {
31
31
  this.description = {
32
32
  ...baseDescription,
33
- version: [3],
33
+ version: [3, 3.1],
34
34
  defaults: {
35
35
  name: "AI Agent",
36
36
  color: "#404040"
@@ -49,7 +49,14 @@ class AgentV3 {
49
49
  type: "callout",
50
50
  default: ""
51
51
  },
52
- import_descriptions.promptTypeOptions,
52
+ {
53
+ ...import_descriptions.promptTypeOptionsDeprecated,
54
+ displayOptions: { show: { "@version": [{ _cnd: { lt: 3.1 } }] } }
55
+ },
56
+ {
57
+ ...import_descriptions.promptTypeOptions,
58
+ displayOptions: { show: { "@version": [{ _cnd: { gte: 3.1 } }] } }
59
+ },
53
60
  {
54
61
  ...import_descriptions.textFromGuardrailsNode,
55
62
  displayOptions: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/agents/Agent/V3/AgentV3.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n\tEngineResponse,\n\tEngineRequest,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { toolsAgentProperties } from '../agents/ToolsAgent/V3/description';\nimport type { RequestResponseMetadata } from '../agents/ToolsAgent/V3/execute';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V3/execute';\nimport { getInputs } from '../utils';\n\nexport class AgentV3 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [3],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(true, hasOutputParser, needsFallback);\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/workflows/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\tpromptTypeOptions,\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['auto'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttoolsAgentProperties,\n\t\t\t],\n\t\t\thints: [\n\t\t\t\t{\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'You are using streaming responses. Make sure to set the response mode to \"Streaming Response\" on the connected trigger node.',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\t\tdisplayCondition: '={{ $parameter[\"enableStreaming\"] === true }}',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(\n\t\tthis: IExecuteFunctions,\n\t\tresponse?: EngineResponse<RequestResponseMetadata>,\n\t): Promise<INodeExecutionData[][] | EngineRequest<RequestResponseMetadata>> {\n\t\treturn await toolsAgentExecute.call(this, response);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AAWpC,0BAKO;AAEP,yBAAqC;AAErC,qBAAkC;AAClC,mBAA0B;AAEnB,MAAM,QAA6B;AAAA,EAGzC,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,CAAC;AAAA,MACX,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,YAAY;AAAA,YAC1B;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,MAAM;AAAA,YACpB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,QAAQ;AAAA,YACtB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,UAC7I,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,iBAAiB,CAAC,IAAI;AAAA,YACvB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,eAAe,CAAC,IAAI;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,MACA,OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA,UACD,MAAM;AAAA,UACN,UAAU;AAAA,UACV,eAAe;AAAA,UACf,kBAAkB;AAAA,QACnB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,QAEL,UAC2E;AAC3E,WAAO,MAAM,iCAAkB,KAAK,MAAM,QAAQ;AAAA,EACnD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/agents/Agent/V3/AgentV3.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n\tEngineResponse,\n\tEngineRequest,\n} from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { toolsAgentProperties } from '../agents/ToolsAgent/V3/description';\nimport type { RequestResponseMetadata } from '../agents/ToolsAgent/V3/execute';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V3/execute';\nimport { getInputs } from '../utils';\n\nexport class AgentV3 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [3, 3.1],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(true, hasOutputParser, needsFallback);\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/workflows/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...promptTypeOptionsDeprecated,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { lt: 3.1 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...promptTypeOptions,\n\t\t\t\t\tdisplayOptions: { show: { '@version': [{ _cnd: { gte: 3.1 } }] } },\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromGuardrailsNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['auto'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttoolsAgentProperties,\n\t\t\t],\n\t\t\thints: [\n\t\t\t\t{\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'You are using streaming responses. Make sure to set the response mode to \"Streaming Response\" on the connected trigger node.',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\t\tdisplayCondition: '={{ $parameter[\"enableStreaming\"] === true }}',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(\n\t\tthis: IExecuteFunctions,\n\t\tresponse?: EngineResponse<RequestResponseMetadata>,\n\t): Promise<INodeExecutionData[][] | EngineRequest<RequestResponseMetadata>> {\n\t\treturn await toolsAgentExecute.call(this, response);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AAWpC,0BAMO;AAEP,yBAAqC;AAErC,qBAAkC;AAClC,mBAA0B;AAEnB,MAAM,QAA6B;AAAA,EAGzC,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,GAAG,GAAG;AAAA,MAChB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB,EAAE,MAAM,EAAE,YAAY,CAAC,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A,QACN;AAAA,UACC,SACC;AAAA,UACD,MAAM;AAAA,UACN,UAAU;AAAA,UACV,eAAe;AAAA,UACf,kBAAkB;AAAA,QACnB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,QAEL,UAC2E;AAC3E,WAAO,MAAM,iCAAkB,KAAK,MAAM,QAAQ;AAAA,EACnD;AACD;","names":[]}
@@ -122,7 +122,7 @@ const sqlAgentAgentProperties = [
122
122
  }
123
123
  },
124
124
  {
125
- ...import_descriptions.promptTypeOptions,
125
+ ...import_descriptions.promptTypeOptionsDeprecated,
126
126
  displayOptions: {
127
127
  hide: {
128
128
  "@version": [{ _cnd: { lte: 1.2 } }]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../nodes/agents/Agent/agents/SqlAgent/description.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { SQL_PREFIX, SQL_SUFFIX } from './other/prompts';\n\nconst dataSourceOptions: INodeProperties = {\n\tdisplayName: 'Data Source',\n\tname: 'dataSource',\n\ttype: 'options',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\tagent: ['sqlAgent'],\n\t\t},\n\t},\n\tdefault: 'sqlite',\n\tdescription: 'SQL database to connect to',\n\toptions: [\n\t\t{\n\t\t\tname: 'MySQL',\n\t\t\tvalue: 'mysql',\n\t\t\tdescription: 'Connect to a MySQL database',\n\t\t},\n\t\t{\n\t\t\tname: 'Postgres',\n\t\t\tvalue: 'postgres',\n\t\t\tdescription: 'Connect to a Postgres database',\n\t\t},\n\t\t{\n\t\t\tname: 'SQLite',\n\t\t\tvalue: 'sqlite',\n\t\t\tdescription: 'Use SQLite by connecting a database file as binary input',\n\t\t},\n\t],\n};\n\nexport const sqlAgentAgentProperties: INodeProperties[] = [\n\t{\n\t\t...dataSourceOptions,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { lt: 1.4 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...dataSourceOptions,\n\t\tdefault: 'postgres',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { gte: 1.4 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Credentials',\n\t\tname: 'credentials',\n\t\ttype: 'credentials',\n\t\tdefault: '',\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t\"Pass the SQLite database into this node as binary data, e.g. by inserting a 'Read/Write Files from Disk' node beforehand\",\n\t\tname: 'sqLiteFileNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\tdataSource: ['sqlite'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Input Binary Field',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\trequired: true,\n\t\tplaceholder: 'e.g data',\n\t\thint: 'The name of the input binary field containing the file to be extracted',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\tdataSource: ['sqlite'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'input',\n\t\ttype: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\trequired: true,\n\t\ttypeOptions: {\n\t\t\trows: 5,\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptions,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t},\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromGuardrailsNode,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: {\n\t\t\tshow: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.7 } }], agent: ['sqlAgent'] },\n\t\t},\n\t},\n\t{\n\t\t...textInput,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add Option',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Ignored Tables',\n\t\t\t\tname: 'ignoredTables',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated list of tables to ignore from the database. If empty, no tables are ignored.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Sample Rows',\n\t\t\t\tname: 'includedSampleRows',\n\t\t\t\ttype: 'number',\n\t\t\t\tdescription:\n\t\t\t\t\t'Number of sample rows to include in the prompt to the agent. It helps the agent to understand the schema of the database but it also increases the amount of tokens used.',\n\t\t\t\tdefault: 3,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Included Tables',\n\t\t\t\tname: 'includedTables',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated list of tables to include in the database. If empty, all tables are included.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Prefix Prompt',\n\t\t\t\tname: 'prefixPrompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: SQL_PREFIX,\n\t\t\t\tdescription: 'Prefix prompt to use for the agent',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Suffix Prompt',\n\t\t\t\tname: 'suffixPrompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: SQL_SUFFIX,\n\t\t\t\tdescription: 'Suffix prompt to use for the agent',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit',\n\t\t\t\tname: 'topK',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 10,\n\t\t\t\tdescription: 'The maximum number of results to return',\n\t\t\t},\n\t\t],\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAKO;AAEP,qBAAuC;AAEvC,MAAM,oBAAqC;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,gBAAgB;AAAA,IACf,MAAM;AAAA,MACL,OAAO,CAAC,UAAU;AAAA,IACnB;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,EACD;AACD;AAEO,MAAM,0BAA6C;AAAA,E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AA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../../nodes/agents/Agent/agents/SqlAgent/description.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n\ttextInput,\n} from '@utils/descriptions';\n\nimport { SQL_PREFIX, SQL_SUFFIX } from './other/prompts';\n\nconst dataSourceOptions: INodeProperties = {\n\tdisplayName: 'Data Source',\n\tname: 'dataSource',\n\ttype: 'options',\n\tdisplayOptions: {\n\t\tshow: {\n\t\t\tagent: ['sqlAgent'],\n\t\t},\n\t},\n\tdefault: 'sqlite',\n\tdescription: 'SQL database to connect to',\n\toptions: [\n\t\t{\n\t\t\tname: 'MySQL',\n\t\t\tvalue: 'mysql',\n\t\t\tdescription: 'Connect to a MySQL database',\n\t\t},\n\t\t{\n\t\t\tname: 'Postgres',\n\t\t\tvalue: 'postgres',\n\t\t\tdescription: 'Connect to a Postgres database',\n\t\t},\n\t\t{\n\t\t\tname: 'SQLite',\n\t\t\tvalue: 'sqlite',\n\t\t\tdescription: 'Use SQLite by connecting a database file as binary input',\n\t\t},\n\t],\n};\n\nexport const sqlAgentAgentProperties: INodeProperties[] = [\n\t{\n\t\t...dataSourceOptions,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { lt: 1.4 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...dataSourceOptions,\n\t\tdefault: 'postgres',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { gte: 1.4 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Credentials',\n\t\tname: 'credentials',\n\t\ttype: 'credentials',\n\t\tdefault: '',\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t\"Pass the SQLite database into this node as binary data, e.g. by inserting a 'Read/Write Files from Disk' node beforehand\",\n\t\tname: 'sqLiteFileNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\tdataSource: ['sqlite'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Input Binary Field',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\trequired: true,\n\t\tplaceholder: 'e.g data',\n\t\thint: 'The name of the input binary field containing the file to be extracted',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\tdataSource: ['sqlite'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'input',\n\t\ttype: 'string',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t},\n\t\t},\n\t\tdefault: '',\n\t\trequired: true,\n\t\ttypeOptions: {\n\t\t\trows: 5,\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptionsDeprecated,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t},\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromGuardrailsNode,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['guardrails'],\n\t\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: {\n\t\t\tshow: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.7 } }], agent: ['sqlAgent'] },\n\t\t},\n\t},\n\t{\n\t\t...textInput,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tagent: ['sqlAgent'],\n\t\t\t},\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add Option',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Ignored Tables',\n\t\t\t\tname: 'ignoredTables',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated list of tables to ignore from the database. If empty, no tables are ignored.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Sample Rows',\n\t\t\t\tname: 'includedSampleRows',\n\t\t\t\ttype: 'number',\n\t\t\t\tdescription:\n\t\t\t\t\t'Number of sample rows to include in the prompt to the agent. It helps the agent to understand the schema of the database but it also increases the amount of tokens used.',\n\t\t\t\tdefault: 3,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Included Tables',\n\t\t\t\tname: 'includedTables',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Comma-separated list of tables to include in the database. If empty, all tables are included.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Prefix Prompt',\n\t\t\t\tname: 'prefixPrompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: SQL_PREFIX,\n\t\t\t\tdescription: 'Prefix prompt to use for the agent',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Suffix Prompt',\n\t\t\t\tname: 'suffixPrompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: SQL_SUFFIX,\n\t\t\t\tdescription: 'Suffix prompt to use for the agent',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit',\n\t\t\t\tname: 'topK',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 10,\n\t\t\t\tdescription: 'The maximum number of results to return',\n\t\t\t},\n\t\t],\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAKO;AAEP,qBAAuC;AAEvC,MAAM,oBAAqC;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,gBAAgB;AAAA,IACf,MAAM;AAAA,MACL,OAAO,CAAC,UAAU;AAAA,IACnB;AAAA,EACD;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,IACR;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACd;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAA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SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aACC;AAAA,QACD,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,MAAM;AAAA,QACP;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -25,10 +25,8 @@ var import_n8n_workflow = require("n8n-workflow");
25
25
  var import_helpers = require("./helpers");
26
26
  async function toolsAgentExecute(response) {
27
27
  this.logger.debug("Executing Tools Agent V3");
28
- const maxIterations = this.getNodeParameter("options.maxIterations", 0, 10);
29
- (0, import_helpers.checkMaxIterations)(response, maxIterations, this.getNode());
30
- const returnData = [];
31
28
  let request = void 0;
29
+ const returnData = [];
32
30
  const executionContext = await (0, import_helpers.buildExecutionContext)(this);
33
31
  const { items, batchSize, delayBetweenBatches, model, fallbackModel, memory } = executionContext;
34
32
  for (let i = 0; i < items.length; i += batchSize) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V3/execute.ts"],"sourcesContent":["import { sleep } from 'n8n-workflow';\nimport type {\n\tEngineRequest,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tISupplyDataFunctions,\n\tEngineResponse,\n} from 'n8n-workflow';\n\nimport { buildExecutionContext, executeBatch, checkMaxIterations } from './helpers';\nimport type { RequestResponseMetadata } from './types';\n\n/* -----------------------------------------------------------\n Main Executor Function\n----------------------------------------------------------- */\n/**\n * The main executor method for the Tools Agent V3.\n *\n * This function orchestrates the execution across input batches, handling:\n * - Building shared execution context (models, memory, batching config)\n * - Processing items in batches with continue-on-fail logic\n * - Returning either tool call requests or node output data\n *\n * @param this Execute context. SupplyDataContext is passed when agent is used as a tool\n * @param response Optional engine response containing tool call results from previous execution\n * @returns Array of execution data for all processed items, or engine request for tool calls\n */\nexport async function toolsAgentExecute(\n\tthis: IExecuteFunctions | ISupplyDataFunctions,\n\tresponse?: EngineResponse<RequestResponseMetadata>,\n): Promise<INodeExecutionData[][] | EngineRequest<RequestResponseMetadata>> {\n\tthis.logger.debug('Executing Tools Agent V3');\n\n\t// Check max iterations if this is a continuation of a previous execution\n\tconst maxIterations = this.getNodeParameter('options.maxIterations', 0, 10) as number;\n\tcheckMaxIterations(response, maxIterations, this.getNode());\n\n\tconst returnData: INodeExecutionData[] = [];\n\tlet request: EngineRequest<RequestResponseMetadata> | undefined = undefined;\n\n\t// Build execution context with shared configuration\n\tconst executionContext = await buildExecutionContext(this);\n\tconst { items, batchSize, delayBetweenBatches, model, fallbackModel, memory } = executionContext;\n\n\t// Process items in batches\n\tfor (let i = 0; i < items.length; i += batchSize) {\n\t\tconst batch = items.slice(i, i + batchSize);\n\n\t\tconst { returnData: batchReturnData, request: batchRequest } = await executeBatch(\n\t\t\tthis,\n\t\t\tbatch,\n\t\t\ti,\n\t\t\tmodel,\n\t\t\tfallbackModel,\n\t\t\tmemory,\n\t\t\tresponse,\n\t\t);\n\n\t\t// Collect results from batch\n\t\treturnData.push.apply(returnData, batchReturnData);\n\n\t\t// Collect requests from batch\n\t\tif (batchRequest) {\n\t\t\tif (!request) {\n\t\t\t\trequest = batchRequest;\n\t\t\t} else {\n\t\t\t\trequest.actions.push.apply(request.actions, batchRequest.actions);\n\t\t\t}\n\t\t}\n\n\t\t// Apply delay between batches if configured\n\t\tif (i + batchSize < items.length && delayBetweenBatches > 0) {\n\t\t\tawait sleep(delayBetweenBatches);\n\t\t}\n\t}\n\n\t// Return tool call request if any tools need to be executed\n\tif (request) {\n\t\treturn request;\n\t}\n\n\t// Otherwise return execution data\n\treturn [returnData];\n}\n\n// Re-export types for backwards compatibility\nexport type { RequestResponseMetadata } from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAsB;AAStB,qBAAwE;AAkBxE,eAAsB,kBAErB,UAC2E;AAC3E,OAAK,OAAO,MAAM,0BAA0B;AAG5C,QAAM,gBAAgB,KAAK,iBAAiB,yBAAyB,GAAG,EAAE;AAC1E,yCAAmB,UAAU,eAAe,KAAK,QAAQ,CAAC;AAE1D,QAAM,aAAmC,CAAC;AAC1C,MAAI,UAA8D;AAGlE,QAAM,mBAAmB,UAAM,sCAAsB,IAAI;AACzD,QAAM,EAAE,OAAO,WAAW,qBAAqB,OAAO,eAAe,OAAO,IAAI;AAGhF,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,WAAW;AACjD,UAAM,QAAQ,MAAM,MAAM,GAAG,IAAI,SAAS;AAE1C,UAAM,EAAE,YAAY,iBAAiB,SAAS,aAAa,IAAI,UAAM;AAAA,MACpE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAGA,eAAW,KAAK,MAAM,YAAY,eAAe;AAGjD,QAAI,cAAc;AACjB,UAAI,CAAC,SAAS;AACb,kBAAU;AAAA,MACX,OAAO;AACN,gBAAQ,QAAQ,KAAK,MAAM,QAAQ,SAAS,aAAa,OAAO;AAAA,MACjE;AAAA,IACD;AAGA,QAAI,IAAI,YAAY,MAAM,UAAU,sBAAsB,GAAG;AAC5D,gBAAM,2BAAM,mBAAmB;AAAA,IAChC;AAAA,EACD;AAGA,MAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAGA,SAAO,CAAC,UAAU;AACnB;","names":[]}
1
+ {"version":3,"sources":["../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V3/execute.ts"],"sourcesContent":["import { sleep } from 'n8n-workflow';\nimport type {\n\tEngineRequest,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tISupplyDataFunctions,\n\tEngineResponse,\n} from 'n8n-workflow';\n\nimport { buildExecutionContext, executeBatch } from './helpers';\nimport type { RequestResponseMetadata } from './types';\n\n/* -----------------------------------------------------------\n Main Executor Function\n----------------------------------------------------------- */\n/**\n * The main executor method for the Tools Agent V3.\n *\n * This function orchestrates the execution across input batches, handling:\n * - Building shared execution context (models, memory, batching config)\n * - Processing items in batches with continue-on-fail logic\n * - Returning either tool call requests or node output data\n *\n * @param this Execute context. SupplyDataContext is passed when agent is used as a tool\n * @param response Optional engine response containing tool call results from previous execution\n * @returns Array of execution data for all processed items, or engine request for tool calls\n */\nexport async function toolsAgentExecute(\n\tthis: IExecuteFunctions | ISupplyDataFunctions,\n\tresponse?: EngineResponse<RequestResponseMetadata>,\n): Promise<INodeExecutionData[][] | EngineRequest<RequestResponseMetadata>> {\n\tthis.logger.debug('Executing Tools Agent V3');\n\n\tlet request: EngineRequest<RequestResponseMetadata> | undefined = undefined;\n\n\tconst returnData: INodeExecutionData[] = [];\n\n\t// Build execution context with shared configuration\n\tconst executionContext = await buildExecutionContext(this);\n\tconst { items, batchSize, delayBetweenBatches, model, fallbackModel, memory } = executionContext;\n\n\t// Process items in batches\n\tfor (let i = 0; i < items.length; i += batchSize) {\n\t\tconst batch = items.slice(i, i + batchSize);\n\n\t\tconst { returnData: batchReturnData, request: batchRequest } = await executeBatch(\n\t\t\tthis,\n\t\t\tbatch,\n\t\t\ti,\n\t\t\tmodel,\n\t\t\tfallbackModel,\n\t\t\tmemory,\n\t\t\tresponse,\n\t\t);\n\n\t\t// Collect results from batch\n\t\treturnData.push.apply(returnData, batchReturnData);\n\n\t\t// Collect requests from batch\n\t\tif (batchRequest) {\n\t\t\tif (!request) {\n\t\t\t\trequest = batchRequest;\n\t\t\t} else {\n\t\t\t\trequest.actions.push.apply(request.actions, batchRequest.actions);\n\t\t\t}\n\t\t}\n\n\t\t// Apply delay between batches if configured\n\t\tif (i + batchSize < items.length && delayBetweenBatches > 0) {\n\t\t\tawait sleep(delayBetweenBatches);\n\t\t}\n\t}\n\n\t// Return tool call request if any tools need to be executed\n\tif (request) {\n\t\treturn request;\n\t}\n\n\t// Otherwise return execution data\n\treturn [returnData];\n}\n\n// Re-export types for backwards compatibility\nexport type { RequestResponseMetadata } from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAsB;AAStB,qBAAoD;AAkBpD,eAAsB,kBAErB,UAC2E;AAC3E,OAAK,OAAO,MAAM,0BAA0B;AAE5C,MAAI,UAA8D;AAElE,QAAM,aAAmC,CAAC;AAG1C,QAAM,mBAAmB,UAAM,sCAAsB,IAAI;AACzD,QAAM,EAAE,OAAO,WAAW,qBAAqB,OAAO,eAAe,OAAO,IAAI;AAGhF,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,WAAW;AACjD,UAAM,QAAQ,MAAM,MAAM,GAAG,IAAI,SAAS;AAE1C,UAAM,EAAE,YAAY,iBAAiB,SAAS,aAAa,IAAI,UAAM;AAAA,MACpE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAGA,eAAW,KAAK,MAAM,YAAY,eAAe;AAGjD,QAAI,cAAc;AACjB,UAAI,CAAC,SAAS;AACb,kBAAU;AAAA,MACX,OAAO;AACN,gBAAQ,QAAQ,KAAK,MAAM,QAAQ,SAAS,aAAa,OAAO;AAAA,MACjE;AAAA,IACD;AAGA,QAAI,IAAI,YAAY,MAAM,UAAU,sBAAsB,GAAG;AAC5D,gBAAM,2BAAM,mBAAmB;AAAA,IAChC;AAAA,EACD;AAGA,MAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAGA,SAAO,CAAC,UAAU;AACnB;","names":[]}
@@ -27,11 +27,15 @@ var import_createAgentSequence = require("./createAgentSequence");
27
27
  var import_finalizeResult = require("./finalizeResult");
28
28
  var import_prepareItemContext = require("./prepareItemContext");
29
29
  var import_runAgent = require("./runAgent");
30
+ var import_checkMaxIterations = require("./checkMaxIterations");
30
31
  async function executeBatch(ctx, batch, startIndex, model, fallbackModel, memory, response) {
31
32
  const returnData = [];
32
33
  let request = void 0;
34
+ const maxIterations = ctx.getNodeParameter("options.maxIterations", 0, 10);
35
+ (0, import_n8n_workflow.assertParamIsNumber)("options.maxIterations", maxIterations, ctx.getNode());
33
36
  const batchPromises = batch.map(async (_item, batchItemIndex) => {
34
37
  const itemIndex = startIndex + batchItemIndex;
38
+ (0, import_checkMaxIterations.checkMaxIterations)(response, maxIterations, ctx.getNode());
35
39
  const itemContext = await (0, import_prepareItemContext.prepareItemContext)(ctx, itemIndex, response);
36
40
  const { tools, prompt, options, outputParser: outputParser2 } = itemContext;
37
41
  const executor = (0, import_createAgentSequence.createAgentSequence)(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.ts"],"sourcesContent":["import type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { AgentRunnableSequence } from '@langchain/classic/agents';\nimport type { BaseChatMemory } from '@langchain/classic/memory';\nimport { NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tISupplyDataFunctions,\n\tINodeExecutionData,\n\tEngineResponse,\n\tEngineRequest,\n} from 'n8n-workflow';\n\nimport { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser';\n\nimport type { RequestResponseMetadata, AgentResult } from '../types';\nimport { createAgentSequence } from './createAgentSequence';\nimport { finalizeResult } from './finalizeResult';\nimport { prepareItemContext } from './prepareItemContext';\nimport { runAgent } from './runAgent';\n\ntype BatchResult = AgentResult | EngineRequest<RequestResponseMetadata>;\n/**\n * Executes a batch of items, handling both successful execution and errors.\n * Applies continue-on-fail logic when errors occur.\n *\n * @param ctx - The execution context\n * @param batch - Array of items to process in this batch\n * @param startIndex - Starting index of the batch in the original items array (used to calculate itemIndex)\n * @param model - Primary chat model\n * @param fallbackModel - Optional fallback model\n * @param memory - Optional memory for conversation context\n * @param response - Optional engine response with previous tool calls\n * @returns Object containing execution data and optional requests\n */\nexport async function executeBatch(\n\tctx: IExecuteFunctions | ISupplyDataFunctions,\n\tbatch: INodeExecutionData[],\n\tstartIndex: number,\n\tmodel: BaseChatModel,\n\tfallbackModel: BaseChatModel | null,\n\tmemory: BaseChatMemory | undefined,\n\tresponse?: EngineResponse<RequestResponseMetadata>,\n): Promise<{\n\treturnData: INodeExecutionData[];\n\trequest: EngineRequest<RequestResponseMetadata> | undefined;\n}> {\n\tconst returnData: INodeExecutionData[] = [];\n\tlet request: EngineRequest<RequestResponseMetadata> | undefined = undefined;\n\n\tconst batchPromises = batch.map(async (_item, batchItemIndex) => {\n\t\tconst itemIndex = startIndex + batchItemIndex;\n\n\t\tconst itemContext = await prepareItemContext(ctx, itemIndex, response);\n\n\t\tconst { tools, prompt, options, outputParser } = itemContext;\n\n\t\t// Create executors for primary and fallback models\n\t\tconst executor: AgentRunnableSequence = createAgentSequence(\n\t\t\tmodel,\n\t\t\ttools,\n\t\t\tprompt,\n\t\t\toptions,\n\t\t\toutputParser,\n\t\t\tmemory,\n\t\t\tfallbackModel,\n\t\t);\n\n\t\t// Run the agent\n\t\treturn await runAgent(ctx, executor, itemContext, model, memory, response);\n\t});\n\n\tconst batchResults = await Promise.allSettled(batchPromises);\n\t// This is only used to check if the output parser is connected\n\t// so we can parse the output if needed. Actual output parsing is done in the loop above\n\tconst outputParser = await getOptionalOutputParser(ctx, 0);\n\n\tbatchResults.forEach((result, index) => {\n\t\tconst itemIndex = startIndex + index;\n\t\tif (result.status === 'rejected') {\n\t\t\tconst error = result.reason as Error;\n\t\t\tif (ctx.continueOnFail()) {\n\t\t\t\treturnData.push({\n\t\t\t\t\tjson: { error: error.message },\n\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t} as INodeExecutionData);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tthrow new NodeOperationError(ctx.getNode(), error);\n\t\t\t}\n\t\t}\n\t\tconst batchResult = result.value as BatchResult;\n\n\t\tif (!batchResult) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('actions' in batchResult) {\n\t\t\tif (!request) {\n\t\t\t\trequest = {\n\t\t\t\t\tactions: batchResult.actions,\n\t\t\t\t\tmetadata: batchResult.metadata,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\trequest.actions.push.apply(request.actions, batchResult.actions);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Finalize the result\n\t\tconst itemResult = finalizeResult(batchResult, itemIndex, memory, outputParser);\n\t\treturnData.push(itemResult);\n\t});\n\n\treturn { returnData, request };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAmC;AASnC,6BAAwC;AAGxC,iCAAoC;AACpC,4BAA+B;AAC/B,gCAAmC;AACnC,sBAAyB;AAgBzB,eAAsB,aACrB,KACA,OACA,YACA,OACA,eACA,QACA,UAIE;AACF,QAAM,aAAmC,CAAC;AAC1C,MAAI,UAA8D;AAElE,QAAM,gBAAgB,MAAM,IAAI,OAAO,OAAO,mBAAmB;AAChE,UAAM,YAAY,aAAa;AAE/B,UAAM,cAAc,UAAM,8CAAmB,KAAK,WAAW,QAAQ;AAErE,UAAM,EAAE,OAAO,QAAQ,SAAS,cAAAA,cAAa,IAAI;AAGjD,UAAM,eAAkC;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAGA,WAAO,UAAM,0BAAS,KAAK,UAAU,aAAa,OAAO,QAAQ,QAAQ;AAAA,EAC1E,CAAC;AAED,QAAM,eAAe,MAAM,QAAQ,WAAW,aAAa;AAG3D,QAAM,eAAe,UAAM,gDAAwB,KAAK,CAAC;AAEzD,eAAa,QAAQ,CAAC,QAAQ,UAAU;AACvC,UAAM,YAAY,aAAa;AAC/B,QAAI,OAAO,WAAW,YAAY;AACjC,YAAM,QAAQ,OAAO;AACrB,UAAI,IAAI,eAAe,GAAG;AACzB,mBAAW,KAAK;AAAA,UACf,MAAM,EAAE,OAAO,MAAM,QAAQ;AAAA,UAC7B,YAAY,EAAE,MAAM,UAAU;AAAA,QAC/B,CAAuB;AACvB;AAAA,MACD,OAAO;AACN,cAAM,IAAI,uCAAmB,IAAI,QAAQ,GAAG,KAAK;AAAA,MAClD;AAAA,IACD;AACA,UAAM,cAAc,OAAO;AAE3B,QAAI,CAAC,aAAa;AACjB;AAAA,IACD;AAEA,QAAI,aAAa,aAAa;AAC7B,UAAI,CAAC,SAAS;AACb,kBAAU;AAAA,UACT,SAAS,YAAY;AAAA,UACrB,UAAU,YAAY;AAAA,QACvB;AAAA,MACD,OAAO;AACN,gBAAQ,QAAQ,KAAK,MAAM,QAAQ,SAAS,YAAY,OAAO;AAAA,MAChE;AACA;AAAA,IACD;AAGA,UAAM,iBAAa,sCAAe,aAAa,WAAW,QAAQ,YAAY;AAC9E,eAAW,KAAK,UAAU;AAAA,EAC3B,CAAC;AAED,SAAO,EAAE,YAAY,QAAQ;AAC9B;","names":["outputParser"]}
1
+ {"version":3,"sources":["../../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.ts"],"sourcesContent":["import type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { AgentRunnableSequence } from '@langchain/classic/agents';\nimport type { BaseChatMemory } from '@langchain/classic/memory';\nimport { assertParamIsNumber, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tISupplyDataFunctions,\n\tINodeExecutionData,\n\tEngineResponse,\n\tEngineRequest,\n} from 'n8n-workflow';\n\nimport { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser';\n\nimport type { RequestResponseMetadata, AgentResult } from '../types';\nimport { createAgentSequence } from './createAgentSequence';\nimport { finalizeResult } from './finalizeResult';\nimport { prepareItemContext } from './prepareItemContext';\nimport { runAgent } from './runAgent';\nimport { checkMaxIterations } from './checkMaxIterations';\n\ntype BatchResult = AgentResult | EngineRequest<RequestResponseMetadata>;\n/**\n * Executes a batch of items, handling both successful execution and errors.\n * Applies continue-on-fail logic when errors occur.\n *\n * @param ctx - The execution context\n * @param batch - Array of items to process in this batch\n * @param startIndex - Starting index of the batch in the original items array (used to calculate itemIndex)\n * @param model - Primary chat model\n * @param fallbackModel - Optional fallback model\n * @param memory - Optional memory for conversation context\n * @param response - Optional engine response with previous tool calls\n * @returns Object containing execution data and optional requests\n */\nexport async function executeBatch(\n\tctx: IExecuteFunctions | ISupplyDataFunctions,\n\tbatch: INodeExecutionData[],\n\tstartIndex: number,\n\tmodel: BaseChatModel,\n\tfallbackModel: BaseChatModel | null,\n\tmemory: BaseChatMemory | undefined,\n\tresponse?: EngineResponse<RequestResponseMetadata>,\n): Promise<{\n\treturnData: INodeExecutionData[];\n\trequest: EngineRequest<RequestResponseMetadata> | undefined;\n}> {\n\tconst returnData: INodeExecutionData[] = [];\n\tlet request: EngineRequest<RequestResponseMetadata> | undefined = undefined;\n\n\t// Check max iterations if this is a continuation of a previous execution\n\tconst maxIterations = ctx.getNodeParameter('options.maxIterations', 0, 10);\n\tassertParamIsNumber('options.maxIterations', maxIterations, ctx.getNode());\n\n\tconst batchPromises = batch.map(async (_item, batchItemIndex) => {\n\t\tconst itemIndex = startIndex + batchItemIndex;\n\n\t\tcheckMaxIterations(response, maxIterations, ctx.getNode());\n\n\t\tconst itemContext = await prepareItemContext(ctx, itemIndex, response);\n\n\t\tconst { tools, prompt, options, outputParser } = itemContext;\n\n\t\t// Create executors for primary and fallback models\n\t\tconst executor: AgentRunnableSequence = createAgentSequence(\n\t\t\tmodel,\n\t\t\ttools,\n\t\t\tprompt,\n\t\t\toptions,\n\t\t\toutputParser,\n\t\t\tmemory,\n\t\t\tfallbackModel,\n\t\t);\n\n\t\t// Run the agent\n\t\treturn await runAgent(ctx, executor, itemContext, model, memory, response);\n\t});\n\n\tconst batchResults = await Promise.allSettled(batchPromises);\n\t// This is only used to check if the output parser is connected\n\t// so we can parse the output if needed. Actual output parsing is done in the loop above\n\tconst outputParser = await getOptionalOutputParser(ctx, 0);\n\n\tbatchResults.forEach((result, index) => {\n\t\tconst itemIndex = startIndex + index;\n\t\tif (result.status === 'rejected') {\n\t\t\tconst error = result.reason as Error;\n\t\t\tif (ctx.continueOnFail()) {\n\t\t\t\treturnData.push({\n\t\t\t\t\tjson: { error: error.message },\n\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t} as INodeExecutionData);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tthrow new NodeOperationError(ctx.getNode(), error);\n\t\t\t}\n\t\t}\n\t\tconst batchResult = result.value as BatchResult;\n\n\t\tif (!batchResult) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('actions' in batchResult) {\n\t\t\tif (!request) {\n\t\t\t\trequest = {\n\t\t\t\t\tactions: batchResult.actions,\n\t\t\t\t\tmetadata: batchResult.metadata,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\trequest.actions.push.apply(request.actions, batchResult.actions);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Finalize the result\n\t\tconst itemResult = finalizeResult(batchResult, itemIndex, memory, outputParser);\n\t\treturnData.push(itemResult);\n\t});\n\n\treturn { returnData, request };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAwD;AASxD,6BAAwC;AAGxC,iCAAoC;AACpC,4BAA+B;AAC/B,gCAAmC;AACnC,sBAAyB;AACzB,gCAAmC;AAgBnC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A,UACrB,UAAU,YAAY;AAAA,QACvB;AAAA,MACD,OAAO;AACN,gBAAQ,QAAQ,KAAK,MAAM,QAAQ,SAAS,YAAY,OAAO;AAAA,MAChE;AACA;AAAA,IACD;AAGA,UAAM,iBAAa,sCAAe,aAAa,WAAW,QAAQ,YAAY;AAC9E,eAAW,KAAK,UAAU;AAAA,EAC3B,CAAC;AAED,SAAO,EAAE,YAAY,QAAQ;AAC9B;","names":["outputParser"]}
@@ -34,7 +34,7 @@ class ChainLlm {
34
34
  icon: "fa:link",
35
35
  iconColor: "black",
36
36
  group: ["transform"],
37
- version: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7],
37
+ version: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8],
38
38
  description: "A simple chain to prompt a large language model",
39
39
  defaults: {
40
40
  name: "Basic LLM Chain",