@n8n/n8n-nodes-langchain 1.101.2 → 1.102.0
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/credentials/CohereApi.credentials.js +7 -1
- package/dist/credentials/CohereApi.credentials.js.map +1 -1
- package/dist/known/credentials.json +2 -0
- package/dist/known/nodes.json +12 -0
- package/dist/nodes/agents/Agent/Agent.node.js +1 -0
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/AgentTool.node.js +57 -0
- package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js +104 -0
- package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js +4 -66
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
- package/dist/nodes/agents/Agent/V2/utils.js +92 -0
- package/dist/nodes/agents/Agent/V2/utils.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +13 -10
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +14 -7
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -1
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +1 -1
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +6 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +2 -2
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js +181 -0
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js.map +1 -0
- package/dist/nodes/llms/LmChatCohere/cohere.dark.svg +5 -0
- package/dist/nodes/llms/LmChatCohere/cohere.svg +5 -0
- package/dist/nodes/llms/N8nLlmTracing.js +4 -4
- package/dist/nodes/llms/N8nLlmTracing.js.map +1 -1
- package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js +1 -1
- package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js.map +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +1 -2
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +1 -2
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +2 -2
- package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +2 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/templates.js +3 -1
- package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +2 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -1
- package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js +42 -0
- package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js +74 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js +184 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js +119 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +167 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/index.js +74 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/node.type.js +17 -0
- package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/router.js +97 -0
- package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +339 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +131 -0
- package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js +88 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js +228 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/index.js +84 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/gemini.svg +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js +100 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +91 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/methods/index.js +39 -0
- package/dist/nodes/vendors/GoogleGemini/methods/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +74 -0
- package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/transport/index.js +48 -0
- package/dist/nodes/vendors/GoogleGemini/transport/index.js.map +1 -0
- package/dist/types/credentials.json +2 -2
- package/dist/types/nodes.json +4 -1
- package/dist/utils/descriptions.js +13 -2
- package/dist/utils/descriptions.js.map +1 -1
- package/dist/utils/helpers.js +2 -7
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -1
- package/package.json +10 -6
|
@@ -34,6 +34,12 @@ class CohereApi {
|
|
|
34
34
|
typeOptions: { password: true },
|
|
35
35
|
required: true,
|
|
36
36
|
default: ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: "Base URL",
|
|
40
|
+
name: "url",
|
|
41
|
+
type: "hidden",
|
|
42
|
+
default: "https://api.cohere.ai"
|
|
37
43
|
}
|
|
38
44
|
];
|
|
39
45
|
this.authenticate = {
|
|
@@ -46,7 +52,7 @@ class CohereApi {
|
|
|
46
52
|
};
|
|
47
53
|
this.test = {
|
|
48
54
|
request: {
|
|
49
|
-
baseURL: "
|
|
55
|
+
baseURL: "={{ $credentials.url }}",
|
|
50
56
|
url: "/v1/models?page_size=1"
|
|
51
57
|
}
|
|
52
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../credentials/CohereApi.credentials.ts"],"sourcesContent":["import type {\n\tIAuthenticateGeneric,\n\tICredentialTestRequest,\n\tICredentialType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nexport class CohereApi implements ICredentialType {\n\tname = 'cohereApi';\n\n\tdisplayName = 'CohereApi';\n\n\tdocumentationUrl = 'cohere';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\tAuthorization: '=Bearer {{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n\n\ttest: ICredentialTestRequest = {\n\t\trequest: {\n\t\t\tbaseURL: '
|
|
1
|
+
{"version":3,"sources":["../../credentials/CohereApi.credentials.ts"],"sourcesContent":["import type {\n\tIAuthenticateGeneric,\n\tICredentialTestRequest,\n\tICredentialType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nexport class CohereApi implements ICredentialType {\n\tname = 'cohereApi';\n\n\tdisplayName = 'CohereApi';\n\n\tdocumentationUrl = 'cohere';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'API Key',\n\t\t\tname: 'apiKey',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: { password: true },\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Base URL',\n\t\t\tname: 'url',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'https://api.cohere.ai',\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\tAuthorization: '=Bearer {{$credentials.apiKey}}',\n\t\t\t},\n\t\t},\n\t};\n\n\ttest: ICredentialTestRequest = {\n\t\trequest: {\n\t\t\tbaseURL: '={{ $credentials.url }}',\n\t\t\turl: '/v1/models?page_size=1',\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,UAAqC;AAAA,EAA3C;AACN,gBAAO;AAEP,uBAAc;AAEd,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,aAAa,EAAE,UAAU,KAAK;AAAA,QAC9B,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,IACD;AAEA,wBAAqC;AAAA,MACpC,MAAM;AAAA,MACN,YAAY;AAAA,QACX,SAAS;AAAA,UACR,eAAe;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEA,gBAA+B;AAAA,MAC9B,SAAS;AAAA,QACR,SAAS;AAAA,QACT,KAAK;AAAA,MACN;AAAA,IACD;AAAA;AACD;","names":[]}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"sourcePath": "dist/credentials/CohereApi.credentials.js",
|
|
30
30
|
"supportedNodes": [
|
|
31
31
|
"embeddingsCohere",
|
|
32
|
+
"lmChatCohere",
|
|
32
33
|
"lmCohere",
|
|
33
34
|
"rerankerCohere"
|
|
34
35
|
]
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"className": "GooglePalmApi",
|
|
45
46
|
"sourcePath": "dist/credentials/GooglePalmApi.credentials.js",
|
|
46
47
|
"supportedNodes": [
|
|
48
|
+
"googleGemini",
|
|
47
49
|
"embeddingsGoogleGemini",
|
|
48
50
|
"lmChatGoogleGemini"
|
|
49
51
|
]
|
package/dist/known/nodes.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"googleGemini": {
|
|
3
|
+
"className": "GoogleGemini",
|
|
4
|
+
"sourcePath": "dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js"
|
|
5
|
+
},
|
|
2
6
|
"openAi": {
|
|
3
7
|
"className": "OpenAi",
|
|
4
8
|
"sourcePath": "dist/nodes/vendors/OpenAi/OpenAi.node.js"
|
|
@@ -7,6 +11,10 @@
|
|
|
7
11
|
"className": "Agent",
|
|
8
12
|
"sourcePath": "dist/nodes/agents/Agent/Agent.node.js"
|
|
9
13
|
},
|
|
14
|
+
"agentTool": {
|
|
15
|
+
"className": "AgentTool",
|
|
16
|
+
"sourcePath": "dist/nodes/agents/Agent/AgentTool.node.js"
|
|
17
|
+
},
|
|
10
18
|
"openAiAssistant": {
|
|
11
19
|
"className": "OpenAiAssistant",
|
|
12
20
|
"sourcePath": "dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js"
|
|
@@ -103,6 +111,10 @@
|
|
|
103
111
|
"className": "LmChatAwsBedrock",
|
|
104
112
|
"sourcePath": "dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js"
|
|
105
113
|
},
|
|
114
|
+
"lmChatCohere": {
|
|
115
|
+
"className": "LmChatCohere",
|
|
116
|
+
"sourcePath": "dist/nodes/llms/LmChatCohere/LmChatCohere.node.js"
|
|
117
|
+
},
|
|
106
118
|
"lmChatDeepSeek": {
|
|
107
119
|
"className": "LmChatDeepSeek",
|
|
108
120
|
"sourcePath": "dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js"
|
|
@@ -64,6 +64,7 @@ class Agent extends import_n8n_workflow.VersionedNodeType {
|
|
|
64
64
|
2: new import_AgentV2.AgentV2(baseDescription),
|
|
65
65
|
2.1: new import_AgentV2.AgentV2(baseDescription),
|
|
66
66
|
2.2: new import_AgentV2.AgentV2(baseDescription)
|
|
67
|
+
// IMPORTANT Reminder to update AgentTool
|
|
67
68
|
};
|
|
68
69
|
super(nodeVersions, baseDescription);
|
|
69
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/agents/Agent/Agent.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentV1 } from './V1/AgentV1.node';\nimport { AgentV2 } from './V2/AgentV2.node';\n\nexport class Agent extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent',\n\t\t\tname: 'agent',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Agents', 'Root Nodes'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t// We keep defaultVersion as 2.1 to ensure we publish streaming when everything is ready\n\t\t\tdefaultVersion: 2.1,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t1: new AgentV1(baseDescription),\n\t\t\t1.1: new AgentV1(baseDescription),\n\t\t\t1.2: new AgentV1(baseDescription),\n\t\t\t1.3: new AgentV1(baseDescription),\n\t\t\t1.4: new AgentV1(baseDescription),\n\t\t\t1.5: new AgentV1(baseDescription),\n\t\t\t1.6: new AgentV1(baseDescription),\n\t\t\t1.7: new AgentV1(baseDescription),\n\t\t\t1.8: new AgentV1(baseDescription),\n\t\t\t1.9: new AgentV1(baseDescription),\n\t\t\t2: new AgentV2(baseDescription),\n\t\t\t2.1: new AgentV2(baseDescription),\n\t\t\t2.2: new AgentV2(baseDescription),\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,qBAAwB;AACxB,qBAAwB;AAEjB,MAAM,cAAc,sCAAkB;AAAA,EAC5C,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,UAAU,YAAY;AAAA,QAC5B;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA,MACxD,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/agents/Agent/Agent.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentV1 } from './V1/AgentV1.node';\nimport { AgentV2 } from './V2/AgentV2.node';\n\nexport class Agent extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent',\n\t\t\tname: 'agent',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Agents', 'Root Nodes'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\t// We keep defaultVersion as 2.1 to ensure we publish streaming when everything is ready\n\t\t\tdefaultVersion: 2.1,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t1: new AgentV1(baseDescription),\n\t\t\t1.1: new AgentV1(baseDescription),\n\t\t\t1.2: new AgentV1(baseDescription),\n\t\t\t1.3: new AgentV1(baseDescription),\n\t\t\t1.4: new AgentV1(baseDescription),\n\t\t\t1.5: new AgentV1(baseDescription),\n\t\t\t1.6: new AgentV1(baseDescription),\n\t\t\t1.7: new AgentV1(baseDescription),\n\t\t\t1.8: new AgentV1(baseDescription),\n\t\t\t1.9: new AgentV1(baseDescription),\n\t\t\t2: new AgentV2(baseDescription),\n\t\t\t2.1: new AgentV2(baseDescription),\n\t\t\t2.2: new AgentV2(baseDescription),\n\t\t\t// IMPORTANT Reminder to update AgentTool\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,qBAAwB;AACxB,qBAAwB;AAEjB,MAAM,cAAc,sCAAkB;AAAA,EAC5C,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,UAAU,YAAY;AAAA,QAC5B;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA,MACxD,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,GAAG,IAAI,uBAAQ,eAAe;AAAA,MAC9B,KAAK,IAAI,uBAAQ,eAAe;AAAA,MAChC,KAAK,IAAI,uBAAQ,eAAe;AAAA;AAAA,IAEjC;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var AgentTool_node_exports = {};
|
|
20
|
+
__export(AgentTool_node_exports, {
|
|
21
|
+
AgentTool: () => AgentTool
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(AgentTool_node_exports);
|
|
24
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
25
|
+
var import_AgentToolV2 = require("./V2/AgentToolV2.node");
|
|
26
|
+
class AgentTool extends import_n8n_workflow.VersionedNodeType {
|
|
27
|
+
constructor() {
|
|
28
|
+
const baseDescription = {
|
|
29
|
+
displayName: "AI Agent Tool",
|
|
30
|
+
name: "agentTool",
|
|
31
|
+
icon: "fa:robot",
|
|
32
|
+
iconColor: "black",
|
|
33
|
+
group: ["transform"],
|
|
34
|
+
description: "Generates an action plan and executes it. Can use external tools.",
|
|
35
|
+
codex: {
|
|
36
|
+
alias: ["LangChain", "Chat", "Conversational", "Plan and Execute", "ReAct", "Tools"],
|
|
37
|
+
categories: ["AI"],
|
|
38
|
+
subcategories: {
|
|
39
|
+
AI: ["Tools"],
|
|
40
|
+
Tools: ["Other Tools"]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVersion: 2.2
|
|
44
|
+
};
|
|
45
|
+
const nodeVersions = {
|
|
46
|
+
// Should have the same versioning as Agent node
|
|
47
|
+
// because internal agent logic often checks for node version
|
|
48
|
+
2.2: new import_AgentToolV2.AgentToolV2(baseDescription)
|
|
49
|
+
};
|
|
50
|
+
super(nodeVersions, baseDescription);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
AgentTool
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=AgentTool.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/agents/Agent/AgentTool.node.ts"],"sourcesContent":["import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';\nimport { VersionedNodeType } from 'n8n-workflow';\n\nimport { AgentToolV2 } from './V2/AgentToolV2.node';\n\nexport class AgentTool extends VersionedNodeType {\n\tconstructor() {\n\t\tconst baseDescription: INodeTypeBaseDescription = {\n\t\t\tdisplayName: 'AI Agent Tool',\n\t\t\tname: 'agentTool',\n\t\t\ticon: 'fa:robot',\n\t\t\ticonColor: 'black',\n\t\t\tgroup: ['transform'],\n\t\t\tdescription: 'Generates an action plan and executes it. Can use external tools.',\n\t\t\tcodex: {\n\t\t\t\talias: ['LangChain', 'Chat', 'Conversational', 'Plan and Execute', 'ReAct', 'Tools'],\n\t\t\t\tcategories: ['AI'],\n\t\t\t\tsubcategories: {\n\t\t\t\t\tAI: ['Tools'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaultVersion: 2.2,\n\t\t};\n\n\t\tconst nodeVersions: IVersionedNodeType['nodeVersions'] = {\n\t\t\t// Should have the same versioning as Agent node\n\t\t\t// because internal agent logic often checks for node version\n\t\t\t2.2: new AgentToolV2(baseDescription),\n\t\t};\n\n\t\tsuper(nodeVersions, baseDescription);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAkC;AAElC,yBAA4B;AAErB,MAAM,kBAAkB,sCAAkB;AAAA,EAChD,cAAc;AACb,UAAM,kBAA4C;AAAA,MACjD,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,aAAa,QAAQ,kBAAkB,oBAAoB,SAAS,OAAO;AAAA,QACnF,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,OAAO;AAAA,UACZ,OAAO,CAAC,aAAa;AAAA,QACtB;AAAA,MACD;AAAA,MACA,gBAAgB;AAAA,IACjB;AAEA,UAAM,eAAmD;AAAA;AAAA;AAAA,MAGxD,KAAK,IAAI,+BAAY,eAAe;AAAA,IACrC;AAEA,UAAM,cAAc,eAAe;AAAA,EACpC;AACD;","names":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var AgentToolV2_node_exports = {};
|
|
20
|
+
__export(AgentToolV2_node_exports, {
|
|
21
|
+
AgentToolV2: () => AgentToolV2
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(AgentToolV2_node_exports);
|
|
24
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
25
|
+
var import_descriptions = require("../../../../utils/descriptions");
|
|
26
|
+
var import_utils = require("./utils");
|
|
27
|
+
var import_description = require("../agents/ToolsAgent/V2/description");
|
|
28
|
+
var import_execute = require("../agents/ToolsAgent/V2/execute");
|
|
29
|
+
class AgentToolV2 {
|
|
30
|
+
constructor(baseDescription) {
|
|
31
|
+
this.description = {
|
|
32
|
+
...baseDescription,
|
|
33
|
+
version: [2.2],
|
|
34
|
+
defaults: {
|
|
35
|
+
name: "AI Agent Tool",
|
|
36
|
+
color: "#404040"
|
|
37
|
+
},
|
|
38
|
+
inputs: `={{
|
|
39
|
+
((hasOutputParser, needsFallback) => {
|
|
40
|
+
${import_utils.getInputs.toString()};
|
|
41
|
+
return getInputs(false, hasOutputParser, needsFallback)
|
|
42
|
+
})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)
|
|
43
|
+
}}`,
|
|
44
|
+
outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool],
|
|
45
|
+
properties: [
|
|
46
|
+
import_descriptions.toolDescription,
|
|
47
|
+
{
|
|
48
|
+
...import_descriptions.textInput
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: "Require Specific Output Format",
|
|
52
|
+
name: "hasOutputParser",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
default: false,
|
|
55
|
+
noDataExpression: true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${import_n8n_workflow.NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,
|
|
59
|
+
name: "notice",
|
|
60
|
+
type: "notice",
|
|
61
|
+
default: "",
|
|
62
|
+
displayOptions: {
|
|
63
|
+
show: {
|
|
64
|
+
hasOutputParser: [true]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: "Enable Fallback Model",
|
|
70
|
+
name: "needsFallback",
|
|
71
|
+
type: "boolean",
|
|
72
|
+
default: false,
|
|
73
|
+
noDataExpression: true,
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: {
|
|
76
|
+
"@version": [{ _cnd: { gte: 2.1 } }]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: "Connect an additional language model on the canvas to use it as a fallback if the main model fails",
|
|
82
|
+
name: "fallbackNotice",
|
|
83
|
+
type: "notice",
|
|
84
|
+
default: "",
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
needsFallback: [true]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
...(0, import_description.getToolsAgentProperties)({ withStreaming: false })
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// Automatically wrapped as a tool
|
|
96
|
+
async execute() {
|
|
97
|
+
return await import_execute.toolsAgentExecute.call(this);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
AgentToolV2
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=AgentToolV2.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/agents/Agent/V2/AgentToolV2.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n\tISupplyDataFunctions,\n} from 'n8n-workflow';\n\nimport { textInput, toolDescription } from '@utils/descriptions';\n\nimport { getInputs } from './utils';\nimport { getToolsAgentProperties } from '../agents/ToolsAgent/V2/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V2/execute';\n\nexport class AgentToolV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [2.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent Tool',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(false, hasOutputParser, needsFallback)\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.AiTool],\n\t\t\tproperties: [\n\t\t\t\ttoolDescription,\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 2.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...getToolsAgentProperties({ withStreaming: false }),\n\t\t\t],\n\t\t};\n\t}\n\n\t// Automatically wrapped as a tool\n\tasync execute(this: IExecuteFunctions | ISupplyDataFunctions): Promise<INodeExecutionData[][]> {\n\t\treturn await toolsAgentExecute.call(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AAUpC,0BAA2C;AAE3C,mBAA0B;AAC1B,yBAAwC;AACxC,qBAAkC;AAE3B,MAAM,YAAiC;AAAA,EAE7C,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,GAAG;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,MAAM;AAAA,MACpC,YAAY;AAAA,QACX;AAAA,QACA;AAAA,UACC,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,UAC7I,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,iBAAiB,CAAC,IAAI;AAAA,YACvB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,UAClB,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,YACpC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,eAAe,CAAC,IAAI;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA,OAAG,4CAAwB,EAAE,eAAe,MAAM,CAAC;AAAA,MACpD;AAAA,IACD;AAAA,EACD;AAAA;AAAA,EAGA,MAAM,UAAyF;AAC9F,WAAO,MAAM,iCAAkB,KAAK,IAAI;AAAA,EACzC;AACD;","names":[]}
|
|
@@ -23,71 +23,9 @@ __export(AgentV2_node_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(AgentV2_node_exports);
|
|
24
24
|
var import_n8n_workflow = require("n8n-workflow");
|
|
25
25
|
var import_descriptions = require("../../../../utils/descriptions");
|
|
26
|
+
var import_utils = require("./utils");
|
|
26
27
|
var import_description = require("../agents/ToolsAgent/V2/description");
|
|
27
28
|
var import_execute = require("../agents/ToolsAgent/V2/execute");
|
|
28
|
-
function getInputs(hasOutputParser, needsFallback) {
|
|
29
|
-
const getInputData = (inputs) => {
|
|
30
|
-
return inputs.map(({ type, filter, displayName, required }) => {
|
|
31
|
-
const input = {
|
|
32
|
-
type,
|
|
33
|
-
displayName,
|
|
34
|
-
required,
|
|
35
|
-
maxConnections: ["ai_languageModel", "ai_memory", "ai_outputParser"].includes(type) ? 1 : void 0
|
|
36
|
-
};
|
|
37
|
-
if (filter) {
|
|
38
|
-
input.filter = filter;
|
|
39
|
-
}
|
|
40
|
-
return input;
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
let specialInputs = [
|
|
44
|
-
{
|
|
45
|
-
type: "ai_languageModel",
|
|
46
|
-
displayName: "Chat Model",
|
|
47
|
-
required: true,
|
|
48
|
-
filter: {
|
|
49
|
-
excludedNodes: [
|
|
50
|
-
"@n8n/n8n-nodes-langchain.lmCohere",
|
|
51
|
-
"@n8n/n8n-nodes-langchain.lmOllama",
|
|
52
|
-
"n8n/n8n-nodes-langchain.lmOpenAi",
|
|
53
|
-
"@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: "ai_languageModel",
|
|
59
|
-
displayName: "Fallback Model",
|
|
60
|
-
required: true,
|
|
61
|
-
filter: {
|
|
62
|
-
excludedNodes: [
|
|
63
|
-
"@n8n/n8n-nodes-langchain.lmCohere",
|
|
64
|
-
"@n8n/n8n-nodes-langchain.lmOllama",
|
|
65
|
-
"n8n/n8n-nodes-langchain.lmOpenAi",
|
|
66
|
-
"@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
displayName: "Memory",
|
|
72
|
-
type: "ai_memory"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
displayName: "Tool",
|
|
76
|
-
type: "ai_tool"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
displayName: "Output Parser",
|
|
80
|
-
type: "ai_outputParser"
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
|
-
if (hasOutputParser === false) {
|
|
84
|
-
specialInputs = specialInputs.filter((input) => input.type !== "ai_outputParser");
|
|
85
|
-
}
|
|
86
|
-
if (needsFallback === false) {
|
|
87
|
-
specialInputs = specialInputs.filter((input) => input.displayName !== "Fallback Model");
|
|
88
|
-
}
|
|
89
|
-
return ["main", ...getInputData(specialInputs)];
|
|
90
|
-
}
|
|
91
29
|
class AgentV2 {
|
|
92
30
|
constructor(baseDescription) {
|
|
93
31
|
this.description = {
|
|
@@ -99,8 +37,8 @@ class AgentV2 {
|
|
|
99
37
|
},
|
|
100
38
|
inputs: `={{
|
|
101
39
|
((hasOutputParser, needsFallback) => {
|
|
102
|
-
${getInputs.toString()};
|
|
103
|
-
return getInputs(hasOutputParser, needsFallback)
|
|
40
|
+
${import_utils.getInputs.toString()};
|
|
41
|
+
return getInputs(true, hasOutputParser, needsFallback);
|
|
104
42
|
})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)
|
|
105
43
|
}}`,
|
|
106
44
|
outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
@@ -169,7 +107,7 @@ class AgentV2 {
|
|
|
169
107
|
}
|
|
170
108
|
}
|
|
171
109
|
},
|
|
172
|
-
...import_description.
|
|
110
|
+
...(0, import_description.getToolsAgentProperties)({ withStreaming: true })
|
|
173
111
|
],
|
|
174
112
|
hints: [
|
|
175
113
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/agents/Agent/V2/AgentV2.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/agents/Agent/V2/AgentV2.node.ts"],"sourcesContent":["import { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeTypeBaseDescription,\n} from 'n8n-workflow';\n\nimport { promptTypeOptions, textFromPreviousNode, textInput } from '@utils/descriptions';\n\nimport { getInputs } from './utils';\nimport { getToolsAgentProperties } from '../agents/ToolsAgent/V2/description';\nimport { toolsAgentExecute } from '../agents/ToolsAgent/V2/execute';\n\nexport class AgentV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [2, 2.1, 2.2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'AI Agent',\n\t\t\t\tcolor: '#404040',\n\t\t\t},\n\t\t\tinputs: `={{\n\t\t\t\t((hasOutputParser, needsFallback) => {\n\t\t\t\t\t${getInputs.toString()};\n\t\t\t\t\treturn getInputs(true, hasOutputParser, needsFallback);\n\t\t\t\t})($parameter.hasOutputParser === undefined || $parameter.hasOutputParser === true, $parameter.needsFallback !== undefined && $parameter.needsFallback === true)\n\t\t\t}}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tproperties: [\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Tip: Get a feel for agents with our quick <a href=\"https://docs.n8n.io/advanced-ai/intro-tutorial/\" target=\"_blank\">tutorial</a> or see an <a href=\"/workflows/templates/1954\" target=\"_blank\">example</a> of how this node works',\n\t\t\t\t\tname: 'aiAgentStarterCallout',\n\t\t\t\t\ttype: 'callout',\n\t\t\t\t\tdefault: '',\n\t\t\t\t},\n\t\t\t\tpromptTypeOptions,\n\t\t\t\t{\n\t\t\t\t\t...textFromPreviousNode,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['auto'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...textInput,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tpromptType: ['define'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Require Specific Output Format',\n\t\t\t\t\tname: 'hasOutputParser',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\t\t\t\tname: 'notice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\thasOutputParser: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Enable Fallback Model',\n\t\t\t\t\tname: 'needsFallback',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 2.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\t\t\t\tname: 'fallbackNotice',\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tneedsFallback: [true],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...getToolsAgentProperties({ withStreaming: true }),\n\t\t\t],\n\t\t\thints: [\n\t\t\t\t{\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t'You are using streaming responses. Make sure to set the response mode to \"Streaming Response\" on the connected trigger node.',\n\t\t\t\t\ttype: 'warning',\n\t\t\t\t\tlocation: 'outputPane',\n\t\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\t\tdisplayCondition: '={{ $parameter[\"enableStreaming\"] === true }}',\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\treturn await toolsAgentExecute.call(this);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoC;AASpC,0BAAmE;AAEnE,mBAA0B;AAC1B,yBAAwC;AACxC,qBAAkC;AAE3B,MAAM,QAA6B;AAAA,EAGzC,YAAY,iBAA2C;AACtD,SAAK,cAAc;AAAA,MAClB,GAAG;AAAA,MACH,SAAS,CAAC,GAAG,KAAK,GAAG;AAAA,MACrB,UAAU;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA,QAAQ;AAAA;AAAA,OAEJ,uBAAU,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA,MAIxB,SAAS,CAAC,wCAAoB,IAAI;AAAA,MAClC,YAAY;AAAA,QACX;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,MAAM;AAAA,YACpB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,QAAQ;AAAA,YACtB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,QACnB;AAAA,QACA;AAAA,UACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,UAC7I,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,iBAAiB,CAAC,IAAI;AAAA,YACvB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,kBAAkB;AAAA,UAClB,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,YACpC;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,eAAe,CAAC,IAAI;AAAA,YACrB;AAAA,UACD;AAAA,QACD;AAAA,QACA,OAAG,4CAAwB,EAAE,eAAe,KAAK,CAAC;AAAA,MACnD;AAAA,MACA,OAAO;AAAA,QACN;AAAA,UACC,SACC;AAAA,UACD,MAAM;AAAA,UACN,UAAU;AAAA,UACV,eAAe;AAAA,UACf,kBAAkB;AAAA,QACnB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,UAAkE;AACvE,WAAO,MAAM,iCAAkB,KAAK,IAAI;AAAA,EACzC;AACD;","names":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
getInputs: () => getInputs
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(utils_exports);
|
|
24
|
+
function getInputs(hasMainInput, hasOutputParser, needsFallback) {
|
|
25
|
+
const getInputData = (inputs) => {
|
|
26
|
+
return inputs.map(({ type, filter, displayName, required }) => {
|
|
27
|
+
const input = {
|
|
28
|
+
type,
|
|
29
|
+
displayName,
|
|
30
|
+
required,
|
|
31
|
+
maxConnections: ["ai_languageModel", "ai_memory", "ai_outputParser"].includes(type) ? 1 : void 0
|
|
32
|
+
};
|
|
33
|
+
if (filter) {
|
|
34
|
+
input.filter = filter;
|
|
35
|
+
}
|
|
36
|
+
return input;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
let specialInputs = [
|
|
40
|
+
{
|
|
41
|
+
type: "ai_languageModel",
|
|
42
|
+
displayName: "Chat Model",
|
|
43
|
+
required: true,
|
|
44
|
+
filter: {
|
|
45
|
+
excludedNodes: [
|
|
46
|
+
"@n8n/n8n-nodes-langchain.lmCohere",
|
|
47
|
+
"@n8n/n8n-nodes-langchain.lmOllama",
|
|
48
|
+
"n8n/n8n-nodes-langchain.lmOpenAi",
|
|
49
|
+
"@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "ai_languageModel",
|
|
55
|
+
displayName: "Fallback Model",
|
|
56
|
+
required: true,
|
|
57
|
+
filter: {
|
|
58
|
+
excludedNodes: [
|
|
59
|
+
"@n8n/n8n-nodes-langchain.lmCohere",
|
|
60
|
+
"@n8n/n8n-nodes-langchain.lmOllama",
|
|
61
|
+
"n8n/n8n-nodes-langchain.lmOpenAi",
|
|
62
|
+
"@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: "Memory",
|
|
68
|
+
type: "ai_memory"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: "Tool",
|
|
72
|
+
type: "ai_tool"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: "Output Parser",
|
|
76
|
+
type: "ai_outputParser"
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
if (hasOutputParser === false) {
|
|
80
|
+
specialInputs = specialInputs.filter((input) => input.type !== "ai_outputParser");
|
|
81
|
+
}
|
|
82
|
+
if (needsFallback === false) {
|
|
83
|
+
specialInputs = specialInputs.filter((input) => input.displayName !== "Fallback Model");
|
|
84
|
+
}
|
|
85
|
+
const mainInputs = hasMainInput ? ["main"] : [];
|
|
86
|
+
return [...mainInputs, ...getInputData(specialInputs)];
|
|
87
|
+
}
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
getInputs
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/agents/Agent/V2/utils.ts"],"sourcesContent":["// Function used in the inputs expression to figure out which inputs to\n\nimport {\n\ttype INodeInputConfiguration,\n\ttype INodeInputFilter,\n\ttype NodeConnectionType,\n} from 'n8n-workflow';\n\n// display based on the agent type\nexport function getInputs(\n\thasMainInput?: boolean,\n\thasOutputParser?: boolean,\n\tneedsFallback?: boolean,\n): Array<NodeConnectionType | INodeInputConfiguration> {\n\tinterface SpecialInput {\n\t\ttype: NodeConnectionType;\n\t\tfilter?: INodeInputFilter;\n\t\tdisplayName: string;\n\t\trequired?: boolean;\n\t}\n\n\tconst getInputData = (\n\t\tinputs: SpecialInput[],\n\t): Array<NodeConnectionType | INodeInputConfiguration> => {\n\t\treturn inputs.map(({ type, filter, displayName, required }) => {\n\t\t\tconst input: INodeInputConfiguration = {\n\t\t\t\ttype,\n\t\t\t\tdisplayName,\n\t\t\t\trequired,\n\t\t\t\tmaxConnections: ['ai_languageModel', 'ai_memory', 'ai_outputParser'].includes(type)\n\t\t\t\t\t? 1\n\t\t\t\t\t: undefined,\n\t\t\t};\n\n\t\t\tif (filter) {\n\t\t\t\tinput.filter = filter;\n\t\t\t}\n\n\t\t\treturn input;\n\t\t});\n\t};\n\n\tlet specialInputs: SpecialInput[] = [\n\t\t{\n\t\t\ttype: 'ai_languageModel',\n\t\t\tdisplayName: 'Chat Model',\n\t\t\trequired: true,\n\t\t\tfilter: {\n\t\t\t\texcludedNodes: [\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmCohere',\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmOllama',\n\t\t\t\t\t'n8n/n8n-nodes-langchain.lmOpenAi',\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'ai_languageModel',\n\t\t\tdisplayName: 'Fallback Model',\n\t\t\trequired: true,\n\t\t\tfilter: {\n\t\t\t\texcludedNodes: [\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmCohere',\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmOllama',\n\t\t\t\t\t'n8n/n8n-nodes-langchain.lmOpenAi',\n\t\t\t\t\t'@n8n/n8n-nodes-langchain.lmOpenHuggingFaceInference',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Memory',\n\t\t\ttype: 'ai_memory',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Tool',\n\t\t\ttype: 'ai_tool',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Output Parser',\n\t\t\ttype: 'ai_outputParser',\n\t\t},\n\t];\n\n\tif (hasOutputParser === false) {\n\t\tspecialInputs = specialInputs.filter((input) => input.type !== 'ai_outputParser');\n\t}\n\tif (needsFallback === false) {\n\t\tspecialInputs = specialInputs.filter((input) => input.displayName !== 'Fallback Model');\n\t}\n\n\t// Note cannot use NodeConnectionType.Main\n\t// otherwise expression won't evaluate correctly on the FE\n\tconst mainInputs = hasMainInput ? ['main' as NodeConnectionType] : [];\n\treturn [...mainInputs, ...getInputData(specialInputs)];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,SAAS,UACf,cACA,iBACA,eACsD;AAQtD,QAAM,eAAe,CACpB,WACyD;AACzD,WAAO,OAAO,IAAI,CAAC,EAAE,MAAM,QAAQ,aAAa,SAAS,MAAM;AAC9D,YAAM,QAAiC;AAAA,QACtC;AAAA,QACA;AAAA,QACA;AAAA,QACA,gBAAgB,CAAC,oBAAoB,aAAa,iBAAiB,EAAE,SAAS,IAAI,IAC/E,IACA;AAAA,MACJ;AAEA,UAAI,QAAQ;AACX,cAAM,SAAS;AAAA,MAChB;AAEA,aAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,MAAI,gBAAgC;AAAA,IACnC;AAAA,MACC,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,MACV,QAAQ;AAAA,QACP,eAAe;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,MACV,QAAQ;AAAA,QACP,eAAe;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,EACD;AAEA,MAAI,oBAAoB,OAAO;AAC9B,oBAAgB,cAAc,OAAO,CAAC,UAAU,MAAM,SAAS,iBAAiB;AAAA,EACjF;AACA,MAAI,kBAAkB,OAAO;AAC5B,oBAAgB,cAAc,OAAO,CAAC,UAAU,MAAM,gBAAgB,gBAAgB;AAAA,EACvF;AAIA,QAAM,aAAa,eAAe,CAAC,MAA4B,IAAI,CAAC;AACpE,SAAO,CAAC,GAAG,YAAY,GAAG,aAAa,aAAa,CAAC;AACtD;","names":[]}
|
|
@@ -18,12 +18,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var description_exports = {};
|
|
20
20
|
__export(description_exports, {
|
|
21
|
-
|
|
21
|
+
getToolsAgentProperties: () => getToolsAgentProperties
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(description_exports);
|
|
24
24
|
var import_sharedFields = require("../../../../../../utils/sharedFields");
|
|
25
25
|
var import_options = require("../options");
|
|
26
|
-
const
|
|
26
|
+
const enableStreaminOption = {
|
|
27
|
+
displayName: "Enable Streaming",
|
|
28
|
+
name: "enableStreaming",
|
|
29
|
+
type: "boolean",
|
|
30
|
+
default: true,
|
|
31
|
+
description: "Whether this agent will stream the response in real-time as it generates text"
|
|
32
|
+
};
|
|
33
|
+
const getToolsAgentProperties = ({
|
|
34
|
+
withStreaming
|
|
35
|
+
}) => [
|
|
27
36
|
{
|
|
28
37
|
displayName: "Options",
|
|
29
38
|
name: "options",
|
|
@@ -33,13 +42,7 @@ const toolsAgentProperties = [
|
|
|
33
42
|
options: [
|
|
34
43
|
...import_options.commonOptions,
|
|
35
44
|
(0, import_sharedFields.getBatchingOptionFields)(void 0, 1),
|
|
36
|
-
|
|
37
|
-
displayName: "Enable Streaming",
|
|
38
|
-
name: "enableStreaming",
|
|
39
|
-
type: "boolean",
|
|
40
|
-
default: true,
|
|
41
|
-
description: "Whether this agent will stream the response in real-time as it generates text"
|
|
42
|
-
}
|
|
45
|
+
...withStreaming ? [enableStreaminOption] : []
|
|
43
46
|
],
|
|
44
47
|
displayOptions: {
|
|
45
48
|
hide: {
|
|
@@ -63,6 +66,6 @@ const toolsAgentProperties = [
|
|
|
63
66
|
];
|
|
64
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
68
|
0 && (module.exports = {
|
|
66
|
-
|
|
69
|
+
getToolsAgentProperties
|
|
67
70
|
});
|
|
68
71
|
//# sourceMappingURL=description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V2/description.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport { getBatchingOptionFields } from '@utils/sharedFields';\n\nimport { commonOptions } from '../options';\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../../../nodes/agents/Agent/agents/ToolsAgent/V2/description.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport { getBatchingOptionFields } from '@utils/sharedFields';\n\nimport { commonOptions } from '../options';\n\nconst enableStreaminOption: INodeProperties = {\n\tdisplayName: 'Enable Streaming',\n\tname: 'enableStreaming',\n\ttype: 'boolean',\n\tdefault: true,\n\tdescription: 'Whether this agent will stream the response in real-time as it generates text',\n};\n\nexport const getToolsAgentProperties = ({\n\twithStreaming,\n}: { withStreaming: boolean }): INodeProperties[] => [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\tplaceholder: 'Add Option',\n\t\toptions: [\n\t\t\t...commonOptions,\n\t\t\tgetBatchingOptionFields(undefined, 1),\n\t\t\t...(withStreaming ? [enableStreaminOption] : []),\n\t\t],\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [{ _cnd: { lt: 2.2 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\tplaceholder: 'Add Option',\n\t\toptions: [...commonOptions, getBatchingOptionFields(undefined, 1)],\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [{ _cnd: { lt: 2.2 } }],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAwC;AAExC,qBAA8B;AAE9B,MAAM,uBAAwC;AAAA,EAC7C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AACd;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACvC;AACD,MAAqD;AAAA,EACpD;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,aAAa;AAAA,IACb,SAAS;AAAA,MACR,GAAG;AAAA,UACH,6CAAwB,QAAW,CAAC;AAAA,MACpC,GAAI,gBAAgB,CAAC,oBAAoB,IAAI,CAAC;AAAA,IAC/C;AAAA,IACA,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;AAAA,MACnC;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,aAAa;AAAA,IACb,SAAS,CAAC,GAAG,kCAAe,6CAAwB,QAAW,CAAC,CAAC;AAAA,IACjE,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,YAAY,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;AAAA,MACnC;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|