@n8n/n8n-nodes-langchain 1.101.2 → 1.103.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 +3 -0
- package/dist/known/nodes.json +16 -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 +13 -2
- 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/LmChatAwsBedrock/LmChatAwsBedrock.node.js +2 -0
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.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/McpClientTool/McpClientTool.node.js +55 -5
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/loadOptions.js +11 -2
- package/dist/nodes/mcp/McpClientTool/loadOptions.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/types.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/utils.js +21 -11
- package/dist/nodes/mcp/McpClientTool/utils.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/ToolThink/ToolThink.node.js +5 -2
- package/dist/nodes/tools/ToolThink/ToolThink.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/Anthropic/Anthropic.node.js +42 -0
- package/dist/nodes/vendors/Anthropic/Anthropic.node.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/Anthropic/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/document/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/document/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js +61 -0
- package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js +63 -0
- package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/index.js +94 -0
- package/dist/nodes/vendors/Anthropic/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js +108 -0
- package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js +126 -0
- package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/image/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/node.type.js +17 -0
- package/dist/nodes/vendors/Anthropic/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js +87 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js +154 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/index.js +95 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js +146 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/router.js +93 -0
- package/dist/nodes/vendors/Anthropic/actions/router.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/text/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js +540 -0
- package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/versionDescription.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/anthropic.svg +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js +109 -0
- package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/Anthropic/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/utils.js +84 -0
- package/dist/nodes/vendors/Anthropic/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/methods/index.js +39 -0
- package/dist/nodes/vendors/Anthropic/methods/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/methods/listSearch.js +42 -0
- package/dist/nodes/vendors/Anthropic/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/transport/index.js +57 -0
- package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -0
- 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/nodes/vendors/OpenAi/actions/router.js +1 -1
- package/dist/nodes/vendors/OpenAi/actions/router.js.map +1 -1
- package/dist/types/credentials.json +3 -3
- package/dist/types/nodes.json +9 -5
- 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 +11 -6
|
@@ -0,0 +1,17 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var node_type_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(node_type_exports);
|
|
17
|
+
//# sourceMappingURL=node.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/actions/node.type.ts"],"sourcesContent":["import type { AllEntities } from 'n8n-workflow';\n\ntype NodeMap = {\n\ttext: 'message';\n\timage: 'analyze' | 'generate';\n\tvideo: 'analyze' | 'generate' | 'download';\n\taudio: 'transcribe' | 'analyze';\n\tdocument: 'analyze';\n\tfile: 'upload';\n};\n\nexport type GoogleGeminiType = AllEntities<NodeMap>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var router_exports = {};
|
|
30
|
+
__export(router_exports, {
|
|
31
|
+
router: () => router
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(router_exports);
|
|
34
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
35
|
+
var audio = __toESM(require("./audio"));
|
|
36
|
+
var document = __toESM(require("./document"));
|
|
37
|
+
var file = __toESM(require("./file"));
|
|
38
|
+
var image = __toESM(require("./image"));
|
|
39
|
+
var text = __toESM(require("./text"));
|
|
40
|
+
var video = __toESM(require("./video"));
|
|
41
|
+
async function router() {
|
|
42
|
+
const returnData = [];
|
|
43
|
+
const items = this.getInputData();
|
|
44
|
+
const resource = this.getNodeParameter("resource", 0);
|
|
45
|
+
const operation = this.getNodeParameter("operation", 0);
|
|
46
|
+
const googleGeminiTypeData = {
|
|
47
|
+
resource,
|
|
48
|
+
operation
|
|
49
|
+
};
|
|
50
|
+
let execute;
|
|
51
|
+
switch (googleGeminiTypeData.resource) {
|
|
52
|
+
case "audio":
|
|
53
|
+
execute = audio[googleGeminiTypeData.operation].execute;
|
|
54
|
+
break;
|
|
55
|
+
case "document":
|
|
56
|
+
execute = document[googleGeminiTypeData.operation].execute;
|
|
57
|
+
break;
|
|
58
|
+
case "file":
|
|
59
|
+
execute = file[googleGeminiTypeData.operation].execute;
|
|
60
|
+
break;
|
|
61
|
+
case "image":
|
|
62
|
+
execute = image[googleGeminiTypeData.operation].execute;
|
|
63
|
+
break;
|
|
64
|
+
case "text":
|
|
65
|
+
execute = text[googleGeminiTypeData.operation].execute;
|
|
66
|
+
break;
|
|
67
|
+
case "video":
|
|
68
|
+
execute = video[googleGeminiTypeData.operation].execute;
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
72
|
+
this.getNode(),
|
|
73
|
+
`The operation "${operation}" is not supported!`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
for (let i = 0; i < items.length; i++) {
|
|
77
|
+
try {
|
|
78
|
+
const responseData = await execute.call(this, i);
|
|
79
|
+
returnData.push(...responseData);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
if (this.continueOnFail()) {
|
|
82
|
+
returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), error, {
|
|
86
|
+
itemIndex: i,
|
|
87
|
+
description: error.description
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [returnData];
|
|
92
|
+
}
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
router
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/actions/router.ts"],"sourcesContent":["import { NodeOperationError, type IExecuteFunctions, type INodeExecutionData } from 'n8n-workflow';\n\nimport * as audio from './audio';\nimport * as document from './document';\nimport * as file from './file';\nimport * as image from './image';\nimport type { GoogleGeminiType } from './node.type';\nimport * as text from './text';\nimport * as video from './video';\n\nexport async function router(this: IExecuteFunctions) {\n\tconst returnData: INodeExecutionData[] = [];\n\n\tconst items = this.getInputData();\n\tconst resource = this.getNodeParameter('resource', 0);\n\tconst operation = this.getNodeParameter('operation', 0);\n\n\tconst googleGeminiTypeData = {\n\t\tresource,\n\t\toperation,\n\t} as GoogleGeminiType;\n\n\tlet execute;\n\tswitch (googleGeminiTypeData.resource) {\n\t\tcase 'audio':\n\t\t\texecute = audio[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'document':\n\t\t\texecute = document[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'file':\n\t\t\texecute = file[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'image':\n\t\t\texecute = image[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'text':\n\t\t\texecute = text[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tcase 'video':\n\t\t\texecute = video[googleGeminiTypeData.operation].execute;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`The operation \"${operation}\" is not supported!`,\n\t\t\t);\n\t}\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\ttry {\n\t\t\tconst responseData = await execute.call(this, i);\n\t\t\treturnData.push(...responseData);\n\t\t} catch (error) {\n\t\t\tif (this.continueOnFail()) {\n\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: i } });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(this.getNode(), error, {\n\t\t\t\titemIndex: i,\n\t\t\t\tdescription: error.description,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn [returnData];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAoF;AAEpF,YAAuB;AACvB,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AAEvB,WAAsB;AACtB,YAAuB;AAEvB,eAAsB,SAAgC;AACrD,QAAM,aAAmC,CAAC;AAE1C,QAAM,QAAQ,KAAK,aAAa;AAChC,QAAM,WAAW,KAAK,iBAAiB,YAAY,CAAC;AACpD,QAAM,YAAY,KAAK,iBAAiB,aAAa,CAAC;AAEtD,QAAM,uBAAuB;AAAA,IAC5B;AAAA,IACA;AAAA,EACD;AAEA,MAAI;AACJ,UAAQ,qBAAqB,UAAU;AAAA,IACtC,KAAK;AACJ,gBAAU,MAAM,qBAAqB,SAAS,EAAE;AAChD;AAAA,IACD,KAAK;AACJ,gBAAU,SAAS,qBAAqB,SAAS,EAAE;AACnD;AAAA,IACD,KAAK;AACJ,gBAAU,KAAK,qBAAqB,SAAS,EAAE;AAC/C;AAAA,IACD,KAAK;AACJ,gBAAU,MAAM,qBAAqB,SAAS,EAAE;AAChD;AAAA,IACD,KAAK;AACJ,gBAAU,KAAK,qBAAqB,SAAS,EAAE;AAC/C;AAAA,IACD,KAAK;AACJ,gBAAU,MAAM,qBAAqB,SAAS,EAAE;AAChD;AAAA,IACD;AACC,YAAM,IAAI;AAAA,QACT,KAAK,QAAQ;AAAA,QACb,kBAAkB,SAAS;AAAA,MAC5B;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACtC,QAAI;AACH,YAAM,eAAe,MAAM,QAAQ,KAAK,MAAM,CAAC;AAC/C,iBAAW,KAAK,GAAG,YAAY;AAAA,IAChC,SAAS,OAAO;AACf,UAAI,KAAK,eAAe,GAAG;AAC1B,mBAAW,KAAK,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,GAAG,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;AAC3E;AAAA,MACD;AAEA,YAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,OAAO;AAAA,QACnD,WAAW;AAAA,QACX,aAAa,MAAM;AAAA,MACpB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,SAAO,CAAC,UAAU;AACnB;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var text_exports = {};
|
|
30
|
+
__export(text_exports, {
|
|
31
|
+
description: () => description,
|
|
32
|
+
message: () => message
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(text_exports);
|
|
35
|
+
var message = __toESM(require("./message.operation"));
|
|
36
|
+
const description = [
|
|
37
|
+
{
|
|
38
|
+
displayName: "Operation",
|
|
39
|
+
name: "operation",
|
|
40
|
+
type: "options",
|
|
41
|
+
noDataExpression: true,
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: "Message a Model",
|
|
45
|
+
value: "message",
|
|
46
|
+
action: "Message a model",
|
|
47
|
+
description: "Create a completion with Google Gemini model"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
default: "message",
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: {
|
|
53
|
+
resource: ["text"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
...message.description
|
|
58
|
+
];
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
description,
|
|
62
|
+
message
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/GoogleGemini/actions/text/index.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as message from './message.operation';\n\nexport { message };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Message a Model',\n\t\t\t\tvalue: 'message',\n\t\t\t\taction: 'Message a model',\n\t\t\t\tdescription: 'Create a completion with Google Gemini model',\n\t\t\t},\n\t\t],\n\t\tdefault: 'message',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['text'],\n\t\t\t},\n\t\t},\n\t},\n\t...message.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,cAAyB;AAIlB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,aAAa;AAAA,MACd;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,QAAQ;AACZ;","names":[]}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var message_operation_exports = {};
|
|
30
|
+
__export(message_operation_exports, {
|
|
31
|
+
description: () => description,
|
|
32
|
+
execute: () => execute
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(message_operation_exports);
|
|
35
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
36
|
+
var import_zod_to_json_schema = __toESM(require("zod-to-json-schema"));
|
|
37
|
+
var import_helpers = require("../../../../../utils/helpers");
|
|
38
|
+
var import_transport = require("../../transport");
|
|
39
|
+
var import_descriptions = require("../descriptions");
|
|
40
|
+
const properties = [
|
|
41
|
+
(0, import_descriptions.modelRLC)("modelSearch"),
|
|
42
|
+
{
|
|
43
|
+
displayName: "Messages",
|
|
44
|
+
name: "messages",
|
|
45
|
+
type: "fixedCollection",
|
|
46
|
+
typeOptions: {
|
|
47
|
+
sortable: true,
|
|
48
|
+
multipleValues: true
|
|
49
|
+
},
|
|
50
|
+
placeholder: "Add Message",
|
|
51
|
+
default: { values: [{ content: "" }] },
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
displayName: "Values",
|
|
55
|
+
name: "values",
|
|
56
|
+
values: [
|
|
57
|
+
{
|
|
58
|
+
displayName: "Prompt",
|
|
59
|
+
name: "content",
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "The content of the message to be send",
|
|
62
|
+
default: "",
|
|
63
|
+
placeholder: "e.g. Hello, how can you help me?",
|
|
64
|
+
typeOptions: {
|
|
65
|
+
rows: 2
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: "Role",
|
|
70
|
+
name: "role",
|
|
71
|
+
type: "options",
|
|
72
|
+
description: "Role in shaping the model's response, it tells the model how it should behave and interact with the user",
|
|
73
|
+
options: [
|
|
74
|
+
{
|
|
75
|
+
name: "User",
|
|
76
|
+
value: "user",
|
|
77
|
+
description: "Send a message as a user and get a response from the model"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "Model",
|
|
81
|
+
value: "model",
|
|
82
|
+
description: "Tell the model to adopt a specific tone or personality"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
default: "user"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
displayName: "Simplify Output",
|
|
93
|
+
name: "simplify",
|
|
94
|
+
type: "boolean",
|
|
95
|
+
default: true,
|
|
96
|
+
description: "Whether to return a simplified version of the response instead of the raw data"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
displayName: "Output Content as JSON",
|
|
100
|
+
name: "jsonOutput",
|
|
101
|
+
type: "boolean",
|
|
102
|
+
description: "Whether to attempt to return the response in JSON format",
|
|
103
|
+
default: false
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: "Options",
|
|
107
|
+
name: "options",
|
|
108
|
+
placeholder: "Add Option",
|
|
109
|
+
type: "collection",
|
|
110
|
+
default: {},
|
|
111
|
+
options: [
|
|
112
|
+
{
|
|
113
|
+
displayName: "System Message",
|
|
114
|
+
name: "systemMessage",
|
|
115
|
+
type: "string",
|
|
116
|
+
default: "",
|
|
117
|
+
placeholder: "e.g. You are a helpful assistant"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
displayName: "Code Execution",
|
|
121
|
+
name: "codeExecution",
|
|
122
|
+
type: "boolean",
|
|
123
|
+
default: false,
|
|
124
|
+
description: "Whether to allow the model to execute code it generates to produce a response. Supported only by certain models."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: "Frequency Penalty",
|
|
128
|
+
name: "frequencyPenalty",
|
|
129
|
+
default: 0,
|
|
130
|
+
description: "Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim",
|
|
131
|
+
type: "number",
|
|
132
|
+
typeOptions: {
|
|
133
|
+
minValue: -2,
|
|
134
|
+
maxValue: 2,
|
|
135
|
+
numberPrecision: 1
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
displayName: "Maximum Number of Tokens",
|
|
140
|
+
name: "maxOutputTokens",
|
|
141
|
+
default: 16,
|
|
142
|
+
description: "The maximum number of tokens to generate in the completion",
|
|
143
|
+
type: "number",
|
|
144
|
+
typeOptions: {
|
|
145
|
+
minValue: 1,
|
|
146
|
+
numberPrecision: 0
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: "Number of Completions",
|
|
151
|
+
name: "candidateCount",
|
|
152
|
+
default: 1,
|
|
153
|
+
description: "How many completions to generate for each prompt",
|
|
154
|
+
type: "number",
|
|
155
|
+
typeOptions: {
|
|
156
|
+
minValue: 1,
|
|
157
|
+
maxValue: 8,
|
|
158
|
+
// Google Gemini supports up to 8 candidates
|
|
159
|
+
numberPrecision: 0
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: "Presence Penalty",
|
|
164
|
+
name: "presencePenalty",
|
|
165
|
+
default: 0,
|
|
166
|
+
description: "Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics",
|
|
167
|
+
type: "number",
|
|
168
|
+
typeOptions: {
|
|
169
|
+
minValue: -2,
|
|
170
|
+
maxValue: 2,
|
|
171
|
+
numberPrecision: 1
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
displayName: "Output Randomness (Temperature)",
|
|
176
|
+
name: "temperature",
|
|
177
|
+
default: 1,
|
|
178
|
+
description: "Controls the randomness of the output. Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive",
|
|
179
|
+
type: "number",
|
|
180
|
+
typeOptions: {
|
|
181
|
+
minValue: 0,
|
|
182
|
+
maxValue: 2,
|
|
183
|
+
numberPrecision: 1
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
displayName: "Output Randomness (Top P)",
|
|
188
|
+
name: "topP",
|
|
189
|
+
default: 1,
|
|
190
|
+
description: "The maximum cumulative probability of tokens to consider when sampling",
|
|
191
|
+
type: "number",
|
|
192
|
+
typeOptions: {
|
|
193
|
+
minValue: 0,
|
|
194
|
+
maxValue: 1,
|
|
195
|
+
numberPrecision: 1
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
displayName: "Output Randomness (Top K)",
|
|
200
|
+
name: "topK",
|
|
201
|
+
default: 1,
|
|
202
|
+
description: "The maximum number of tokens to consider when sampling",
|
|
203
|
+
type: "number",
|
|
204
|
+
typeOptions: {
|
|
205
|
+
minValue: 1,
|
|
206
|
+
numberPrecision: 0
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: "Max Tool Calls Iterations",
|
|
211
|
+
name: "maxToolsIterations",
|
|
212
|
+
type: "number",
|
|
213
|
+
default: 15,
|
|
214
|
+
description: "The maximum number of tool iteration cycles the LLM will run before stopping. A single iteration can contain multiple tool calls. Set to 0 for no limit",
|
|
215
|
+
typeOptions: {
|
|
216
|
+
minValue: 0,
|
|
217
|
+
numberPrecision: 0
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
const displayOptions = {
|
|
224
|
+
show: {
|
|
225
|
+
operation: ["message"],
|
|
226
|
+
resource: ["text"]
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
|
|
230
|
+
function getToolCalls(response) {
|
|
231
|
+
return response.candidates.flatMap((c) => c.content.parts).filter((p) => "functionCall" in p);
|
|
232
|
+
}
|
|
233
|
+
async function execute(i) {
|
|
234
|
+
const model = this.getNodeParameter("modelId", i, "", { extractValue: true });
|
|
235
|
+
const messages = this.getNodeParameter("messages.values", i, []);
|
|
236
|
+
const simplify = this.getNodeParameter("simplify", i, true);
|
|
237
|
+
const jsonOutput = this.getNodeParameter("jsonOutput", i, false);
|
|
238
|
+
const options = this.getNodeParameter("options", i, {});
|
|
239
|
+
const generationConfig = {
|
|
240
|
+
frequencyPenalty: options.frequencyPenalty,
|
|
241
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
242
|
+
candidateCount: options.candidateCount,
|
|
243
|
+
presencePenalty: options.presencePenalty,
|
|
244
|
+
temperature: options.temperature,
|
|
245
|
+
topP: options.topP,
|
|
246
|
+
topK: options.topK,
|
|
247
|
+
responseMimeType: jsonOutput ? "application/json" : void 0
|
|
248
|
+
};
|
|
249
|
+
const availableTools = await (0, import_helpers.getConnectedTools)(this, true);
|
|
250
|
+
const tools = [
|
|
251
|
+
{
|
|
252
|
+
functionDeclarations: availableTools.map((t) => ({
|
|
253
|
+
name: t.name,
|
|
254
|
+
description: t.description,
|
|
255
|
+
parameters: {
|
|
256
|
+
...(0, import_zod_to_json_schema.default)(t.schema, { target: "openApi3" }),
|
|
257
|
+
// Google Gemini API throws an error if `additionalProperties` field is present
|
|
258
|
+
additionalProperties: void 0
|
|
259
|
+
}
|
|
260
|
+
}))
|
|
261
|
+
}
|
|
262
|
+
];
|
|
263
|
+
if (!tools[0].functionDeclarations?.length) {
|
|
264
|
+
tools.pop();
|
|
265
|
+
}
|
|
266
|
+
if (options.codeExecution) {
|
|
267
|
+
tools.push({
|
|
268
|
+
codeExecution: {}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const contents = messages.map((m) => ({
|
|
272
|
+
parts: [{ text: m.content }],
|
|
273
|
+
role: m.role
|
|
274
|
+
}));
|
|
275
|
+
const body = {
|
|
276
|
+
tools,
|
|
277
|
+
contents,
|
|
278
|
+
generationConfig,
|
|
279
|
+
systemInstruction: options.systemMessage ? { parts: [{ text: options.systemMessage }] } : void 0
|
|
280
|
+
};
|
|
281
|
+
let response = await import_transport.apiRequest.call(this, "POST", `/v1beta/${model}:generateContent`, {
|
|
282
|
+
body
|
|
283
|
+
});
|
|
284
|
+
const maxToolsIterations = this.getNodeParameter("options.maxToolsIterations", i, 15);
|
|
285
|
+
const abortSignal = this.getExecutionCancelSignal();
|
|
286
|
+
let currentIteration = 1;
|
|
287
|
+
let toolCalls = getToolCalls(response);
|
|
288
|
+
while (toolCalls.length) {
|
|
289
|
+
if (maxToolsIterations > 0 && currentIteration >= maxToolsIterations || abortSignal?.aborted) {
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
contents.push(...response.candidates.map((c) => c.content));
|
|
293
|
+
for (const { functionCall } of toolCalls) {
|
|
294
|
+
let toolResponse;
|
|
295
|
+
for (const availableTool of availableTools) {
|
|
296
|
+
if (availableTool.name === functionCall.name) {
|
|
297
|
+
toolResponse = await availableTool.invoke(functionCall.args);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
contents.push({
|
|
301
|
+
parts: [
|
|
302
|
+
{
|
|
303
|
+
functionResponse: {
|
|
304
|
+
id: functionCall.id,
|
|
305
|
+
name: functionCall.name,
|
|
306
|
+
response: {
|
|
307
|
+
result: toolResponse
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
role: "tool"
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
response = await import_transport.apiRequest.call(this, "POST", `/v1beta/${model}:generateContent`, {
|
|
316
|
+
body
|
|
317
|
+
});
|
|
318
|
+
toolCalls = getToolCalls(response);
|
|
319
|
+
currentIteration++;
|
|
320
|
+
}
|
|
321
|
+
if (simplify) {
|
|
322
|
+
return response.candidates.map((candidate) => ({
|
|
323
|
+
json: candidate,
|
|
324
|
+
pairedItem: { item: i }
|
|
325
|
+
}));
|
|
326
|
+
}
|
|
327
|
+
return [
|
|
328
|
+
{
|
|
329
|
+
json: { ...response },
|
|
330
|
+
pairedItem: { item: i }
|
|
331
|
+
}
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
335
|
+
0 && (module.exports = {
|
|
336
|
+
description,
|
|
337
|
+
execute
|
|
338
|
+
});
|
|
339
|
+
//# sourceMappingURL=message.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/GoogleGemini/actions/text/message.operation.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\nimport zodToJsonSchema from 'zod-to-json-schema';\n\nimport { getConnectedTools } from '@utils/helpers';\n\nimport type { GenerateContentResponse, Content, Tool } from '../../helpers/interfaces';\nimport { apiRequest } from '../../transport';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('modelSearch'),\n\t{\n\t\tdisplayName: 'Messages',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tsortable: true,\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tplaceholder: 'Add Message',\n\t\tdefault: { values: [{ content: '' }] },\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Values',\n\t\t\t\tname: 'values',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\t\tname: 'content',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: 'The content of the message to be send',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Role',\n\t\t\t\t\t\tname: 'role',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Role in shaping the model's response, it tells the model how it should behave and interact with the user\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: 'user',\n\t\t\t\t\t\t\t\tdescription: 'Send a message as a user and get a response from the model',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Model',\n\t\t\t\t\t\t\t\tvalue: 'model',\n\t\t\t\t\t\t\t\tdescription: 'Tell the model to adopt a specific tone or personality',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'user',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription: 'Whether to return a simplified version of the response instead of the raw data',\n\t},\n\t{\n\t\tdisplayName: 'Output Content as JSON',\n\t\tname: 'jsonOutput',\n\t\ttype: 'boolean',\n\t\tdescription: 'Whether to attempt to return the response in JSON format',\n\t\tdefault: false,\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\tplaceholder: 'Add Option',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'System Message',\n\t\t\t\tname: 'systemMessage',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tplaceholder: 'e.g. You are a helpful assistant',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Code Execution',\n\t\t\t\tname: 'codeExecution',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to allow the model to execute code it generates to produce a response. Supported only by certain models.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Frequency Penalty',\n\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\tdefault: 0,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: -2,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\t\tname: 'maxOutputTokens',\n\t\t\t\tdefault: 16,\n\t\t\t\tdescription: 'The maximum number of tokens to generate in the completion',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of Completions',\n\t\t\t\tname: 'candidateCount',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'How many completions to generate for each prompt',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tmaxValue: 8, // Google Gemini supports up to 8 candidates\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Presence Penalty',\n\t\t\t\tname: 'presencePenalty',\n\t\t\t\tdefault: 0,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: -2,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Temperature)',\n\t\t\t\tname: 'temperature',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t'Controls the randomness of the output. Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top P)',\n\t\t\t\tname: 'topP',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'The maximum cumulative probability of tokens to consider when sampling',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 1,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top K)',\n\t\t\t\tname: 'topK',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'The maximum number of tokens to consider when sampling',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Tool Calls Iterations',\n\t\t\t\tname: 'maxToolsIterations',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'The maximum number of tool iteration cycles the LLM will run before stopping. A single iteration can contain multiple tool calls. Set to 0 for no limit',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tnumberPrecision: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['message'],\n\t\tresource: ['text'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nfunction getToolCalls(response: GenerateContentResponse) {\n\treturn response.candidates.flatMap((c) => c.content.parts).filter((p) => 'functionCall' in p);\n}\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst messages = this.getNodeParameter('messages.values', i, []) as Array<{\n\t\tcontent: string;\n\t\trole: string;\n\t}>;\n\tconst simplify = this.getNodeParameter('simplify', i, true) as boolean;\n\tconst jsonOutput = this.getNodeParameter('jsonOutput', i, false) as boolean;\n\tconst options = this.getNodeParameter('options', i, {});\n\n\tconst generationConfig = {\n\t\tfrequencyPenalty: options.frequencyPenalty,\n\t\tmaxOutputTokens: options.maxOutputTokens,\n\t\tcandidateCount: options.candidateCount,\n\t\tpresencePenalty: options.presencePenalty,\n\t\ttemperature: options.temperature,\n\t\ttopP: options.topP,\n\t\ttopK: options.topK,\n\t\tresponseMimeType: jsonOutput ? 'application/json' : undefined,\n\t};\n\n\tconst availableTools = await getConnectedTools(this, true);\n\tconst tools: Tool[] = [\n\t\t{\n\t\t\tfunctionDeclarations: availableTools.map((t) => ({\n\t\t\t\tname: t.name,\n\t\t\t\tdescription: t.description,\n\t\t\t\tparameters: {\n\t\t\t\t\t...zodToJsonSchema(t.schema, { target: 'openApi3' }),\n\t\t\t\t\t// Google Gemini API throws an error if `additionalProperties` field is present\n\t\t\t\t\tadditionalProperties: undefined,\n\t\t\t\t},\n\t\t\t})),\n\t\t},\n\t];\n\tif (!tools[0].functionDeclarations?.length) {\n\t\ttools.pop();\n\t}\n\n\tif (options.codeExecution) {\n\t\ttools.push({\n\t\t\tcodeExecution: {},\n\t\t});\n\t}\n\n\tconst contents: Content[] = messages.map((m) => ({\n\t\tparts: [{ text: m.content }],\n\t\trole: m.role,\n\t}));\n\tconst body = {\n\t\ttools,\n\t\tcontents,\n\t\tgenerationConfig,\n\t\tsystemInstruction: options.systemMessage\n\t\t\t? { parts: [{ text: options.systemMessage }] }\n\t\t\t: undefined,\n\t};\n\n\tlet response = (await apiRequest.call(this, 'POST', `/v1beta/${model}:generateContent`, {\n\t\tbody,\n\t})) as GenerateContentResponse;\n\n\tconst maxToolsIterations = this.getNodeParameter('options.maxToolsIterations', i, 15) as number;\n\tconst abortSignal = this.getExecutionCancelSignal();\n\tlet currentIteration = 1;\n\tlet toolCalls = getToolCalls(response);\n\twhile (toolCalls.length) {\n\t\tif (\n\t\t\t(maxToolsIterations > 0 && currentIteration >= maxToolsIterations) ||\n\t\t\tabortSignal?.aborted\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\n\t\tcontents.push(...response.candidates.map((c) => c.content));\n\n\t\tfor (const { functionCall } of toolCalls) {\n\t\t\tlet toolResponse;\n\t\t\tfor (const availableTool of availableTools) {\n\t\t\t\tif (availableTool.name === functionCall.name) {\n\t\t\t\t\ttoolResponse = (await availableTool.invoke(functionCall.args)) as IDataObject;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcontents.push({\n\t\t\t\tparts: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfunctionResponse: {\n\t\t\t\t\t\t\tid: functionCall.id,\n\t\t\t\t\t\t\tname: functionCall.name,\n\t\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\t\tresult: toolResponse,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\trole: 'tool',\n\t\t\t});\n\t\t}\n\n\t\tresponse = (await apiRequest.call(this, 'POST', `/v1beta/${model}:generateContent`, {\n\t\t\tbody,\n\t\t})) as GenerateContentResponse;\n\t\ttoolCalls = getToolCalls(response);\n\t\tcurrentIteration++;\n\t}\n\n\tif (simplify) {\n\t\treturn response.candidates.map((candidate) => ({\n\t\t\tjson: candidate,\n\t\t\tpairedItem: { item: i },\n\t\t}));\n\t}\n\n\treturn [\n\t\t{\n\t\t\tjson: { ...response },\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAqC;AACrC,gCAA4B;AAE5B,qBAAkC;AAGlC,uBAA2B;AAC3B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,MACrC,8BAAS,aAAa;AAAA,EACtB;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,IACb,SAAS,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE;AAAA,IACrC,SAAS;AAAA,MACR;AAAA,QACC,a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