@n8n/n8n-nodes-langchain 1.122.1 → 2.0.0-rc.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.
@@ -32,7 +32,8 @@ class McpOAuth2Api {
32
32
  displayName: "Use Dynamic Client Registration",
33
33
  name: "useDynamicClientRegistration",
34
34
  type: "boolean",
35
- default: true
35
+ default: true,
36
+ required: true
36
37
  }
37
38
  ];
38
39
  }
@@ -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},\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":[]}
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":[]}
@@ -27,6 +27,7 @@ var import_di = require("@n8n/di");
27
27
  var import_JavaScriptSandbox = require("n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox");
28
28
  var import_JsTaskRunnerSandbox = require("n8n-nodes-base/dist/nodes/Code/JsTaskRunnerSandbox");
29
29
  var import_PythonSandbox = require("n8n-nodes-base/dist/nodes/Code/PythonSandbox");
30
+ var import_PythonTaskRunnerSandbox = require("n8n-nodes-base/dist/nodes/Code/PythonTaskRunnerSandbox");
30
31
  var import_Sandbox = require("n8n-nodes-base/dist/nodes/Code/Sandbox");
31
32
  var import_n8n_workflow = require("n8n-workflow");
32
33
  var import_descriptions = require("../../../utils/descriptions");
@@ -46,7 +47,8 @@ function getTool(ctx, itemIndex, log = true) {
46
47
  const node = ctx.getNode();
47
48
  const workflowMode = ctx.getMode();
48
49
  const runnersConfig = import_di.Container.get(import_config.TaskRunnersConfig);
49
- const isRunnerEnabled = runnersConfig.enabled;
50
+ const isJsRunnerEnabled = runnersConfig.enabled;
51
+ const isPyRunnerEnabled = runnersConfig.isNativePythonRunnerEnabled;
50
52
  const { typeVersion } = node;
51
53
  const name = typeVersion <= 1.1 ? ctx.getNodeParameter("name", itemIndex) : (0, import_n8n_workflow.nodeNameToToolName)(node);
52
54
  const description = ctx.getNodeParameter("description", itemIndex);
@@ -74,7 +76,7 @@ function getTool(ctx, itemIndex, log = true) {
74
76
  return sandbox;
75
77
  };
76
78
  const runFunction = async (query) => {
77
- if (language === "javaScript" && isRunnerEnabled) {
79
+ if (language === "javaScript" && isJsRunnerEnabled) {
78
80
  const sandbox = new import_JsTaskRunnerSandbox.JsTaskRunnerSandbox(
79
81
  code,
80
82
  "runOnceForAllItems",
@@ -85,8 +87,18 @@ function getTool(ctx, itemIndex, log = true) {
85
87
  query
86
88
  }
87
89
  );
88
- const executionData = await sandbox.runCodeForTool();
89
- return executionData;
90
+ return await sandbox.runCodeForTool();
91
+ } else if (language === "python" && isPyRunnerEnabled) {
92
+ const sandbox = new import_PythonTaskRunnerSandbox.PythonTaskRunnerSandbox(
93
+ code,
94
+ "runOnceForAllItems",
95
+ workflowMode,
96
+ ctx,
97
+ {
98
+ query
99
+ }
100
+ );
101
+ return await sandbox.runCodeForTool();
90
102
  } else {
91
103
  const sandbox = getSandbox(query, itemIndex);
92
104
  return await sandbox.runCode();
@@ -270,9 +282,9 @@ class ToolCode {
270
282
  // TODO: create a separate `pythonEditor` component
271
283
  editorLanguage: "python"
272
284
  },
273
- default: "# Example: convert the incoming query to uppercase and return it\nreturn query.upper()",
285
+ default: "# Example: convert the incoming query to uppercase and return it\nreturn _query.upper()",
274
286
  // TODO: Add proper text here later
275
- hint: 'You can access the input the tool receives via the input property "query". The returned value should be a single string.',
287
+ hint: 'You can access the input the tool receives via the input property "_query". The returned value should be a single string.',
276
288
  // eslint-disable-next-line n8n-nodes-base/node-param-description-missing-final-period
277
289
  description: "E.g. Converts any text to uppercase",
278
290
  noDataExpression: true
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/tools/ToolCode/ToolCode.node.ts"],"sourcesContent":["import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools';\nimport { TaskRunnersConfig } from '@n8n/config';\nimport { Container } from '@n8n/di';\nimport type { JSONSchema7 } from 'json-schema';\nimport { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';\nimport { JsTaskRunnerSandbox } from 'n8n-nodes-base/dist/nodes/Code/JsTaskRunnerSandbox';\nimport { PythonSandbox } from 'n8n-nodes-base/dist/nodes/Code/PythonSandbox';\nimport type { Sandbox } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';\nimport { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';\nimport type {\n\tExecutionError,\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tISupplyDataFunctions,\n\tSupplyData,\n} from 'n8n-workflow';\nimport {\n\tjsonParse,\n\tNodeConnectionTypes,\n\tnodeNameToToolName,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport {\n\tbuildInputSchemaField,\n\tbuildJsonSchemaExampleField,\n\tbuildJsonSchemaExampleNotice,\n\tschemaTypeField,\n} from '@utils/descriptions';\nimport { convertJsonSchemaToZod, generateSchemaFromExample } from '@utils/schemaParsing';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport type { DynamicZodObject } from '../../../types/zod.types';\n\nconst jsonSchemaExampleField = buildJsonSchemaExampleField({\n\tshowExtraProps: { specifyInputSchema: [true] },\n});\n\nconst jsonSchemaExampleNotice = buildJsonSchemaExampleNotice({\n\tshowExtraProps: {\n\t\tspecifyInputSchema: [true],\n\t\t'@version': [{ _cnd: { gte: 1.3 } }],\n\t},\n});\n\nconst jsonSchemaField = buildInputSchemaField({ showExtraProps: { specifyInputSchema: [true] } });\n\nfunction getTool(\n\tctx: ISupplyDataFunctions | IExecuteFunctions,\n\titemIndex: number,\n\tlog: boolean = true,\n) {\n\tconst node = ctx.getNode();\n\tconst workflowMode = ctx.getMode();\n\n\tconst runnersConfig = Container.get(TaskRunnersConfig);\n\tconst isRunnerEnabled = runnersConfig.enabled;\n\n\tconst { typeVersion } = node;\n\tconst name =\n\t\ttypeVersion <= 1.1\n\t\t\t? (ctx.getNodeParameter('name', itemIndex) as string)\n\t\t\t: nodeNameToToolName(node);\n\n\tconst description = ctx.getNodeParameter('description', itemIndex) as string;\n\n\tconst useSchema = ctx.getNodeParameter('specifyInputSchema', itemIndex) as boolean;\n\n\tconst language = ctx.getNodeParameter('language', itemIndex) as string;\n\tlet code = '';\n\tif (language === 'javaScript') {\n\t\tcode = ctx.getNodeParameter('jsCode', itemIndex) as string;\n\t} else {\n\t\tcode = ctx.getNodeParameter('pythonCode', itemIndex) as string;\n\t}\n\n\t// @deprecated - TODO: Remove this after a new python runner is implemented\n\tconst getSandbox = (query: string | IDataObject, index = 0) => {\n\t\tconst context = getSandboxContext.call(ctx, index);\n\t\tcontext.query = query;\n\n\t\tlet sandbox: Sandbox;\n\t\tif (language === 'javaScript') {\n\t\t\tsandbox = new JavaScriptSandbox(context, code, ctx.helpers);\n\t\t} else {\n\t\t\tsandbox = new PythonSandbox(context, code, ctx.helpers);\n\t\t}\n\n\t\tsandbox.on(\n\t\t\t'output',\n\t\t\tworkflowMode === 'manual'\n\t\t\t\t? ctx.sendMessageToUI.bind(ctx)\n\t\t\t\t: (...args: unknown[]) =>\n\t\t\t\t\t\tconsole.log(`[Workflow \"${ctx.getWorkflow().id}\"][Node \"${node.name}\"]`, ...args),\n\t\t);\n\t\treturn sandbox;\n\t};\n\n\tconst runFunction = async (query: string | IDataObject): Promise<unknown> => {\n\t\tif (language === 'javaScript' && isRunnerEnabled) {\n\t\t\tconst sandbox = new JsTaskRunnerSandbox(\n\t\t\t\tcode,\n\t\t\t\t'runOnceForAllItems',\n\t\t\t\tworkflowMode,\n\t\t\t\tctx,\n\t\t\t\tundefined,\n\t\t\t\t{\n\t\t\t\t\tquery,\n\t\t\t\t},\n\t\t\t);\n\t\t\tconst executionData = await sandbox.runCodeForTool();\n\t\t\treturn executionData;\n\t\t} else {\n\t\t\t// use old vm2-based sandbox for python or when without runner enabled\n\t\t\tconst sandbox = getSandbox(query, itemIndex);\n\t\t\treturn await sandbox.runCode<string>();\n\t\t}\n\t};\n\n\tconst toolHandler = async (query: string | IDataObject): Promise<string> => {\n\t\tconst { index } = log\n\t\t\t? ctx.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]])\n\t\t\t: { index: 0 };\n\n\t\tlet response: any = '';\n\t\tlet executionError: ExecutionError | undefined;\n\t\ttry {\n\t\t\tresponse = await runFunction(query);\n\t\t} catch (error: unknown) {\n\t\t\texecutionError = new NodeOperationError(ctx.getNode(), error as ExecutionError);\n\t\t\tresponse = `There was an error: \"${executionError.message}\"`;\n\t\t}\n\n\t\tif (typeof response === 'number') {\n\t\t\tresponse = (response as number).toString();\n\t\t}\n\n\t\tif (typeof response !== 'string') {\n\t\t\t// TODO: Do some more testing. Issues here should actually fail the workflow\n\t\t\texecutionError = new NodeOperationError(ctx.getNode(), 'Wrong output type returned', {\n\t\t\t\tdescription: `The response property should be a string, but it is an ${typeof response}`,\n\t\t\t});\n\t\t\tresponse = `There was an error: \"${executionError.message}\"`;\n\t\t}\n\n\t\tif (executionError && log) {\n\t\t\tvoid ctx.addOutputData(NodeConnectionTypes.AiTool, index, executionError);\n\t\t} else if (log) {\n\t\t\tvoid ctx.addOutputData(NodeConnectionTypes.AiTool, index, [[{ json: { response } }]]);\n\t\t}\n\n\t\treturn response;\n\t};\n\n\tconst commonToolOptions = {\n\t\tname,\n\t\tdescription,\n\t\tfunc: toolHandler,\n\t};\n\n\tlet tool: DynamicTool | DynamicStructuredTool | undefined = undefined;\n\n\tif (useSchema) {\n\t\ttry {\n\t\t\t// We initialize these even though one of them will always be empty\n\t\t\t// it makes it easier to navigate the ternary operator\n\t\t\tconst jsonExample = ctx.getNodeParameter('jsonSchemaExample', itemIndex, '') as string;\n\t\t\tconst inputSchema = ctx.getNodeParameter('inputSchema', itemIndex, '') as string;\n\n\t\t\tconst schemaType = ctx.getNodeParameter('schemaType', itemIndex) as 'fromJson' | 'manual';\n\n\t\t\tconst jsonSchema =\n\t\t\t\tschemaType === 'fromJson'\n\t\t\t\t\t? generateSchemaFromExample(jsonExample, ctx.getNode().typeVersion >= 1.3)\n\t\t\t\t\t: jsonParse<JSONSchema7>(inputSchema);\n\n\t\t\tconst zodSchema = convertJsonSchemaToZod<DynamicZodObject>(jsonSchema);\n\n\t\t\ttool = new DynamicStructuredTool({\n\t\t\t\tschema: zodSchema,\n\t\t\t\t...commonToolOptions,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t'Error during parsing of JSON Schema. \\n ' + error,\n\t\t\t);\n\t\t}\n\t} else {\n\t\ttool = new DynamicTool(commonToolOptions);\n\t}\n\n\treturn tool;\n}\n\nexport class ToolCode implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Code Tool',\n\t\tname: 'toolCode',\n\t\ticon: 'fa:code',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Write a tool in JS or Python',\n\t\tdefaults: {\n\t\t\tname: 'Code Tool',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Tools'],\n\t\t\t\tTools: ['Recommended Tools'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTool],\n\t\toutputNames: ['Tool'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'See an example of a conversational agent with custom tool written in JavaScript <a href=\"/templates/1963\" target=\"_blank\">here</a>.',\n\t\t\t\tname: 'noticeTemplateExample',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Name',\n\t\t\t\tname: 'name',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'My_Tool',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Name',\n\t\t\t\tname: 'name',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. My_Tool',\n\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\tdescription:\n\t\t\t\t\t'The name of the function to be called, could contain letters, numbers, and underscores only',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1.1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Description',\n\t\t\t\tname: 'description',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder:\n\t\t\t\t\t'Call this tool to get a random color. The input should be a string with comma separted names of colors to exclude.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 3,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Language',\n\t\t\t\tname: 'language',\n\t\t\t\ttype: 'options',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'JavaScript',\n\t\t\t\t\t\tvalue: 'javaScript',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Python (Beta)',\n\t\t\t\t\t\tvalue: 'python',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'javaScript',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JavaScript',\n\t\t\t\tname: 'jsCode',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tlanguage: ['javaScript'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t},\n\t\t\t\tdefault:\n\t\t\t\t\t'// Example: convert the incoming query to uppercase and return it\\nreturn query.toUpperCase()',\n\t\t\t\t// TODO: Add proper text here later\n\t\t\t\thint: 'You can access the input the tool receives via the input property \"query\". The returned value should be a single string.',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'E.g. Converts any text to uppercase',\n\t\t\t\tnoDataExpression: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Python',\n\t\t\t\tname: 'pythonCode',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tlanguage: ['python'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\teditor: 'codeNodeEditor', // TODO: create a separate `pythonEditor` component\n\t\t\t\t\teditorLanguage: 'python',\n\t\t\t\t},\n\t\t\t\tdefault:\n\t\t\t\t\t'# Example: convert the incoming query to uppercase and return it\\nreturn query.upper()',\n\t\t\t\t// TODO: Add proper text here later\n\t\t\t\thint: 'You can access the input the tool receives via the input property \"query\". The returned value should be a single string.',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'E.g. Converts any text to uppercase',\n\t\t\t\tnoDataExpression: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Specify Input Schema',\n\t\t\t\tname: 'specifyInputSchema',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema.',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\t{ ...schemaTypeField, displayOptions: { show: { specifyInputSchema: [true] } } },\n\t\t\tjsonSchemaExampleField,\n\t\t\tjsonSchemaExampleNotice,\n\t\t\tjsonSchemaField,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\treturn {\n\t\t\tresponse: getTool(this, itemIndex),\n\t\t};\n\t}\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst result: INodeExecutionData[] = [];\n\t\tconst input = this.getInputData();\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst item = input[i];\n\t\t\tconst tool = getTool(this, i, false);\n\t\t\tresult.push({\n\t\t\t\tjson: {\n\t\t\t\t\tresponse: await tool.invoke(item.json),\n\t\t\t\t},\n\t\t\t\tpairedItem: {\n\t\t\t\t\titem: i,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\treturn [result];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmD;AACnD,oBAAkC;AAClC,gBAA0B;AAE1B,+BAAkC;AAClC,iCAAoC;AACpC,2BAA8B;AAE9B,qBAAkC;AAWlC,0BAKO;AAEP,0BAKO;AACP,2BAAkE;AAClE,0BAA6C;AAI7C,MAAM,6BAAyB,iDAA4B;AAAA,EAC1D,gBAAgB,EAAE,oBAAoB,CAAC,IAAI,EAAE;AAC9C,CAAC;AAED,MAAM,8BAA0B,kDAA6B;AAAA,EAC5D,gBAAgB;AAAA,IACf,oBAAoB,CAAC,IAAI;AAAA,IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,EACpC;AACD,CAAC;AAED,MAAM,sBAAkB,2CAAsB,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,IAAI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M;AAAA,cACL,UAAU,CAAC,QAAQ;AAAA,YACpB;AAAA,UACD;AAAA,UACA,aAAa;AAAA,YACZ,QAAQ;AAAA;AAAA,YACR,gBAAgB;AAAA,UACjB;AAAA,UACA,SACC;AAAA;AAAA,UAED,MAAM;AAAA;AAAA,UAEN,aAAa;AAAA,UACb,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aACC;AAAA,UACD,kBAAkB;AAAA,UAClB,SAAS;AAAA,QACV;AAAA,QACA,EAAE,GAAG,qCAAiB,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE;AAAA,QAC/E;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,WAAO;AAAA,MACN,UAAU,QAAQ,MAAM,SAAS;AAAA,IAClC;AAAA,EACD;AAAA,EACA,MAAM,UAAkE;AACvE,UAAM,SAA+B,CAAC;AACtC,UAAM,QAAQ,KAAK,aAAa;AAChC,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACtC,YAAM,OAAO,MAAM,CAAC;AACpB,YAAM,OAAO,QAAQ,MAAM,GAAG,KAAK;AACnC,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,UACL,UAAU,MAAM,KAAK,OAAO,KAAK,IAAI;AAAA,QACtC;AAAA,QACA,YAAY;AAAA,UACX,MAAM;AAAA,QACP;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAO,CAAC,MAAM;AAAA,EACf;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/tools/ToolCode/ToolCode.node.ts"],"sourcesContent":["import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools';\nimport { TaskRunnersConfig } from '@n8n/config';\nimport { Container } from '@n8n/di';\nimport type { JSONSchema7 } from 'json-schema';\nimport { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';\nimport { JsTaskRunnerSandbox } from 'n8n-nodes-base/dist/nodes/Code/JsTaskRunnerSandbox';\nimport { PythonSandbox } from 'n8n-nodes-base/dist/nodes/Code/PythonSandbox';\nimport { PythonTaskRunnerSandbox } from 'n8n-nodes-base/dist/nodes/Code/PythonTaskRunnerSandbox';\nimport type { Sandbox } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';\nimport { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';\nimport type {\n\tExecutionError,\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tISupplyDataFunctions,\n\tSupplyData,\n} from 'n8n-workflow';\nimport {\n\tjsonParse,\n\tNodeConnectionTypes,\n\tnodeNameToToolName,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport {\n\tbuildInputSchemaField,\n\tbuildJsonSchemaExampleField,\n\tbuildJsonSchemaExampleNotice,\n\tschemaTypeField,\n} from '@utils/descriptions';\nimport { convertJsonSchemaToZod, generateSchemaFromExample } from '@utils/schemaParsing';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport type { DynamicZodObject } from '../../../types/zod.types';\n\nconst jsonSchemaExampleField = buildJsonSchemaExampleField({\n\tshowExtraProps: { specifyInputSchema: [true] },\n});\n\nconst jsonSchemaExampleNotice = buildJsonSchemaExampleNotice({\n\tshowExtraProps: {\n\t\tspecifyInputSchema: [true],\n\t\t'@version': [{ _cnd: { gte: 1.3 } }],\n\t},\n});\n\nconst jsonSchemaField = buildInputSchemaField({ showExtraProps: { specifyInputSchema: [true] } });\n\nfunction getTool(\n\tctx: ISupplyDataFunctions | IExecuteFunctions,\n\titemIndex: number,\n\tlog: boolean = true,\n) {\n\tconst node = ctx.getNode();\n\tconst workflowMode = ctx.getMode();\n\n\tconst runnersConfig = Container.get(TaskRunnersConfig);\n\tconst isJsRunnerEnabled = runnersConfig.enabled;\n\tconst isPyRunnerEnabled = runnersConfig.isNativePythonRunnerEnabled;\n\n\tconst { typeVersion } = node;\n\tconst name =\n\t\ttypeVersion <= 1.1\n\t\t\t? (ctx.getNodeParameter('name', itemIndex) as string)\n\t\t\t: nodeNameToToolName(node);\n\n\tconst description = ctx.getNodeParameter('description', itemIndex) as string;\n\n\tconst useSchema = ctx.getNodeParameter('specifyInputSchema', itemIndex) as boolean;\n\n\tconst language = ctx.getNodeParameter('language', itemIndex) as string;\n\tlet code = '';\n\tif (language === 'javaScript') {\n\t\tcode = ctx.getNodeParameter('jsCode', itemIndex) as string;\n\t} else {\n\t\tcode = ctx.getNodeParameter('pythonCode', itemIndex) as string;\n\t}\n\n\t// @deprecated - TODO: Remove this after a new python runner is implemented\n\tconst getSandbox = (query: string | IDataObject, index = 0) => {\n\t\tconst context = getSandboxContext.call(ctx, index);\n\t\tcontext.query = query;\n\n\t\tlet sandbox: Sandbox;\n\t\tif (language === 'javaScript') {\n\t\t\tsandbox = new JavaScriptSandbox(context, code, ctx.helpers);\n\t\t} else {\n\t\t\tsandbox = new PythonSandbox(context, code, ctx.helpers);\n\t\t}\n\n\t\tsandbox.on(\n\t\t\t'output',\n\t\t\tworkflowMode === 'manual'\n\t\t\t\t? ctx.sendMessageToUI.bind(ctx)\n\t\t\t\t: (...args: unknown[]) =>\n\t\t\t\t\t\tconsole.log(`[Workflow \"${ctx.getWorkflow().id}\"][Node \"${node.name}\"]`, ...args),\n\t\t);\n\t\treturn sandbox;\n\t};\n\n\tconst runFunction = async (query: string | IDataObject): Promise<unknown> => {\n\t\tif (language === 'javaScript' && isJsRunnerEnabled) {\n\t\t\tconst sandbox = new JsTaskRunnerSandbox(\n\t\t\t\tcode,\n\t\t\t\t'runOnceForAllItems',\n\t\t\t\tworkflowMode,\n\t\t\t\tctx,\n\t\t\t\tundefined,\n\t\t\t\t{\n\t\t\t\t\tquery,\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn await sandbox.runCodeForTool();\n\t\t} else if (language === 'python' && isPyRunnerEnabled) {\n\t\t\tconst sandbox = new PythonTaskRunnerSandbox(\n\t\t\t\tcode,\n\t\t\t\t'runOnceForAllItems',\n\t\t\t\tworkflowMode,\n\t\t\t\tctx as IExecuteFunctions,\n\t\t\t\t{\n\t\t\t\t\tquery,\n\t\t\t\t},\n\t\t\t);\n\t\t\treturn await sandbox.runCodeForTool();\n\t\t} else {\n\t\t\t// use old vm2-based sandbox when runners disabled\n\t\t\tconst sandbox = getSandbox(query, itemIndex);\n\t\t\treturn await sandbox.runCode<string>();\n\t\t}\n\t};\n\n\tconst toolHandler = async (query: string | IDataObject): Promise<string> => {\n\t\tconst { index } = log\n\t\t\t? ctx.addInputData(NodeConnectionTypes.AiTool, [[{ json: { query } }]])\n\t\t\t: { index: 0 };\n\n\t\tlet response: any = '';\n\t\tlet executionError: ExecutionError | undefined;\n\t\ttry {\n\t\t\tresponse = await runFunction(query);\n\t\t} catch (error: unknown) {\n\t\t\texecutionError = new NodeOperationError(ctx.getNode(), error as ExecutionError);\n\t\t\tresponse = `There was an error: \"${executionError.message}\"`;\n\t\t}\n\n\t\tif (typeof response === 'number') {\n\t\t\tresponse = (response as number).toString();\n\t\t}\n\n\t\tif (typeof response !== 'string') {\n\t\t\t// TODO: Do some more testing. Issues here should actually fail the workflow\n\t\t\texecutionError = new NodeOperationError(ctx.getNode(), 'Wrong output type returned', {\n\t\t\t\tdescription: `The response property should be a string, but it is an ${typeof response}`,\n\t\t\t});\n\t\t\tresponse = `There was an error: \"${executionError.message}\"`;\n\t\t}\n\n\t\tif (executionError && log) {\n\t\t\tvoid ctx.addOutputData(NodeConnectionTypes.AiTool, index, executionError);\n\t\t} else if (log) {\n\t\t\tvoid ctx.addOutputData(NodeConnectionTypes.AiTool, index, [[{ json: { response } }]]);\n\t\t}\n\n\t\treturn response;\n\t};\n\n\tconst commonToolOptions = {\n\t\tname,\n\t\tdescription,\n\t\tfunc: toolHandler,\n\t};\n\n\tlet tool: DynamicTool | DynamicStructuredTool | undefined = undefined;\n\n\tif (useSchema) {\n\t\ttry {\n\t\t\t// We initialize these even though one of them will always be empty\n\t\t\t// it makes it easier to navigate the ternary operator\n\t\t\tconst jsonExample = ctx.getNodeParameter('jsonSchemaExample', itemIndex, '') as string;\n\t\t\tconst inputSchema = ctx.getNodeParameter('inputSchema', itemIndex, '') as string;\n\n\t\t\tconst schemaType = ctx.getNodeParameter('schemaType', itemIndex) as 'fromJson' | 'manual';\n\n\t\t\tconst jsonSchema =\n\t\t\t\tschemaType === 'fromJson'\n\t\t\t\t\t? generateSchemaFromExample(jsonExample, ctx.getNode().typeVersion >= 1.3)\n\t\t\t\t\t: jsonParse<JSONSchema7>(inputSchema);\n\n\t\t\tconst zodSchema = convertJsonSchemaToZod<DynamicZodObject>(jsonSchema);\n\n\t\t\ttool = new DynamicStructuredTool({\n\t\t\t\tschema: zodSchema,\n\t\t\t\t...commonToolOptions,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tctx.getNode(),\n\t\t\t\t'Error during parsing of JSON Schema. \\n ' + error,\n\t\t\t);\n\t\t}\n\t} else {\n\t\ttool = new DynamicTool(commonToolOptions);\n\t}\n\n\treturn tool;\n}\n\nexport class ToolCode implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Code Tool',\n\t\tname: 'toolCode',\n\t\ticon: 'fa:code',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Write a tool in JS or Python',\n\t\tdefaults: {\n\t\t\tname: 'Code Tool',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Tools'],\n\t\t\t\tTools: ['Recommended Tools'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTool],\n\t\toutputNames: ['Tool'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'See an example of a conversational agent with custom tool written in JavaScript <a href=\"/templates/1963\" target=\"_blank\">here</a>.',\n\t\t\t\tname: 'noticeTemplateExample',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Name',\n\t\t\t\tname: 'name',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'My_Tool',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Name',\n\t\t\t\tname: 'name',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. My_Tool',\n\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\tdescription:\n\t\t\t\t\t'The name of the function to be called, could contain letters, numbers, and underscores only',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1.1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Description',\n\t\t\t\tname: 'description',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder:\n\t\t\t\t\t'Call this tool to get a random color. The input should be a string with comma separted names of colors to exclude.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 3,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Language',\n\t\t\t\tname: 'language',\n\t\t\t\ttype: 'options',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'JavaScript',\n\t\t\t\t\t\tvalue: 'javaScript',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Python (Beta)',\n\t\t\t\t\t\tvalue: 'python',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'javaScript',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JavaScript',\n\t\t\t\tname: 'jsCode',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tlanguage: ['javaScript'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t},\n\t\t\t\tdefault:\n\t\t\t\t\t'// Example: convert the incoming query to uppercase and return it\\nreturn query.toUpperCase()',\n\t\t\t\t// TODO: Add proper text here later\n\t\t\t\thint: 'You can access the input the tool receives via the input property \"query\". The returned value should be a single string.',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'E.g. Converts any text to uppercase',\n\t\t\t\tnoDataExpression: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Python',\n\t\t\t\tname: 'pythonCode',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tlanguage: ['python'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\teditor: 'codeNodeEditor', // TODO: create a separate `pythonEditor` component\n\t\t\t\t\teditorLanguage: 'python',\n\t\t\t\t},\n\t\t\t\tdefault:\n\t\t\t\t\t'# Example: convert the incoming query to uppercase and return it\\nreturn _query.upper()',\n\t\t\t\t// TODO: Add proper text here later\n\t\t\t\thint: 'You can access the input the tool receives via the input property \"_query\". The returned value should be a single string.',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'E.g. Converts any text to uppercase',\n\t\t\t\tnoDataExpression: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Specify Input Schema',\n\t\t\t\tname: 'specifyInputSchema',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema.',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\t{ ...schemaTypeField, displayOptions: { show: { specifyInputSchema: [true] } } },\n\t\t\tjsonSchemaExampleField,\n\t\t\tjsonSchemaExampleNotice,\n\t\t\tjsonSchemaField,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\treturn {\n\t\t\tresponse: getTool(this, itemIndex),\n\t\t};\n\t}\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst result: INodeExecutionData[] = [];\n\t\tconst input = this.getInputData();\n\t\tfor (let i = 0; i < input.length; i++) {\n\t\t\tconst item = input[i];\n\t\t\tconst tool = getTool(this, i, false);\n\t\t\tresult.push({\n\t\t\t\tjson: {\n\t\t\t\t\tresponse: await tool.invoke(item.json),\n\t\t\t\t},\n\t\t\t\tpairedItem: {\n\t\t\t\t\titem: i,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\treturn [result];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmD;AACnD,oBAAkC;AAClC,gBAA0B;AAE1B,+BAAkC;AAClC,iCAAoC;AACpC,2BAA8B;AAC9B,qCAAwC;AAExC,qBAAkC;AAWlC,0BAKO;AAEP,0BAKO;AACP,2BAAkE;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aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACtC,YAAM,OAAO,MAAM,CAAC;AACpB,YAAM,OAAO,QAAQ,MAAM,GAAG,KAAK;AACnC,aAAO,KAAK;AAAA,QACX,MAAM;AAAA,UACL,UAAU,MAAM,KAAK,OAAO,KAAK,IAAI;AAAA,QACtC;AAAA,QACA,YAAY;AAAA,UACX,MAAM;AAAA,QACP;AAAA,MACD,CAAC;AAAA,IACF;AAEA,WAAO,CAAC,MAAM;AAAA,EACf;AACD;","names":[]}
@@ -8,7 +8,7 @@
8
8
  {"name":"googlePalmApi","displayName":"Google Gemini(PaLM) Api","documentationUrl":"google","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://generativelanguage.googleapis.com"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/v1beta/models"}},"supportedNodes":["googleGemini","embeddingsGoogleGemini","lmChatGoogleGemini"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vendors/GoogleGemini/gemini.svg"},
9
9
  {"name":"groqApi","displayName":"Groq","documentationUrl":"groq","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.groq.com/openai/v1","url":"/models"}},"supportedNodes":["lmChatGroq"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatGroq/groq.svg"},
10
10
  {"name":"huggingFaceApi","displayName":"HuggingFaceApi","documentationUrl":"huggingface","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://huggingface.co","url":"/api/whoami-v2"}},"supportedNodes":["embeddingsHuggingFaceInference","lmOpenHuggingFaceInference"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg"},
11
- {"name":"mcpOAuth2Api","extends":["oAuth2Api"],"displayName":"MCP OAuth2 API","documentationUrl":"mcp","properties":[{"displayName":"Use Dynamic Client Registration","name":"useDynamicClientRegistration","type":"boolean","default":true}],"supportedNodes":["mcpClient","mcpClientTool"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/mcp/mcp.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/mcp/mcp.dark.svg"}},
11
+ {"name":"mcpOAuth2Api","extends":["oAuth2Api"],"displayName":"MCP OAuth2 API","documentationUrl":"mcp","properties":[{"displayName":"Use Dynamic Client Registration","name":"useDynamicClientRegistration","type":"boolean","default":true,"required":true}],"supportedNodes":["mcpClient","mcpClientTool"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/mcp/mcp.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/mcp/mcp.dark.svg"}},
12
12
  {"name":"motorheadApi","displayName":"MotorheadApi","documentationUrl":"motorhead","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://api.getmetal.io/v1"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Client ID","name":"clientId","type":"string","default":""}],"authenticate":{"type":"generic","properties":{"headers":{"x-metal-client-id":"={{$credentials.clientId}}","x-metal-api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/keys/current"}},"supportedNodes":["memoryMotorhead"],"icon":"fa:file-export","iconColor":"black"},
13
13
  {"name":"milvusApi","displayName":"Milvus","documentationUrl":"milvus","properties":[{"displayName":"Base URL","name":"baseUrl","required":true,"type":"string","default":"http://localhost:19530"},{"displayName":"Username","name":"username","type":"string","default":""},{"displayName":"Password","name":"password","type":"string","typeOptions":{"password":true},"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.username}}:{{$credentials.password}}"}}},"test":{"request":{"baseURL":"={{ $credentials.baseUrl }}","url":"/v1/vector/collections","method":"GET"}},"supportedNodes":["vectorStoreMilvus"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-black.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-white.svg"}},
14
14
  {"name":"mistralCloudApi","displayName":"Mistral Cloud API","documentationUrl":"mistral","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.mistral.ai/v1","url":"/models","method":"GET"}},"supportedNodes":["embeddingsMistralCloud","lmChatMistralCloud"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsMistralCloud/mistral.svg"},
@@ -75,7 +75,7 @@
75
75
  {"displayName":"Recursive Character Text Splitter","name":"textSplitterRecursiveCharacterTextSplitter","icon":"fa:grip-lines-vertical","iconColor":"black","group":["transform"],"version":1,"description":"Split text into chunks by characters recursively, recommended for most use cases","defaults":{"name":"Recursive Character Text Splitter"},"codex":{"categories":["AI"],"subcategories":{"AI":["Text Splitters"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter/"}]}},"inputs":[],"outputs":["ai_textSplitter"],"outputNames":["Text Splitter"],"properties":[{"displayName":"This node must be connected to a document loader. <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='ai_document'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Chunk Size","name":"chunkSize","type":"number","default":1000},{"displayName":"Chunk Overlap","name":"chunkOverlap","type":"number","default":0},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Split Code","name":"splitCode","default":"markdown","type":"options","options":[{"name":"cpp","value":"cpp"},{"name":"go","value":"go"},{"name":"java","value":"java"},{"name":"js","value":"js"},{"name":"php","value":"php"},{"name":"proto","value":"proto"},{"name":"python","value":"python"},{"name":"rst","value":"rst"},{"name":"ruby","value":"ruby"},{"name":"rust","value":"rust"},{"name":"scala","value":"scala"},{"name":"swift","value":"swift"},{"name":"markdown","value":"markdown"},{"name":"latex","value":"latex"},{"name":"html","value":"html"}]}]}]},
76
76
  {"displayName":"Token Splitter","name":"textSplitterTokenSplitter","icon":"fa:grip-lines-vertical","iconColor":"black","group":["transform"],"version":1,"description":"Split text into chunks by tokens","defaults":{"name":"Token Splitter"},"codex":{"categories":["AI"],"subcategories":{"AI":["Text Splitters"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.textsplittertokensplitter/"}]}},"inputs":[],"outputs":["ai_textSplitter"],"outputNames":["Text Splitter"],"properties":[{"displayName":"This node must be connected to a document loader. <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='ai_document'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Chunk Size","name":"chunkSize","type":"number","default":1000,"description":"Maximum number of tokens per chunk"},{"displayName":"Chunk Overlap","name":"chunkOverlap","type":"number","default":0,"description":"Number of tokens shared between consecutive chunks to preserve context"}]},
77
77
  {"displayName":"Calculator","name":"toolCalculator","icon":"fa:calculator","iconColor":"black","group":["transform"],"version":1,"description":"Make it easier for AI agents to perform arithmetic","defaults":{"name":"Calculator"},"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcalculator/"}]}},"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}}]},
78
- {"displayName":"Code Tool","name":"toolCode","icon":"fa:code","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3],"description":"Write a tool in JS or Python","defaults":{"name":"Code Tool"},"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Recommended Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode/"}]}},"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"See an example of a conversational agent with custom tool written in JavaScript <a href=\"/templates/1963\" target=\"_blank\">here</a>.","name":"noticeTemplateExample","type":"notice","default":""},{"displayName":"Name","name":"name","type":"string","default":"","placeholder":"My_Tool","displayOptions":{"show":{"@version":[1]}}},{"displayName":"Name","name":"name","type":"string","default":"","placeholder":"e.g. My_Tool","validateType":"string-alphanumeric","description":"The name of the function to be called, could contain letters, numbers, and underscores only","displayOptions":{"show":{"@version":[1.1]}}},{"displayName":"Description","name":"description","type":"string","default":"","placeholder":"Call this tool to get a random color. The input should be a string with comma separted names of colors to exclude.","typeOptions":{"rows":3}},{"displayName":"Language","name":"language","type":"options","noDataExpression":true,"options":[{"name":"JavaScript","value":"javaScript"},{"name":"Python (Beta)","value":"python"}],"default":"javaScript"},{"displayName":"JavaScript","name":"jsCode","type":"string","displayOptions":{"show":{"language":["javaScript"]}},"typeOptions":{"editor":"jsEditor"},"default":"// Example: convert the incoming query to uppercase and return it\nreturn query.toUpperCase()","hint":"You can access the input the tool receives via the input property \"query\". The returned value should be a single string.","description":"E.g. Converts any text to uppercase","noDataExpression":true},{"displayName":"Python","name":"pythonCode","type":"string","displayOptions":{"show":{"language":["python"]}},"typeOptions":{"editor":"codeNodeEditor","editorLanguage":"python"},"default":"# Example: convert the incoming query to uppercase and return it\nreturn query.upper()","hint":"You can access the input the tool receives via the input property \"query\". The returned value should be a single string.","description":"E.g. Converts any text to uppercase","noDataExpression":true},{"displayName":"Specify Input Schema","name":"specifyInputSchema","type":"boolean","description":"Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema.","noDataExpression":true,"default":false},{"displayName":"Schema Type","name":"schemaType","type":"options","noDataExpression":true,"options":[{"name":"Generate From JSON Example","value":"fromJson","description":"Generate a schema from an example JSON object"},{"name":"Define using JSON Schema","value":"manual","description":"Define the JSON schema manually"}],"default":"fromJson","description":"How to specify the schema for the function","displayOptions":{"show":{"specifyInputSchema":[true]}}},{"displayName":"JSON Example","name":"jsonSchemaExample","type":"json","default":"{\n\t\"some_input\": \"some_value\"\n}","noDataExpression":true,"typeOptions":{"rows":10},"displayOptions":{"show":{"specifyInputSchema":[true],"schemaType":["fromJson"]}},"description":"Example JSON object to use to generate the schema"},{"displayName":"All properties will be required. To make them optional, use the 'JSON Schema' schema type instead","name":"notice","type":"notice","default":"","displayOptions":{"show":{"specifyInputSchema":[true],"@version":[{"_cnd":{"gte":1.3}}],"schemaType":["fromJson"]}}},{"displayName":"Input Schema","name":"inputSchema","type":"json","default":"{\n\"type\": \"object\",\n\"properties\": {\n\t\"some_input\": {\n\t\t\"type\": \"string\",\n\t\t\"description\": \"Some input to the function\"\n\t\t}\n\t}\n}","noDataExpression":false,"typeOptions":{"rows":10},"displayOptions":{"show":{"specifyInputSchema":[true],"schemaType":["manual"]}},"description":"Schema to use for the function","hint":"Use <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format (<a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">examples</a>). $refs syntax is currently not supported."}]},
78
+ {"displayName":"Code Tool","name":"toolCode","icon":"fa:code","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3],"description":"Write a tool in JS or Python","defaults":{"name":"Code Tool"},"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Recommended Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode/"}]}},"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"See an example of a conversational agent with custom tool written in JavaScript <a href=\"/templates/1963\" target=\"_blank\">here</a>.","name":"noticeTemplateExample","type":"notice","default":""},{"displayName":"Name","name":"name","type":"string","default":"","placeholder":"My_Tool","displayOptions":{"show":{"@version":[1]}}},{"displayName":"Name","name":"name","type":"string","default":"","placeholder":"e.g. My_Tool","validateType":"string-alphanumeric","description":"The name of the function to be called, could contain letters, numbers, and underscores only","displayOptions":{"show":{"@version":[1.1]}}},{"displayName":"Description","name":"description","type":"string","default":"","placeholder":"Call this tool to get a random color. The input should be a string with comma separted names of colors to exclude.","typeOptions":{"rows":3}},{"displayName":"Language","name":"language","type":"options","noDataExpression":true,"options":[{"name":"JavaScript","value":"javaScript"},{"name":"Python (Beta)","value":"python"}],"default":"javaScript"},{"displayName":"JavaScript","name":"jsCode","type":"string","displayOptions":{"show":{"language":["javaScript"]}},"typeOptions":{"editor":"jsEditor"},"default":"// Example: convert the incoming query to uppercase and return it\nreturn query.toUpperCase()","hint":"You can access the input the tool receives via the input property \"query\". The returned value should be a single string.","description":"E.g. Converts any text to uppercase","noDataExpression":true},{"displayName":"Python","name":"pythonCode","type":"string","displayOptions":{"show":{"language":["python"]}},"typeOptions":{"editor":"codeNodeEditor","editorLanguage":"python"},"default":"# Example: convert the incoming query to uppercase and return it\nreturn _query.upper()","hint":"You can access the input the tool receives via the input property \"_query\". The returned value should be a single string.","description":"E.g. Converts any text to uppercase","noDataExpression":true},{"displayName":"Specify Input Schema","name":"specifyInputSchema","type":"boolean","description":"Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema.","noDataExpression":true,"default":false},{"displayName":"Schema Type","name":"schemaType","type":"options","noDataExpression":true,"options":[{"name":"Generate From JSON Example","value":"fromJson","description":"Generate a schema from an example JSON object"},{"name":"Define using JSON Schema","value":"manual","description":"Define the JSON schema manually"}],"default":"fromJson","description":"How to specify the schema for the function","displayOptions":{"show":{"specifyInputSchema":[true]}}},{"displayName":"JSON Example","name":"jsonSchemaExample","type":"json","default":"{\n\t\"some_input\": \"some_value\"\n}","noDataExpression":true,"typeOptions":{"rows":10},"displayOptions":{"show":{"specifyInputSchema":[true],"schemaType":["fromJson"]}},"description":"Example JSON object to use to generate the schema"},{"displayName":"All properties will be required. To make them optional, use the 'JSON Schema' schema type instead","name":"notice","type":"notice","default":"","displayOptions":{"show":{"specifyInputSchema":[true],"@version":[{"_cnd":{"gte":1.3}}],"schemaType":["fromJson"]}}},{"displayName":"Input Schema","name":"inputSchema","type":"json","default":"{\n\"type\": \"object\",\n\"properties\": {\n\t\"some_input\": {\n\t\t\"type\": \"string\",\n\t\t\"description\": \"Some input to the function\"\n\t\t}\n\t}\n}","noDataExpression":false,"typeOptions":{"rows":10},"displayOptions":{"show":{"specifyInputSchema":[true],"schemaType":["manual"]}},"description":"Schema to use for the function","hint":"Use <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format (<a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">examples</a>). $refs syntax is currently not supported."}]},
79
79
  {"displayName":"HTTP Request Tool","name":"toolHttpRequest","group":["output"],"version":[1,1.1],"description":"Makes an HTTP request and returns the response data","subtitle":"={{ $parameter.toolDescription }}","defaults":{"name":"HTTP Request"},"credentials":[],"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Recommended Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolhttprequest/"}]}},"hidden":true,"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Description","name":"toolDescription","type":"string","description":"Explain to LLM what this tool does, better description would allow LLM to produce expected result","placeholder":"e.g. Get the current weather in the requested city","default":"","typeOptions":{"rows":3}},{"displayName":"Method","name":"method","type":"options","options":[{"name":"DELETE","value":"DELETE"},{"name":"GET","value":"GET"},{"name":"PATCH","value":"PATCH"},{"name":"POST","value":"POST"},{"name":"PUT","value":"PUT"}],"default":"GET"},{"displayName":"Tip: You can use a {placeholder} for any part of the request to be filled by the model. Provide more context about them in the placeholders section","name":"placeholderNotice","type":"notice","default":""},{"displayName":"URL","name":"url","type":"string","default":"","required":true,"placeholder":"e.g. http://www.example.com/{path}"},{"displayName":"Authentication","name":"authentication","description":"Select the type of authentication to use if needed, authentication would be done by n8n and your credentials will not be shared with the LLM","noDataExpression":true,"type":"options","options":[{"name":"None","value":"none"},{"name":"Predefined Credential Type","value":"predefinedCredentialType","description":"We've already implemented auth for many services so that you don't have to set it up manually"},{"name":"Generic Credential Type","value":"genericCredentialType","description":"Fully customizable. Choose between basic, header, OAuth2, etc."}],"default":"none"},{"displayName":"Credential Type","name":"nodeCredentialType","type":"credentialsSelect","noDataExpression":true,"required":true,"default":"","credentialTypes":["extends:oAuth2Api","extends:oAuth1Api","has:authenticate"],"displayOptions":{"show":{"authentication":["predefinedCredentialType"]}}},{"displayName":"Make sure you have specified the scope(s) for the Service Account in the credential","name":"googleApiWarning","type":"notice","default":"","displayOptions":{"show":{"nodeCredentialType":["googleApi"]}}},{"displayName":"Generic Auth Type","name":"genericAuthType","type":"credentialsSelect","required":true,"default":"","credentialTypes":["has:genericAuth"],"displayOptions":{"show":{"authentication":["genericCredentialType"]}}},{"displayName":"Send Query Parameters","name":"sendQuery","type":"boolean","default":false,"noDataExpression":true,"description":"Whether the request has query params or not"},{"displayName":"Specify Query Parameters","name":"specifyQuery","type":"options","options":[{"name":"Using Fields Below","value":"keypair"},{"name":"Using JSON Below","value":"json"},{"name":"Let Model Specify Entire Body","value":"model"}],"default":"keypair","displayOptions":{"show":{"sendQuery":[true]}}},{"displayName":"Query Parameters","name":"parametersQuery","type":"fixedCollection","typeOptions":{"multipleValues":true},"placeholder":"Add Parameter","default":{"values":[{"name":""}]},"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Name","name":"name","type":"string","default":""},{"displayName":"Value Provided","name":"valueProvider","type":"options","options":[{"name":"By Model (and is required)","value":"modelRequired"},{"name":"By Model (but is optional)","value":"modelOptional"},{"name":"Using Field Below","value":"fieldValue"}],"default":"modelRequired"},{"displayName":"Value","name":"value","type":"string","default":"","hint":"Use a {placeholder} for any data to be filled in by the model","displayOptions":{"show":{"valueProvider":["fieldValue"]}}}]}],"displayOptions":{"show":{"sendQuery":[true],"specifyQuery":["keypair"]}}},{"displayName":"JSON","name":"jsonQuery","type":"string","typeOptions":{"rows":5},"hint":"Use a {placeholder} for any data to be filled in by the model","default":"","displayOptions":{"show":{"sendQuery":[true],"specifyQuery":["json"]}}},{"displayName":"Send Headers","name":"sendHeaders","type":"boolean","default":false,"noDataExpression":true,"description":"Whether the request has headers or not"},{"displayName":"Specify Headers","name":"specifyHeaders","type":"options","options":[{"name":"Using Fields Below","value":"keypair"},{"name":"Using JSON Below","value":"json"},{"name":"Let Model Specify Entire Body","value":"model"}],"default":"keypair","displayOptions":{"show":{"sendHeaders":[true]}}},{"displayName":"Header Parameters","name":"parametersHeaders","type":"fixedCollection","typeOptions":{"multipleValues":true},"placeholder":"Add Parameter","default":{"values":[{"name":""}]},"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Name","name":"name","type":"string","default":""},{"displayName":"Value Provided","name":"valueProvider","type":"options","options":[{"name":"By Model (and is required)","value":"modelRequired"},{"name":"By Model (but is optional)","value":"modelOptional"},{"name":"Using Field Below","value":"fieldValue"}],"default":"modelRequired"},{"displayName":"Value","name":"value","type":"string","default":"","hint":"Use a {placeholder} for any data to be filled in by the model","displayOptions":{"show":{"valueProvider":["fieldValue"]}}}]}],"displayOptions":{"show":{"sendHeaders":[true],"specifyHeaders":["keypair"]}}},{"displayName":"JSON","name":"jsonHeaders","type":"string","typeOptions":{"rows":5},"hint":"Use a {placeholder} for any data to be filled in by the model","default":"","displayOptions":{"show":{"sendHeaders":[true],"specifyHeaders":["json"]}}},{"displayName":"Send Body","name":"sendBody","type":"boolean","default":false,"noDataExpression":true,"description":"Whether the request has body or not"},{"displayName":"Specify Body","name":"specifyBody","type":"options","options":[{"name":"Using Fields Below","value":"keypair"},{"name":"Using JSON Below","value":"json"},{"name":"Let Model Specify Entire Body","value":"model"}],"default":"keypair","displayOptions":{"show":{"sendBody":[true]}}},{"displayName":"Body Parameters","name":"parametersBody","type":"fixedCollection","typeOptions":{"multipleValues":true},"placeholder":"Add Parameter","default":{"values":[{"name":""}]},"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Name","name":"name","type":"string","default":""},{"displayName":"Value Provided","name":"valueProvider","type":"options","options":[{"name":"By Model (and is required)","value":"modelRequired"},{"name":"By Model (but is optional)","value":"modelOptional"},{"name":"Using Field Below","value":"fieldValue"}],"default":"modelRequired"},{"displayName":"Value","name":"value","type":"string","default":"","hint":"Use a {placeholder} for any data to be filled in by the model","displayOptions":{"show":{"valueProvider":["fieldValue"]}}}]}],"displayOptions":{"show":{"sendBody":[true],"specifyBody":["keypair"]}}},{"displayName":"JSON","name":"jsonBody","type":"string","typeOptions":{"rows":5},"hint":"Use a {placeholder} for any data to be filled in by the model","default":"","displayOptions":{"show":{"sendBody":[true],"specifyBody":["json"]}}},{"displayName":"Placeholder Definitions","name":"placeholderDefinitions","type":"fixedCollection","typeOptions":{"multipleValues":true},"placeholder":"Add Definition","default":[],"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Placeholder Name","name":"name","type":"string","default":""},{"displayName":"Description","name":"description","type":"string","default":""},{"displayName":"Type","name":"type","type":"options","options":[{"name":"Not Specified (Default)","value":"not specified"},{"name":"String","value":"string"},{"name":"Number","value":"number"},{"name":"Boolean","value":"boolean"},{"name":"JSON","value":"json"}],"default":"not specified"}]}]},{"displayName":"Optimize Response","name":"optimizeResponse","type":"boolean","default":false,"noDataExpression":true,"description":"Whether the optimize the tool response to reduce amount of data passed to the LLM that could lead to better result and reduce cost"},{"displayName":"Expected Response Type","name":"responseType","type":"options","displayOptions":{"show":{"optimizeResponse":[true]}},"options":[{"name":"JSON","value":"json"},{"name":"HTML","value":"html"},{"name":"Text","value":"text"}],"default":"json"},{"displayName":"Field Containing Data","name":"dataField","type":"string","default":"","placeholder":"e.g. records","description":"Specify the name of the field in the response containing the data","hint":"leave blank to use whole response","requiresDataPath":"single","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["json"]}}},{"displayName":"Include Fields","name":"fieldsToInclude","type":"options","description":"What fields response object should include","default":"all","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["json"]}},"options":[{"name":"All","value":"all","description":"Include all fields"},{"name":"Selected","value":"selected","description":"Include only fields specified below"},{"name":"Except","value":"except","description":"Exclude fields specified below"}]},{"displayName":"Fields","name":"fields","type":"string","default":"","placeholder":"e.g. field1,field2","description":"Comma-separated list of the field names. Supports dot notation. You can drag the selected fields from the input panel.","requiresDataPath":"multiple","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["json"]},"hide":{"fieldsToInclude":["all"]}}},{"displayName":"Selector (CSS)","name":"cssSelector","type":"string","description":"Select specific element(e.g. body) or multiple elements(e.g. div) of chosen type in the response HTML.","placeholder":"e.g. body","default":"body","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["html"]}}},{"displayName":"Return Only Content","name":"onlyContent","type":"boolean","default":false,"description":"Whether to return only content of html elements, stripping html tags and attributes","hint":"Uses less tokens and may be easier for model to understand","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["html"]}}},{"displayName":"Elements To Omit","name":"elementsToOmit","type":"string","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["html"],"onlyContent":[true]}},"default":"","placeholder":"e.g. img, .className, #ItemId","description":"Comma-separated list of selectors that would be excluded when extracting content"},{"displayName":"Truncate Response","name":"truncateResponse","type":"boolean","default":false,"hint":"Helps save tokens","displayOptions":{"show":{"optimizeResponse":[true],"responseType":["text","html"]}}},{"displayName":"Max Response Characters","name":"maxLength","type":"number","default":1000,"typeOptions":{"minValue":1},"displayOptions":{"show":{"optimizeResponse":[true],"responseType":["text","html"],"truncateResponse":[true]}}}],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolHttpRequest/httprequest.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolHttpRequest/httprequest.dark.svg"}},
