@n8n/n8n-nodes-langchain 0.6.1 → 0.7.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.
- package/dist/build.tsbuildinfo +1 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +7 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +7 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +7 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +5 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -1
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +4 -1
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -1
- package/dist/types/nodes.json +1 -1
- package/package.json +4 -4
|
@@ -68,6 +68,13 @@ exports.conversationalAgentProperties = [
|
|
|
68
68
|
default: 10,
|
|
69
69
|
description: 'The maximum number of iterations the agent will run before stopping',
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Return Intermediate Steps',
|
|
73
|
+
name: 'returnIntermediateSteps',
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
default: false,
|
|
76
|
+
description: 'Whether or not the output should include intermediate steps the agent took',
|
|
77
|
+
},
|
|
71
78
|
],
|
|
72
79
|
},
|
|
73
80
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ConversationalAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAAyD;AAE5C,QAAA,6BAA6B,GAAsB;IAC/D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;gBAC9B,UAAU,EAAE,CAAC,CAAC,CAAC;aACf;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;gBAC9B,UAAU,EAAE,CAAC,GAAG,CAAC;aACjB;SACD;QACD,OAAO,EAAE,yBAAyB;KAClC;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;aAC9B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sBAAa;gBACtB,WAAW,EAAE,qEAAqE;gBAClF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAc;gBACvB,WAAW,EAAE,2EAA2E;gBACxF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qEAAqE;aAClF;SACD;KACD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ConversationalAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAAyD;AAE5C,QAAA,6BAA6B,GAAsB;IAC/D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;gBAC9B,UAAU,EAAE,CAAC,CAAC,CAAC;aACf;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;gBAC9B,UAAU,EAAE,CAAC,GAAG,CAAC;aACjB;SACD;QACD,OAAO,EAAE,yBAAyB;KAClC;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;aAC9B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,sBAAa;gBACtB,WAAW,EAAE,qEAAqE;gBAClF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAc;gBACvB,WAAW,EAAE,2EAA2E;gBACxF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qEAAqE;aAClF;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,4EAA4E;aACzF;SACD;KACD;CACD,CAAC"}
|
|
@@ -20,6 +20,7 @@ async function conversationalAgentExecute() {
|
|
|
20
20
|
const agentExecutor = await (0, agents_1.initializeAgentExecutorWithOptions)(tools, model, {
|
|
21
21
|
agentType: 'chat-conversational-react-description',
|
|
22
22
|
memory,
|
|
23
|
+
returnIntermediateSteps: (options === null || options === void 0 ? void 0 : options.returnIntermediateSteps) === true,
|
|
23
24
|
maxIterations: (_a = options.maxIterations) !== null && _a !== void 0 ? _a : 10,
|
|
24
25
|
agentArgs: {
|
|
25
26
|
systemMessage: options.systemMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ConversationalAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAEtB,6CAAsE;AACtE,qDAA2D;AAI3D,+CAAmD;AACnD,6DAAiE;AAE1D,KAAK,UAAU,0BAA0B;;IAG/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAEtD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAk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,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAC/D,IAAI,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAW,CAAC;QAE/D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,+BAA+B,CAAC,CAAC;QAC/E,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACZ,KAAK,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QAElE,IAAI,YAAY,EAAE,CAAC;YAClB,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAgB,CAAC,EAAE,CAAC;QAC5E,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AA1FD,gEA0FC"}
|
|
@@ -58,6 +58,13 @@ exports.openAiFunctionsAgentProperties = [
|
|
|
58
58
|
default: 10,
|
|
59
59
|
description: 'The maximum number of iterations the agent will run before stopping',
|
|
60
60
|
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Return Intermediate Steps',
|
|
63
|
+
name: 'returnIntermediateSteps',
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
default: false,
|
|
66
|
+
description: 'Whether or not the output should include intermediate steps the agent took',
|
|
67
|
+
},
|
|
61
68
|
],
|
|
62
69
|
},
|
|
63
70
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAA0C;AAE7B,QAAA,8BAA8B,GAAsB;IAChE;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;gBAC/B,UAAU,EAAE,CAAC,CAAC,CAAC;aACf;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;gBAC/B,UAAU,EAAE,CAAC,GAAG,CAAC;aACjB;SACD;QACD,OAAO,EAAE,yBAAyB;KAClC;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;aAC/B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAc;gBACvB,WAAW,EAAE,2EAA2E;gBACxF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qEAAqE;aAClF;SACD;KACD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAA0C;AAE7B,QAAA,8BAA8B,GAAsB;IAChE;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;gBAC/B,UAAU,EAAE,CAAC,CAAC,CAAC;aACf;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;gBAC/B,UAAU,EAAE,CAAC,GAAG,CAAC;aACjB;SACD;QACD,OAAO,EAAE,yBAAyB;KAClC;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;aAC/B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAc;gBACvB,WAAW,EAAE,2EAA2E;gBACxF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qEAAqE;aAClF;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,4EAA4E;aACzF;SACD;KACD;CACD,CAAC"}
|
|
@@ -25,6 +25,7 @@ async function openAiFunctionsAgentExecute() {
|
|
|
25
25
|
}),
|
|
26
26
|
tools,
|
|
27
27
|
maxIterations: (_a = options.maxIterations) !== null && _a !== void 0 ? _a : 10,
|
|
28
|
+
returnIntermediateSteps: (options === null || options === void 0 ? void 0 : options.returnIntermediateSteps) === true,
|
|
28
29
|
memory: memory !== null && memory !== void 0 ? memory : new memory_1.BufferMemory({
|
|
29
30
|
returnMessages: true,
|
|
30
31
|
memoryKey: 'chat_history',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAGtB,6CAA8D;AAG9D,+CAAmD;AACnD,6DAAiE;AACjE,6CAAqE;AACrE,yDAA0D;AAEnD,KAAK,UAAU,2BAA2B;;IAGhD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAe,CAAC;IAEjB,IAAI,CAAC,CAAC,KAAK,YAAY,mBAAU,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,mDAAmD,CACnD,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,cAA8B,CAAC,CAAC,CAErE,CAAC;IACb,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,YAA4B,CAAC,CAAC,CAAW,CAAC;IAC1F,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEvD,CAAC,CACD,CAAuB,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAGtB,6CAA8D;AAG9D,+CAAmD;AACnD,6DAAiE;AACjE,6CAAqE;AACrE,yDAA0D;AAEnD,KAAK,UAAU,2BAA2B;;IAGhD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAe,CAAC;IAEjB,IAAI,CAAC,CAAC,KAAK,YAAY,mBAAU,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,mDAAmD,CACnD,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,cAA8B,CAAC,CAAC,CAErE,CAAC;IACb,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,YAA4B,CAAC,CAAC,CAAW,CAAC;IAC1F,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEvD,CAAC,CACD,CAAuB,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAIrD,CAAC;IAEF,MAAM,WAAW,GAAuB;QACvC,IAAI,EAAE,CAAC,kBAAkB,CAAC;QAC1B,KAAK,EAAE,oBAAW,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE;YAChD,MAAM,EAAE,OAAO,CAAC,aAAa;SAC7B,CAAC;QACF,KAAK;QACL,aAAa,EAAE,MAAA,OA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E,EAAE,gCAAgC,CAAC,CAAC;QAChF,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACZ,KAAK,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QAElE,IAAI,YAAY,EAAE,CAAC;YAClB,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAgB,CAAC,EAAE,CAAC;QAC5E,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAxFD,kEAwFC"}
|
|
@@ -81,6 +81,13 @@ exports.reActAgentAgentProperties = [
|
|
|
81
81
|
rows: 6,
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Return Intermediate Steps',
|
|
86
|
+
name: 'returnIntermediateSteps',
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
default: false,
|
|
89
|
+
description: 'Whether or not the output should include intermediate steps the agent took',
|
|
90
|
+
},
|
|
84
91
|
],
|
|
85
92
|
},
|
|
86
93
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ReActAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAA+E;AAElE,QAAA,yBAAyB,GAAsB;IAC3D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAA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;gBACd,OAAO,EAAE,eAAM;gBACf,WAAW,EACV,kFAAkF;gBACnF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;SACD;KACD;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ReActAgent/description.ts"],"names":[],"mappings":";;;AACA,qCAA+E;AAElE,QAAA,yBAAyB,GAAsB;IAC3D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,YAAY,CAAC;gBACrB,UAAU,EAAE,CAAC,CAAC,CAAC;aACf;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,YAAY,CAAC;gBACrB,UAAU,EAAE,CAAC,GAAG,CAAC;aACjB;SACD;QACD,OAAO,EAAE,yBAAyB;KAClC;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,YAAY,CAAC;aACrB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,sBAAsB;gBAC5B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,+BAAsB;gBAC/B,WAAW,EAAE,sDAAsD;gBACnE,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,eAAM;gBACf,WAAW,EAAE,wCAAwC;gBACrD,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oBAAW;gBACpB,WAAW,EACV,+EAA+E;gBAChF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,kCAAkC;gBAC/C,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,eAAM;gBACf,WAAW,EACV,kFAAkF;gBACnF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,4EAA4E;aACzF;SACD;KACD;CACD,CAAC"}
|
|
@@ -26,7 +26,11 @@ async function reActAgentAgentExecute() {
|
|
|
26
26
|
suffix: options.suffix,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
const agentExecutor = agents_1.AgentExecutor.fromAgentAndTools({
|
|
29
|
+
const agentExecutor = agents_1.AgentExecutor.fromAgentAndTools({
|
|
30
|
+
agent,
|
|
31
|
+
tools,
|
|
32
|
+
returnIntermediateSteps: (options === null || options === void 0 ? void 0 : options.returnIntermediateSteps) === true,
|
|
33
|
+
});
|
|
30
34
|
const returnData = [];
|
|
31
35
|
let outputParser;
|
|
32
36
|
let prompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ReActAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAEtB,6CAA2E;AAI3E,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gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAW,CAAC;QAE/D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,gCAAgC,CAAC,CAAC;QAChF,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACZ,KAAK,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QAClE,IAAI,YAAY,EAAE,CAAC;YAClB,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAgB,CAAC,EAAE,CAAC;QAC5E,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAlFD,wDAkFC"}
|
|
@@ -36,8 +36,11 @@ class ToolWikipedia {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
async supplyData() {
|
|
39
|
+
const WikiTool = new tools_1.WikipediaQueryRun();
|
|
40
|
+
WikiTool.description =
|
|
41
|
+
'A tool for interacting with and fetching data from the Wikipedia API. The input should always be a string query.';
|
|
39
42
|
return {
|
|
40
|
-
response: (0, logWrapper_1.logWrapper)(
|
|
43
|
+
response: (0, logWrapper_1.logWrapper)(WikiTool, this),
|
|
41
44
|
};
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolWikipedia.node.js","sourceRoot":"","sources":["../../../../nodes/tools/ToolWikipedia/ToolWikipedia.node.ts"],"names":[],"mappings":";;;AAQA,2CAAoD;AACpD,0DAAuD;AACvD,8DAA2E;AAE3E,MAAa,aAAa;IAA1B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,OAAO,CAAC;iBACb;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,qGAAqG;yBAC1G;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,WAA2B;YACpC,WAAW,EAAE,CAAC,MAAM,CAAC;YACrB,UAAU,EAAE,CAAC,IAAA,2CAA4B,EAAC,YAA4B,CAAC,CAAC;SACxE,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolWikipedia.node.js","sourceRoot":"","sources":["../../../../nodes/tools/ToolWikipedia/ToolWikipedia.node.ts"],"names":[],"mappings":";;;AAQA,2CAAoD;AACpD,0DAAuD;AACvD,8DAA2E;AAE3E,MAAa,aAAa;IAA1B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,OAAO,CAAC;iBACb;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,qGAAqG;yBAC1G;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,WAA2B;YACpC,WAAW,EAAE,CAAC,MAAM,CAAC;YACrB,UAAU,EAAE,CAAC,IAAA,2CAA4B,EAAC,YAA4B,CAAC,CAAC;SACxE,CAAC;IAYH,CAAC;IAVA,KAAK,CAAC,UAAU;QACf,MAAM,QAAQ,GAAG,IAAI,yBAAiB,EAAE,CAAC;QAEzC,QAAQ,CAAC,WAAW;YACnB,kHAAkH,CAAC;QAEpH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,QAAQ,EAAE,IAAI,CAAC;SACpC,CAAC;IACH,CAAC;CACD;AA1CD,sCA0CC"}
|
package/dist/types/nodes.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[
|
|
2
|
-
{"displayName":"AI Agent","name":"@n8n/n8n-nodes-langchain.agent","icon":"fa:robot","group":["transform"],"version":[1,1.1],"description":"Generates an action plan and executes it. Can use external tools.","subtitle":"={{ {\tconversationalAgent: 'Conversational Agent', openAiFunctionsAgent: 'OpenAI Functions Agent', reactAgent: 'ReAct Agent', sqlAgent: 'SQL Agent' }[$parameter.agent] }}","defaults":{"name":"AI Agent","color":"#404040"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Agents"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"}]}},"inputs":"={{ ((agent) => { function getInputs(agent) {\n const getInputData = (inputs) => {\n const displayNames = {\n [\"ai_languageModel\"]: 'Model',\n [\"ai_memory\"]: 'Memory',\n [\"ai_tool\"]: 'Tool',\n [\"ai_outputParser\"]: 'Output Parser',\n };\n return inputs.map(({ type, filter }) => {\n const input = {\n type,\n displayName: type in displayNames ? displayNames[type] : undefined,\n required: type === \"ai_languageModel\",\n maxConnections: [\"ai_languageModel\", \"ai_memory\"].includes(type)\n ? 1\n : undefined,\n };\n if (filter) {\n input.filter = filter;\n }\n return input;\n });\n };\n let specialInputs = [];\n if (agent === 'conversationalAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n filter: {\n nodes: [\n '@n8n/n8n-nodes-langchain.lmChatAnthropic',\n '@n8n/n8n-nodes-langchain.lmChatOllama',\n '@n8n/n8n-nodes-langchain.lmChatOpenAi',\n '@n8n/n8n-nodes-langchain.lmChatGooglePalm',\n ],\n },\n },\n {\n type: \"ai_memory\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'openAiFunctionsAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n filter: {\n nodes: ['@n8n/n8n-nodes-langchain.lmChatOpenAi'],\n },\n },\n {\n type: \"ai_memory\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'reActAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'sqlAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n ];\n }\n else if (agent === 'planAndExecuteAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n return [\"main\", ...getInputData(specialInputs)];\n}; return getInputs(agent) })($parameter.agent) }}","outputs":["main"],"credentials":[{"name":"mySql","required":true,"testedBy":"mysqlConnectionTest","displayOptions":{"show":{"agent":["sqlAgent"],"/dataSource":["mysql"]}}},{"name":"postgres","required":true,"displayOptions":{"show":{"agent":["sqlAgent"],"/dataSource":["postgres"]}}}],"properties":[{"displayName":"Save time with an <a href=\"/templates/1954\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":"","displayOptions":{"show":{"agent":["conversationalAgent"]}}},{"displayName":"Agent","name":"agent","type":"options","noDataExpression":true,"options":[{"name":"Conversational Agent","value":"conversationalAgent","description":"Selects tools to accomplish its task and uses memory to recall previous conversations"},{"name":"OpenAI Functions Agent","value":"openAiFunctionsAgent","description":"Utilizes OpenAI's Function Calling feature to select the appropriate tool and arguments for execution"},{"name":"Plan and Execute Agent","value":"planAndExecuteAgent","description":"Plan and execute agents accomplish an objective by first planning what to do, then executing the sub tasks"},{"name":"ReAct Agent","value":"reActAgent","description":"Strategically select tools to accomplish a given task"},{"name":"SQL Agent","value":"sqlAgent","description":"Answers questions about data in an SQL database"}],"default":"conversationalAgent"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["conversationalAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["conversationalAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["conversationalAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message","name":"humanMessage","type":"string","default":"TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{tools}\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\n\n{{input}}","description":"The message that will provide the agent with a list of tools to use","typeOptions":{"rows":6}},{"displayName":"System Message","name":"systemMessage","type":"string","default":"Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.","description":"The message that will be sent to the agent before the conversation starts","typeOptions":{"rows":6}},{"displayName":"Max Iterations","name":"maxIterations","type":"number","default":10,"description":"The maximum number of iterations the agent will run before stopping"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["openAiFunctionsAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["openAiFunctionsAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["openAiFunctionsAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"System Message","name":"systemMessage","type":"string","default":"You are a helpful AI assistant.","description":"The message that will be sent to the agent before the conversation starts","typeOptions":{"rows":6}},{"displayName":"Max Iterations","name":"maxIterations","type":"number","default":10,"description":"The maximum number of iterations the agent will run before stopping"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["reActAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["reActAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["reActAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message Template","name":"humanMessageTemplate","type":"string","default":"{input}\n\n{agent_scratchpad}","description":"String to use directly as the human message template","typeOptions":{"rows":6}},{"displayName":"Prefix Message","name":"prefix","type":"string","default":"Answer the following questions as best you can. You have access to the following tools:","description":"String to put before the list of tools","typeOptions":{"rows":6}},{"displayName":"Suffix Message for Chat Model","name":"suffixChat","type":"string","default":"Begin! Reminder to always use the exact characters `Final Answer` when responding.","description":"String to put after the list of tools that will be used if chat model is used","typeOptions":{"rows":6}},{"displayName":"Suffix Message for Regular Model","name":"suffix","type":"string","default":"Begin!\n\n\tQuestion: {input}\n\tThought:{agent_scratchpad}","description":"String to put after the list of tools that will be used if regular model is used","typeOptions":{"rows":6}}]},{"displayName":"Data Source","name":"dataSource","type":"options","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":"sqlite","description":"SQL database to connect to","options":[{"name":"MySQL","value":"mysql","description":"Connect to a MySQL database"},{"name":"Postgres","value":"postgres","description":"Connect to a Postgres database"},{"name":"SQLite","value":"sqlite","description":"Use SQLite by connecting a database file as binary input"}]},{"displayName":"Prompt","name":"input","type":"string","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":"","required":true,"typeOptions":{"rows":5}},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Ignored Tables","name":"ignoredTables","type":"string","default":"","description":"Comma-separated list of tables to ignore from the database. If empty, no tables are ignored."},{"displayName":"Include Sample Rows","name":"includedSampleRows","type":"number","description":"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.","default":3},{"displayName":"Included Tables","name":"includedTables","type":"string","default":"","description":"Comma-separated list of tables to include in the database. If empty, all tables are included."},{"displayName":"Prefix Prompt","name":"prefixPrompt","type":"string","default":"You are an agent designed to interact with an SQL database.\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\nYou can order the results by a relevant column to return the most interesting examples in the database.\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\nYou have access to tools for interacting with the database.\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return \"I don't know\" as the answer.","description":"Prefix prompt to use for the agent","typeOptions":{"rows":10}},{"displayName":"Suffix Prompt","name":"suffixPrompt","type":"string","default":"Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the database to see what I can query.\n{agent_scratchpad}","description":"Suffix prompt to use for the agent","typeOptions":{"rows":4}},{"displayName":"Limit","name":"topK","type":"number","default":10,"description":"The maximum number of results to return"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["planAndExecuteAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["planAndExecuteAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["planAndExecuteAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message Template","name":"humanMessageTemplate","type":"string","default":"Previous steps: {previous_steps}\n\nCurrent objective: {current_step}\n\n{agent_scratchpad}\n\nYou may extract and combine relevant data from your previous steps when responding to me.","description":"The message that will be sent to the agent during each step execution","typeOptions":{"rows":6}}]}]},
|
|
2
|
+
{"displayName":"AI Agent","name":"@n8n/n8n-nodes-langchain.agent","icon":"fa:robot","group":["transform"],"version":[1,1.1],"description":"Generates an action plan and executes it. Can use external tools.","subtitle":"={{ {\tconversationalAgent: 'Conversational Agent', openAiFunctionsAgent: 'OpenAI Functions Agent', reactAgent: 'ReAct Agent', sqlAgent: 'SQL Agent' }[$parameter.agent] }}","defaults":{"name":"AI Agent","color":"#404040"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Agents"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"}]}},"inputs":"={{ ((agent) => { function getInputs(agent) {\n const getInputData = (inputs) => {\n const displayNames = {\n [\"ai_languageModel\"]: 'Model',\n [\"ai_memory\"]: 'Memory',\n [\"ai_tool\"]: 'Tool',\n [\"ai_outputParser\"]: 'Output Parser',\n };\n return inputs.map(({ type, filter }) => {\n const input = {\n type,\n displayName: type in displayNames ? displayNames[type] : undefined,\n required: type === \"ai_languageModel\",\n maxConnections: [\"ai_languageModel\", \"ai_memory\"].includes(type)\n ? 1\n : undefined,\n };\n if (filter) {\n input.filter = filter;\n }\n return input;\n });\n };\n let specialInputs = [];\n if (agent === 'conversationalAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n filter: {\n nodes: [\n '@n8n/n8n-nodes-langchain.lmChatAnthropic',\n '@n8n/n8n-nodes-langchain.lmChatOllama',\n '@n8n/n8n-nodes-langchain.lmChatOpenAi',\n '@n8n/n8n-nodes-langchain.lmChatGooglePalm',\n ],\n },\n },\n {\n type: \"ai_memory\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'openAiFunctionsAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n filter: {\n nodes: ['@n8n/n8n-nodes-langchain.lmChatOpenAi'],\n },\n },\n {\n type: \"ai_memory\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'reActAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n else if (agent === 'sqlAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n ];\n }\n else if (agent === 'planAndExecuteAgent') {\n specialInputs = [\n {\n type: \"ai_languageModel\",\n },\n {\n type: \"ai_tool\",\n },\n {\n type: \"ai_outputParser\",\n },\n ];\n }\n return [\"main\", ...getInputData(specialInputs)];\n}; return getInputs(agent) })($parameter.agent) }}","outputs":["main"],"credentials":[{"name":"mySql","required":true,"testedBy":"mysqlConnectionTest","displayOptions":{"show":{"agent":["sqlAgent"],"/dataSource":["mysql"]}}},{"name":"postgres","required":true,"displayOptions":{"show":{"agent":["sqlAgent"],"/dataSource":["postgres"]}}}],"properties":[{"displayName":"Save time with an <a href=\"/templates/1954\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":"","displayOptions":{"show":{"agent":["conversationalAgent"]}}},{"displayName":"Agent","name":"agent","type":"options","noDataExpression":true,"options":[{"name":"Conversational Agent","value":"conversationalAgent","description":"Selects tools to accomplish its task and uses memory to recall previous conversations"},{"name":"OpenAI Functions Agent","value":"openAiFunctionsAgent","description":"Utilizes OpenAI's Function Calling feature to select the appropriate tool and arguments for execution"},{"name":"Plan and Execute Agent","value":"planAndExecuteAgent","description":"Plan and execute agents accomplish an objective by first planning what to do, then executing the sub tasks"},{"name":"ReAct Agent","value":"reActAgent","description":"Strategically select tools to accomplish a given task"},{"name":"SQL Agent","value":"sqlAgent","description":"Answers questions about data in an SQL database"}],"default":"conversationalAgent"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["conversationalAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["conversationalAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["conversationalAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message","name":"humanMessage","type":"string","default":"TOOLS\n------\nAssistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:\n\n{tools}\n\n{format_instructions}\n\nUSER'S INPUT\n--------------------\nHere is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):\n\n{{input}}","description":"The message that will provide the agent with a list of tools to use","typeOptions":{"rows":6}},{"displayName":"System Message","name":"systemMessage","type":"string","default":"Assistant is a large language model trained by OpenAI.\n\nAssistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.\n\nAssistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics.\n\nOverall, Assistant is a powerful system that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether you need help with a specific question or just want to have a conversation about a particular topic, Assistant is here to assist.","description":"The message that will be sent to the agent before the conversation starts","typeOptions":{"rows":6}},{"displayName":"Max Iterations","name":"maxIterations","type":"number","default":10,"description":"The maximum number of iterations the agent will run before stopping"},{"displayName":"Return Intermediate Steps","name":"returnIntermediateSteps","type":"boolean","default":false,"description":"Whether or not the output should include intermediate steps the agent took"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["openAiFunctionsAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["openAiFunctionsAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["openAiFunctionsAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"System Message","name":"systemMessage","type":"string","default":"You are a helpful AI assistant.","description":"The message that will be sent to the agent before the conversation starts","typeOptions":{"rows":6}},{"displayName":"Max Iterations","name":"maxIterations","type":"number","default":10,"description":"The maximum number of iterations the agent will run before stopping"},{"displayName":"Return Intermediate Steps","name":"returnIntermediateSteps","type":"boolean","default":false,"description":"Whether or not the output should include intermediate steps the agent took"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["reActAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["reActAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["reActAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message Template","name":"humanMessageTemplate","type":"string","default":"{input}\n\n{agent_scratchpad}","description":"String to use directly as the human message template","typeOptions":{"rows":6}},{"displayName":"Prefix Message","name":"prefix","type":"string","default":"Answer the following questions as best you can. You have access to the following tools:","description":"String to put before the list of tools","typeOptions":{"rows":6}},{"displayName":"Suffix Message for Chat Model","name":"suffixChat","type":"string","default":"Begin! Reminder to always use the exact characters `Final Answer` when responding.","description":"String to put after the list of tools that will be used if chat model is used","typeOptions":{"rows":6}},{"displayName":"Suffix Message for Regular Model","name":"suffix","type":"string","default":"Begin!\n\n\tQuestion: {input}\n\tThought:{agent_scratchpad}","description":"String to put after the list of tools that will be used if regular model is used","typeOptions":{"rows":6}},{"displayName":"Return Intermediate Steps","name":"returnIntermediateSteps","type":"boolean","default":false,"description":"Whether or not the output should include intermediate steps the agent took"}]},{"displayName":"Data Source","name":"dataSource","type":"options","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":"sqlite","description":"SQL database to connect to","options":[{"name":"MySQL","value":"mysql","description":"Connect to a MySQL database"},{"name":"Postgres","value":"postgres","description":"Connect to a Postgres database"},{"name":"SQLite","value":"sqlite","description":"Use SQLite by connecting a database file as binary input"}]},{"displayName":"Prompt","name":"input","type":"string","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":"","required":true,"typeOptions":{"rows":5}},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["sqlAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Ignored Tables","name":"ignoredTables","type":"string","default":"","description":"Comma-separated list of tables to ignore from the database. If empty, no tables are ignored."},{"displayName":"Include Sample Rows","name":"includedSampleRows","type":"number","description":"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.","default":3},{"displayName":"Included Tables","name":"includedTables","type":"string","default":"","description":"Comma-separated list of tables to include in the database. If empty, all tables are included."},{"displayName":"Prefix Prompt","name":"prefixPrompt","type":"string","default":"You are an agent designed to interact with an SQL database.\nGiven an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.\nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results using the LIMIT clause.\nYou can order the results by a relevant column to return the most interesting examples in the database.\nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.\nYou have access to tools for interacting with the database.\nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.\nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.\n\nDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.\n\nIf the question does not seem related to the database, just return \"I don't know\" as the answer.","description":"Prefix prompt to use for the agent","typeOptions":{"rows":10}},{"displayName":"Suffix Prompt","name":"suffixPrompt","type":"string","default":"Begin!\n\nQuestion: {input}\nThought: I should look at the tables in the database to see what I can query.\n{agent_scratchpad}","description":"Suffix prompt to use for the agent","typeOptions":{"rows":4}},{"displayName":"Limit","name":"topK","type":"number","default":10,"description":"The maximum number of results to return"}]},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["planAndExecuteAgent"],"@version":[1]}},"default":"={{ $json.input }}"},{"displayName":"Text","name":"text","type":"string","required":true,"displayOptions":{"show":{"agent":["planAndExecuteAgent"],"@version":[1.1]}},"default":"={{ $json.chat_input }}"},{"displayName":"Options","name":"options","type":"collection","displayOptions":{"show":{"agent":["planAndExecuteAgent"]}},"default":{},"placeholder":"Add Option","options":[{"displayName":"Human Message Template","name":"humanMessageTemplate","type":"string","default":"Previous steps: {previous_steps}\n\nCurrent objective: {current_step}\n\n{agent_scratchpad}\n\nYou may extract and combine relevant data from your previous steps when responding to me.","description":"The message that will be sent to the agent during each step execution","typeOptions":{"rows":6}}]}]},
|
|
3
3
|
{"displayName":"OpenAI Assistant","name":"@n8n/n8n-nodes-langchain.openAiAssistant","icon":"fa:robot","group":["transform"],"version":1,"description":"Utilizes Assistant API from Open AI.","subtitle":"Open AI Assistant","defaults":{"name":"OpenAI Assistant","color":"#404040"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Agents"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.openaiassistant/"}]}},"inputs":[{"type":"main"},{"type":"ai_tool","displayName":"Tools"}],"outputs":["main"],"credentials":[{"name":"openAiApi","required":true}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"={{ $parameter.options?.baseURL?.split(\"/\").slice(0,-1).join(\"/\") || \"https://api.openai.com\" }}"},"properties":[{"displayName":"Operation","name":"mode","type":"options","noDataExpression":true,"default":"existing","options":[{"name":"Use New Assistant","value":"new"},{"name":"Use Existing Assistant","value":"existing"}]},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"displayOptions":{"show":{"/mode":["new"]}}},{"displayName":"Instructions","name":"instructions","type":"string","description":"How the Assistant and model should behave or respond","default":"","typeOptions":{"rows":5},"displayOptions":{"show":{"/mode":["new"]}}},{"displayName":"Model","name":"model","type":"options","description":"The model which will be used to power the assistant. <a href=\"https://beta.openai.com/docs/models/overview\">Learn more</a>. The Retrieval tool requires gpt-3.5-turbo-1106 and gpt-4-1106-preview models.","required":true,"displayOptions":{"show":{"/mode":["new"]}},"typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"={{ $parameter.options?.baseURL?.split(\"/\").slice(-1).pop() || \"v1\" }}/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"filter","properties":{"pass":"={{ $responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct') }}"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.id}}","value":"={{$responseItem.id}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"gpt-3.5-turbo-1106"},{"displayName":"Assistant","name":"assistantId","type":"options","noDataExpression":true,"displayOptions":{"show":{"/mode":["existing"]}},"description":"The assistant to use. <a href=\"https://beta.openai.com/docs/assistants/overview\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","headers":{"OpenAI-Beta":"assistants=v1"},"url":"={{ $parameter.options?.baseURL?.split(\"/\").slice(-1).pop() || \"v1\" }}/assistants"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.name}}","value":"={{$responseItem.id}}","description":"={{$responseItem.model}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"assistant"}},"required":true,"default":""},{"displayName":"Text","name":"text","type":"string","required":true,"default":"={{ $json.chat_input }}"},{"displayName":"OpenAI Tools","name":"nativeTools","type":"multiOptions","default":[],"options":[{"name":"Code Interpreter","value":"code_interpreter"},{"name":"Knowledge Retrieval","value":"retrieval"}]},{"displayName":"Connect your own custom tools to this node on the canvas","name":"noticeTools","type":"notice","default":""},{"displayName":"Upload files for retrieval using the <a href=\"https://platform.openai.com/playground\" target=\"_blank\">OpenAI website<a/>","name":"noticeTools","type":"notice","typeOptions":{"noticeTheme":"info"},"displayOptions":{"show":{"/nativeTools":["retrieval"]}},"default":""},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Base URL","name":"baseURL","default":"https://api.openai.com/v1","description":"Override the default base URL for the API","type":"string"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt","type":"number"},{"displayName":"Timeout","name":"timeout","default":10000,"description":"Maximum amount of time a request is allowed to take in milliseconds","type":"number"}]}]},
|
|
4
4
|
{"displayName":"Summarization Chain","name":"@n8n/n8n-nodes-langchain.chainSummarization","icon":"fa:link","group":["transform"],"description":"Transforms text into a concise summary","codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainsummarization/"}]}},"defaultVersion":2,"version":[2],"defaults":{"name":"Summarization Chain","color":"#909298"},"inputs":"={{ ((parameter) => { function getInputs(parameters) {\n const chunkingMode = parameters === null || parameters === void 0 ? void 0 : parameters.chunkingMode;\n const operationMode = parameters === null || parameters === void 0 ? void 0 : parameters.operationMode;\n const inputs = [\n { displayName: '', type: \"main\" },\n {\n displayName: 'Model',\n maxConnections: 1,\n type: \"ai_languageModel\",\n required: true,\n },\n ];\n if (operationMode === 'documentLoader') {\n inputs.push({\n displayName: 'Document',\n type: \"ai_document\",\n required: true,\n maxConnections: 1,\n });\n return inputs;\n }\n if (chunkingMode === 'advanced') {\n inputs.push({\n displayName: 'Text Splitter',\n type: \"ai_textSplitter\",\n required: false,\n maxConnections: 1,\n });\n return inputs;\n }\n return inputs;\n}; return getInputs(parameter) })($parameter) }}","outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1951\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Data to Summarize","name":"operationMode","noDataExpression":true,"type":"options","description":"How to pass data into the summarization chain","default":"nodeInputJson","options":[{"name":"Use Node Input (JSON)","value":"nodeInputJson","description":"Summarize the JSON data coming into this node from the previous one"},{"name":"Use Node Input (Binary)","value":"nodeInputBinary","description":"Summarize the binary data coming into this node from the previous one"},{"name":"Use Document Loader","value":"documentLoader","description":"Use a loader sub-node with more configuration options"}]},{"displayName":"Chunking Strategy","name":"chunkingMode","noDataExpression":true,"type":"options","description":"Chunk splitting strategy","default":"simple","options":[{"name":"Simple (Define Below)","value":"simple"},{"name":"Advanced","value":"advanced","description":"Use a splitter sub-node with more configuration options"}],"displayOptions":{"show":{"/operationMode":["nodeInputJson","nodeInputBinary"]}}},{"displayName":"Characters Per Chunk","name":"chunkSize","description":"Controls the max size (in terms of number of characters) of the final document chunk","type":"number","default":1000,"displayOptions":{"show":{"/chunkingMode":["simple"]}}},{"displayName":"Chunk Overlap (Characters)","name":"chunkOverlap","type":"number","description":"Specifies how much characters overlap there should be between chunks","default":200,"displayOptions":{"show":{"/chunkingMode":["simple"]}}},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"Input Data Field Name","name":"binaryDataKey","type":"string","default":"data","description":"The name of the field in the agent or chain’s input that contains the binary file to be processed","displayOptions":{"show":{"/operationMode":["nodeInputBinary"]}}},{"displayName":"Summarization Method and Prompts","name":"summarizationMethodAndPrompts","type":"fixedCollection","default":{"values":{"summarizationMethod":"map_reduce","prompt":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","combineMapPrompt":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:"}},"placeholder":"Add Option","typeOptions":{},"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Summarization Method","name":"summarizationMethod","type":"options","description":"The type of summarization to run","default":"map_reduce","options":[{"name":"Map Reduce (Recommended)","value":"map_reduce","description":"Summarize each document (or chunk) individually, then summarize those summaries"},{"name":"Refine","value":"refine","description":"Summarize the first document (or chunk). Then update that summary based on the next document (or chunk), and repeat."},{"name":"Stuff","value":"stuff","description":"Pass all documents (or chunks) at once. Ideal for small datasets."}]},{"displayName":"Final Prompt to Combine","name":"combineMapPrompt","type":"string","hint":"The prompt to combine individual summaries","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","refine"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","typeOptions":{"rows":9}},{"displayName":"Individual Summary Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt to summarize an individual document (or chunk)","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","refine"]}},"typeOptions":{"rows":9}},{"displayName":"Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["refine","map_reduce"]}},"typeOptions":{"rows":9}},{"displayName":"Subsequent (Refine) Prompt","name":"refinePrompt","type":"string","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","map_reduce"]}},"default":"Your job is to produce a final summary\nWe have provided an existing summary up to a certain point: \"{existing_answer}\"\nWe have the opportunity to refine the existing summary\n(only if needed) with some more context below.\n------------\n\"{text}\"\n------------\n\nGiven the new context, refine the original summary\nIf the context isn't useful, return the original summary.\n\nREFINED SUMMARY:","hint":"The prompt to refine the summary based on the next document (or chunk)","typeOptions":{"rows":9}},{"displayName":"Initial Prompt","name":"refineQuestionPrompt","type":"string","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","map_reduce"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt for the first document (or chunk)","typeOptions":{"rows":9}}]}]}]}]},
|
|
5
5
|
{"displayName":"Summarization Chain","name":"@n8n/n8n-nodes-langchain.chainSummarization","icon":"fa:link","group":["transform"],"description":"Transforms text into a concise summary","codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainsummarization/"}]}},"defaultVersion":2,"version":1,"defaults":{"name":"Summarization Chain","color":"#909298"},"inputs":["main",{"displayName":"Model","maxConnections":1,"type":"ai_languageModel","required":true},{"displayName":"Document","maxConnections":1,"type":"ai_document","required":true}],"outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1951\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Type","name":"type","type":"options","description":"The type of summarization to run","default":"map_reduce","options":[{"name":"Map Reduce (Recommended)","value":"map_reduce","description":"Summarize each document (or chunk) individually, then summarize those summaries"},{"name":"Refine","value":"refine","description":"Summarize the first document (or chunk). Then update that summary based on the next document (or chunk), and repeat."},{"name":"Stuff","value":"stuff","description":"Pass all documents (or chunks) at once. Ideal for small datasets."}]},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"Final Prompt to Combine","name":"combineMapPrompt","type":"string","hint":"The prompt to combine individual summaries","displayOptions":{"show":{"/type":["map_reduce"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","typeOptions":{"rows":6}},{"displayName":"Individual Summary Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt to summarize an individual document (or chunk)","displayOptions":{"show":{"/type":["map_reduce"]}},"typeOptions":{"rows":6}},{"displayName":"Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","displayOptions":{"show":{"/type":["stuff"]}},"typeOptions":{"rows":6}},{"displayName":"Subsequent (Refine) Prompt","name":"refinePrompt","type":"string","displayOptions":{"show":{"/type":["refine"]}},"default":"Your job is to produce a final summary\nWe have provided an existing summary up to a certain point: \"{existing_answer}\"\nWe have the opportunity to refine the existing summary\n(only if needed) with some more context below.\n------------\n\"{text}\"\n------------\n\nGiven the new context, refine the original summary\nIf the context isn't useful, return the original summary.\n\nREFINED SUMMARY:","hint":"The prompt to refine the summary based on the next document (or chunk)","typeOptions":{"rows":6}},{"displayName":"Initial Prompt","name":"refineQuestionPrompt","type":"string","displayOptions":{"show":{"/type":["refine"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt for the first document (or chunk)","typeOptions":{"rows":6}}]}]},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/n8n-nodes-langchain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://n8n.io",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@types/temp": "^0.9.1",
|
|
99
99
|
"eslint-plugin-n8n-nodes-base": "^1.16.0",
|
|
100
100
|
"gulp": "^4.0.2",
|
|
101
|
-
"n8n-core": "1.
|
|
101
|
+
"n8n-core": "1.22.0"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"@aws-sdk/client-bedrock-runtime": "3.454.0",
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
"typeorm": "0.3.17",
|
|
128
128
|
"zod": "3.22.4",
|
|
129
129
|
"zod-to-json-schema": "3.22.0",
|
|
130
|
-
"n8n-
|
|
131
|
-
"n8n-
|
|
130
|
+
"n8n-nodes-base": "1.22.1",
|
|
131
|
+
"n8n-workflow": "1.22.0"
|
|
132
132
|
},
|
|
133
133
|
"scripts": {
|
|
134
134
|
"clean": "rimraf dist .turbo",
|