@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
|
@@ -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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AAEA,eAAS,KAAK;AAAA,QACb,OAAO;AAAA,UACN;AAAA,YACC,kBAAkB;AAAA,cACjB,IAAI,aAAa;AAAA,cACjB,MAAM,aAAa;AAAA,cACnB,UAAU;AAAA,gBACT,QAAQ;AAAA,cACT;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,MAAM;AAAA,MACP,CAAC;AAAA,IACF;AAEA,eAAY,MAAM,4BAAW,KAAK,MAAM,QAAQ,WAAW,KAAK,oBAAoB;AAAA,MACnF;AAAA,IACD,CAAC;AACD,gBAAY,aAAa,QAAQ;AACjC;AAAA,EACD;AAEA,MAAI,UAAU;AACb,WAAO,SAAS,WAAW,IAAI,CAAC,eAAe;AAAA,MAC9C,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB,EAAE;AAAA,EACH;AAEA,SAAO;AAAA,IACN;AAAA,MACC,MAAM,EAAE,GAAG,SAAS;AAAA,MACpB,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":["zodToJsonSchema"]}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 versionDescription_exports = {};
|
|
30
|
+
__export(versionDescription_exports, {
|
|
31
|
+
versionDescription: () => versionDescription
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(versionDescription_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
|
+
const versionDescription = {
|
|
42
|
+
displayName: "Google Gemini",
|
|
43
|
+
name: "googleGemini",
|
|
44
|
+
icon: "file:gemini.svg",
|
|
45
|
+
group: ["transform"],
|
|
46
|
+
version: 1,
|
|
47
|
+
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
|
48
|
+
description: "Interact with Google Gemini AI models",
|
|
49
|
+
defaults: {
|
|
50
|
+
name: "Google Gemini"
|
|
51
|
+
},
|
|
52
|
+
usableAsTool: true,
|
|
53
|
+
codex: {
|
|
54
|
+
alias: ["LangChain", "video", "document", "audio", "transcribe", "assistant"],
|
|
55
|
+
categories: ["AI"],
|
|
56
|
+
subcategories: {
|
|
57
|
+
AI: ["Agents", "Miscellaneous", "Root Nodes"]
|
|
58
|
+
},
|
|
59
|
+
resources: {
|
|
60
|
+
primaryDocumentation: [
|
|
61
|
+
{
|
|
62
|
+
url: "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.googlegemini/"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
inputs: `={{
|
|
68
|
+
(() => {
|
|
69
|
+
const resource = $parameter.resource;
|
|
70
|
+
const operation = $parameter.operation;
|
|
71
|
+
if (resource === 'text' && operation === 'message') {
|
|
72
|
+
return [{ type: 'main' }, { type: 'ai_tool', displayName: 'Tools' }];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return ['main'];
|
|
76
|
+
})()
|
|
77
|
+
}}`,
|
|
78
|
+
outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
79
|
+
credentials: [
|
|
80
|
+
{
|
|
81
|
+
name: "googlePalmApi",
|
|
82
|
+
required: true
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
properties: [
|
|
86
|
+
{
|
|
87
|
+
displayName: "Resource",
|
|
88
|
+
name: "resource",
|
|
89
|
+
type: "options",
|
|
90
|
+
noDataExpression: true,
|
|
91
|
+
options: [
|
|
92
|
+
{
|
|
93
|
+
name: "Audio",
|
|
94
|
+
value: "audio"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "Document",
|
|
98
|
+
value: "document"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "File",
|
|
102
|
+
value: "file"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "Image",
|
|
106
|
+
value: "image"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "Text",
|
|
110
|
+
value: "text"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "Video",
|
|
114
|
+
value: "video"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
default: "text"
|
|
118
|
+
},
|
|
119
|
+
...audio.description,
|
|
120
|
+
...document.description,
|
|
121
|
+
...file.description,
|
|
122
|
+
...image.description,
|
|
123
|
+
...text.description,
|
|
124
|
+
...video.description
|
|
125
|
+
]
|
|
126
|
+
};
|
|
127
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
128
|
+
0 && (module.exports = {
|
|
129
|
+
versionDescription
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=versionDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/actions/versionDescription.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport { NodeConnectionTypes, type INodeTypeDescription } 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 * as text from './text';\nimport * as video from './video';\n\nexport const versionDescription: INodeTypeDescription = {\n\tdisplayName: 'Google Gemini',\n\tname: 'googleGemini',\n\ticon: 'file:gemini.svg',\n\tgroup: ['transform'],\n\tversion: 1,\n\tsubtitle: '={{ $parameter[\"operation\"] + \": \" + $parameter[\"resource\"] }}',\n\tdescription: 'Interact with Google Gemini AI models',\n\tdefaults: {\n\t\tname: 'Google Gemini',\n\t},\n\tusableAsTool: true,\n\tcodex: {\n\t\talias: ['LangChain', 'video', 'document', 'audio', 'transcribe', 'assistant'],\n\t\tcategories: ['AI'],\n\t\tsubcategories: {\n\t\t\tAI: ['Agents', 'Miscellaneous', 'Root Nodes'],\n\t\t},\n\t\tresources: {\n\t\t\tprimaryDocumentation: [\n\t\t\t\t{\n\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.googlegemini/',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tinputs: `={{\n\t\t(() => {\n\t\t\tconst resource = $parameter.resource;\n\t \tconst operation = $parameter.operation;\n\t\t\tif (resource === 'text' && operation === 'message') {\n\t\t\t\treturn [{ type: 'main' }, { type: 'ai_tool', displayName: 'Tools' }];\n\t\t\t}\n\n\t\t\treturn ['main'];\n\t\t})()\n\t}}`,\n\toutputs: [NodeConnectionTypes.Main],\n\tcredentials: [\n\t\t{\n\t\t\tname: 'googlePalmApi',\n\t\t\trequired: true,\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Resource',\n\t\t\tname: 'resource',\n\t\t\ttype: 'options',\n\t\t\tnoDataExpression: true,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Audio',\n\t\t\t\t\tvalue: 'audio',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Document',\n\t\t\t\t\tvalue: 'document',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'File',\n\t\t\t\t\tvalue: 'file',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Image',\n\t\t\t\t\tvalue: 'image',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Text',\n\t\t\t\t\tvalue: 'text',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Video',\n\t\t\t\t\tvalue: 'video',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'text',\n\t\t},\n\t\t...audio.description,\n\t\t...document.description,\n\t\t...file.description,\n\t\t...image.description,\n\t\t...text.description,\n\t\t...video.description,\n\t],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA+D;AAE/D,YAAuB;AACvB,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AACvB,WAAsB;AACtB,YAAuB;AAEhB,MAAM,qBAA2C;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,WAAW;AAAA,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V;AACD;","names":[]}
|
|
@@ -0,0 +1,125 @@
|
|
|
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 analyze_operation_exports = {};
|
|
20
|
+
__export(analyze_operation_exports, {
|
|
21
|
+
description: () => description,
|
|
22
|
+
execute: () => execute
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(analyze_operation_exports);
|
|
25
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
26
|
+
var import_baseAnalyze = require("../../helpers/baseAnalyze");
|
|
27
|
+
var import_descriptions = require("../descriptions");
|
|
28
|
+
const properties = [
|
|
29
|
+
(0, import_descriptions.modelRLC)("modelSearch"),
|
|
30
|
+
{
|
|
31
|
+
displayName: "Text Input",
|
|
32
|
+
name: "text",
|
|
33
|
+
type: "string",
|
|
34
|
+
placeholder: "e.g. What's in this video?",
|
|
35
|
+
default: "What's in this video?",
|
|
36
|
+
typeOptions: {
|
|
37
|
+
rows: 2
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: "Input Type",
|
|
42
|
+
name: "inputType",
|
|
43
|
+
type: "options",
|
|
44
|
+
default: "url",
|
|
45
|
+
options: [
|
|
46
|
+
{
|
|
47
|
+
name: "Video URL(s)",
|
|
48
|
+
value: "url"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "Binary File(s)",
|
|
52
|
+
value: "binary"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: "URL(s)",
|
|
58
|
+
name: "videoUrls",
|
|
59
|
+
type: "string",
|
|
60
|
+
placeholder: "e.g. https://example.com/video.mp4",
|
|
61
|
+
description: "URL(s) of the video(s) to analyze, multiple URLs can be added separated by comma",
|
|
62
|
+
default: "",
|
|
63
|
+
displayOptions: {
|
|
64
|
+
show: {
|
|
65
|
+
inputType: ["url"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
displayName: "Input Data Field Name(s)",
|
|
71
|
+
name: "binaryPropertyName",
|
|
72
|
+
type: "string",
|
|
73
|
+
default: "data",
|
|
74
|
+
placeholder: "e.g. data",
|
|
75
|
+
hint: "The name of the input field containing the binary file data to be processed",
|
|
76
|
+
description: "Name of the binary field(s) which contains the video(s), seperate multiple field names with commas",
|
|
77
|
+
displayOptions: {
|
|
78
|
+
show: {
|
|
79
|
+
inputType: ["binary"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
displayName: "Simplify Output",
|
|
85
|
+
name: "simplify",
|
|
86
|
+
type: "boolean",
|
|
87
|
+
default: true,
|
|
88
|
+
description: "Whether to simplify the response or not"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: "Options",
|
|
92
|
+
name: "options",
|
|
93
|
+
placeholder: "Add Option",
|
|
94
|
+
type: "collection",
|
|
95
|
+
default: {},
|
|
96
|
+
options: [
|
|
97
|
+
{
|
|
98
|
+
displayName: "Length of Description (Max Tokens)",
|
|
99
|
+
description: "Fewer tokens will result in shorter, less detailed video description",
|
|
100
|
+
name: "maxOutputTokens",
|
|
101
|
+
type: "number",
|
|
102
|
+
default: 300,
|
|
103
|
+
typeOptions: {
|
|
104
|
+
minValue: 1
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
const displayOptions = {
|
|
111
|
+
show: {
|
|
112
|
+
operation: ["analyze"],
|
|
113
|
+
resource: ["video"]
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
|
|
117
|
+
async function execute(i) {
|
|
118
|
+
return await import_baseAnalyze.baseAnalyze.call(this, i, "videoUrls", "video/mp4");
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
description,
|
|
123
|
+
execute
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=analyze.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vendors/GoogleGemini/actions/video/analyze.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { baseAnalyze } from '../../helpers/baseAnalyze';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('modelSearch'),\n\t{\n\t\tdisplayName: 'Text Input',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\tplaceholder: \"e.g. What's in this video?\",\n\t\tdefault: \"What's in this video?\",\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Input Type',\n\t\tname: 'inputType',\n\t\ttype: 'options',\n\t\tdefault: 'url',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Video URL(s)',\n\t\t\t\tvalue: 'url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Binary File(s)',\n\t\t\t\tvalue: 'binary',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'URL(s)',\n\t\tname: 'videoUrls',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. https://example.com/video.mp4',\n\t\tdescription: 'URL(s) of the video(s) to analyze, multiple URLs can be added separated by comma',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tinputType: ['url'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Input Data Field Name(s)',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\tplaceholder: 'e.g. data',\n\t\thint: 'The name of the input field containing the binary file data to be processed',\n\t\tdescription:\n\t\t\t'Name of the binary field(s) which contains the video(s), seperate multiple field names with commas',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tinputType: ['binary'],\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 simplify the response or not',\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: 'Length of Description (Max Tokens)',\n\t\t\t\tdescription: 'Fewer tokens will result in shorter, less detailed video description',\n\t\t\t\tname: 'maxOutputTokens',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 300,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['analyze'],\n\t\tresource: ['video'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\treturn await baseAnalyze.call(this, i, 'videoUrls', 'video/mp4');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqC;AAErC,yBAA4B;AAC5B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,MACrC,8BAAS,aAAa;AAAA,EACtB;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS;AAAA,IACT,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,WAAW,CAAC,KAAK;AAAA,MAClB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aACC;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,WAAW,CAAC,QAAQ;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,I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