80
80
  {"displayName":"SearXNG","name":"toolSearXng","group":["transform"],"version":1,"description":"Search in SearXNG","defaults":{"name":"SearXNG"},"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolsearxng"}]}},"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"credentials":[{"name":"searXngApi","required":true}],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Number of Results","name":"numResults","type":"number","default":10},{"displayName":"Search Page Number","name":"pageNumber","type":"number","default":1},{"displayName":"Language","name":"language","type":"string","default":"en","description":"Defines the language to use. It's a two-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French). Head to <a href=\"https://docs.searxng.org/user/search-syntax.html#select-language\">SearXNG search syntax page</a> for more info."},{"displayName":"Safe Search","name":"safesearch","type":"options","options":[{"name":"None","value":0},{"name":"Moderate","value":1},{"name":"Strict","value":2}],"default":0,"description":"Filter search results of engines which support safe search"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSearXng/searXng.svg"},
81
81
  {"displayName":"SerpApi (Google Search)","name":"toolSerpApi","group":["transform"],"version":1,"description":"Search in Google using SerpAPI","defaults":{"name":"SerpAPI"},"codex":{"categories":["AI"],"subcategories":{"AI":["Tools"],"Tools":["Other Tools"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolserpapi/"}]}},"inputs":[],"outputs":["ai_tool"],"outputNames":["Tool"],"credentials":[{"name":"serpApi","required":true}],"properties":[{"displayName":"This node must be connected to an AI agent. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Options","name":"options","type":"collection","placeholder":"Add Option","default":{},"options":[{"displayName":"Country","name":"gl","type":"string","default":"us","description":"Defines the country to use for search. Head to <a href=\"https://serpapi.com/google-countries\">Google countries page</a> for a full list of supported countries."},{"displayName":"Device","name":"device","type":"options","options":[{"name":"Desktop","value":"desktop"},{"name":"Mobile","value":"mobile"},{"name":"Tablet","value":"tablet"}],"default":"desktop","description":"Device to use to get the results"},{"displayName":"Explicit Array","name":"no_cache","type":"boolean","default":false,"description":"Whether to force SerpApi to fetch the Google results even if a cached version is already present. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month."},{"displayName":"Google Domain","name":"google_domain","type":"string","default":"google.com","description":"Defines the domain to use for search. Head to <a href=\"https://serpapi.com/google-domains\">Google domains page</a> for a full list of supported domains."},{"displayName":"Language","name":"hl","type":"string","default":"en","description":"Defines the language to use. It's a two-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French). Head to <a href=\"https://serpapi.com/google-languages\">Google languages page</a> for a full list of supported languages."}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSerpApi/serpApi.svg"},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/n8n-nodes-langchain",
3
- "version": "1.122.1",
3
+ "version": "2.0.0-rc.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -160,7 +160,7 @@
160
160
  "jest-mock-extended": "^3.0.4",
161
161
  "tsup": "^8.5.0",
162
162
  "@n8n/eslint-plugin-community-nodes": "0.7.0",
163
- "n8n-core": "1.122.0"
163
+ "n8n-core": "2.0.0-rc.1"
164
164
  },
165
165
  "dependencies": {
166
166
  "@aws-sdk/client-sso-oidc": "3.808.0",
@@ -229,14 +229,14 @@
229
229
  "weaviate-client": "3.6.2",
230
230
  "zod": "3.25.67",
231
231
  "zod-to-json-schema": "3.23.3",
232
- "@n8n/client-oauth2": "0.33.0",
232
+ "@n8n/config": "2.0.0-rc.1",
233
233
  "@n8n/di": "0.10.0",
234
- "@n8n/config": "1.65.0",
235
234
  "@n8n/errors": "0.5.0",
236
235
  "@n8n/json-schema-to-zod": "1.6.0",
236
+ "@n8n/client-oauth2": "1.0.0-rc.0",
237
+ "n8n-workflow": "2.0.0-rc.1",
237
238
  "@n8n/typescript-config": "1.3.0",
238
- "n8n-workflow": "1.120.0",
239
- "n8n-nodes-base": "1.121.0"
239
+ "n8n-nodes-base": "2.0.0-rc.1"
240
240
  },
241
241
  "license": "SEE LICENSE IN LICENSE.md",
242
242
  "homepage": "https://n8n.io",