@n8n/n8n-nodes-langchain 1.101.1 → 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.
Files changed (114) hide show
  1. package/dist/credentials/CohereApi.credentials.js +7 -1
  2. package/dist/credentials/CohereApi.credentials.js.map +1 -1
  3. package/dist/known/credentials.json +2 -0
  4. package/dist/known/nodes.json +12 -0
  5. package/dist/nodes/agents/Agent/Agent.node.js +1 -0
  6. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  7. package/dist/nodes/agents/Agent/AgentTool.node.js +57 -0
  8. package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -0
  9. package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js +104 -0
  10. package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js.map +1 -0
  11. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +4 -66
  12. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
  13. package/dist/nodes/agents/Agent/V2/utils.js +92 -0
  14. package/dist/nodes/agents/Agent/V2/utils.js.map +1 -0
  15. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +13 -10
  16. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -1
  17. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +14 -7
  18. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -1
  19. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -1
  20. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +1 -1
  21. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -1
  22. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +6 -0
  23. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
  24. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +2 -2
  25. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
  26. package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js +181 -0
  27. package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js.map +1 -0
  28. package/dist/nodes/llms/LmChatCohere/cohere.dark.svg +5 -0
  29. package/dist/nodes/llms/LmChatCohere/cohere.svg +5 -0
  30. package/dist/nodes/llms/N8nLlmTracing.js +4 -4
  31. package/dist/nodes/llms/N8nLlmTracing.js.map +1 -1
  32. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js +1 -1
  33. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js.map +1 -1
  34. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js +1 -3
  35. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js.map +1 -1
  36. package/dist/nodes/tools/ToolCode/ToolCode.node.js +1 -2
  37. package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
  38. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +1 -2
  39. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
  40. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +2 -2
  41. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -1
  42. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +2 -1
  43. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
  44. package/dist/nodes/trigger/ChatTrigger/templates.js +3 -1
  45. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -1
  46. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +2 -1
  47. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -1
  48. package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js +42 -0
  49. package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js.map +1 -0
  50. package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js +125 -0
  51. package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js.map +1 -0
  52. package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js +74 -0
  53. package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js.map +1 -0
  54. package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js +184 -0
  55. package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js.map +1 -0
  56. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js +52 -0
  57. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js.map +1 -0
  58. package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js +125 -0
  59. package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js.map +1 -0
  60. package/dist/nodes/vendors/GoogleGemini/actions/document/index.js +64 -0
  61. package/dist/nodes/vendors/GoogleGemini/actions/document/index.js.map +1 -0
  62. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +64 -0
  63. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -0
  64. package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js +119 -0
  65. package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js.map +1 -0
  66. package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js +125 -0
  67. package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js.map +1 -0
  68. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +167 -0
  69. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -0
  70. package/dist/nodes/vendors/GoogleGemini/actions/image/index.js +74 -0
  71. package/dist/nodes/vendors/GoogleGemini/actions/image/index.js.map +1 -0
  72. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js +17 -0
  73. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -0
  74. package/dist/nodes/vendors/GoogleGemini/actions/router.js +97 -0
  75. package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -0
  76. package/dist/nodes/vendors/GoogleGemini/actions/text/index.js +64 -0
  77. package/dist/nodes/vendors/GoogleGemini/actions/text/index.js.map +1 -0
  78. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +339 -0
  79. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -0
  80. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +131 -0
  81. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -0
  82. package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js +125 -0
  83. package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js.map +1 -0
  84. package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js +88 -0
  85. package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js.map +1 -0
  86. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js +228 -0
  87. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js.map +1 -0
  88. package/dist/nodes/vendors/GoogleGemini/actions/video/index.js +84 -0
  89. package/dist/nodes/vendors/GoogleGemini/actions/video/index.js.map +1 -0
  90. package/dist/nodes/vendors/GoogleGemini/gemini.svg +1 -0
  91. package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js +100 -0
  92. package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js.map +1 -0
  93. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js +17 -0
  94. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -0
  95. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +91 -0
  96. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -0
  97. package/dist/nodes/vendors/GoogleGemini/methods/index.js +39 -0
  98. package/dist/nodes/vendors/GoogleGemini/methods/index.js.map +1 -0
  99. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +74 -0
  100. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -0
  101. package/dist/nodes/vendors/GoogleGemini/transport/index.js +48 -0
  102. package/dist/nodes/vendors/GoogleGemini/transport/index.js.map +1 -0
  103. package/dist/types/credentials.json +2 -2
  104. package/dist/types/nodes.json +4 -1
  105. package/dist/utils/descriptions.js +13 -2
  106. package/dist/utils/descriptions.js.map +1 -1
  107. package/dist/utils/helpers.js +2 -7
  108. package/dist/utils/helpers.js.map +1 -1
  109. package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -1
  110. package/dist/utils/tokenizer/tiktoken.js +27 -30
  111. package/dist/utils/tokenizer/tiktoken.js.map +1 -1
  112. package/dist/utils/tokenizer/token-estimator.js +1 -1
  113. package/dist/utils/tokenizer/token-estimator.js.map +1 -1
  114. package/package.json +9 -5
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var utils_exports = {};
20
+ __export(utils_exports, {
21
+ downloadFile: () => downloadFile,
22
+ uploadFile: () => uploadFile
23
+ });
24
+ module.exports = __toCommonJS(utils_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_transport = require("../transport");
27
+ async function downloadFile(url, fallbackMimeType, qs) {
28
+ const downloadResponse = await this.helpers.httpRequest({
29
+ method: "GET",
30
+ url,
31
+ qs,
32
+ returnFullResponse: true,
33
+ encoding: "arraybuffer"
34
+ });
35
+ const mimeType = downloadResponse.headers?.["content-type"]?.split(";")?.[0] ?? fallbackMimeType;
36
+ const fileContent = Buffer.from(downloadResponse.body);
37
+ return {
38
+ fileContent,
39
+ mimeType
40
+ };
41
+ }
42
+ async function uploadFile(fileContent, mimeType) {
43
+ const numBytes = fileContent.length.toString();
44
+ const uploadInitResponse = await import_transport.apiRequest.call(this, "POST", "/upload/v1beta/files", {
45
+ headers: {
46
+ "X-Goog-Upload-Protocol": "resumable",
47
+ "X-Goog-Upload-Command": "start",
48
+ "X-Goog-Upload-Header-Content-Length": numBytes,
49
+ "X-Goog-Upload-Header-Content-Type": mimeType,
50
+ "Content-Type": "application/json"
51
+ },
52
+ option: {
53
+ returnFullResponse: true
54
+ }
55
+ });
56
+ const uploadUrl = uploadInitResponse.headers["x-goog-upload-url"];
57
+ const uploadResponse = await this.helpers.httpRequest({
58
+ method: "POST",
59
+ url: uploadUrl,
60
+ headers: {
61
+ "Content-Length": numBytes,
62
+ "X-Goog-Upload-Offset": "0",
63
+ "X-Goog-Upload-Command": "upload, finalize"
64
+ },
65
+ body: fileContent
66
+ });
67
+ while (uploadResponse.file.state !== "ACTIVE" && uploadResponse.file.state !== "FAILED") {
68
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
69
+ uploadResponse.file = await import_transport.apiRequest.call(
70
+ this,
71
+ "GET",
72
+ `/v1beta/${uploadResponse.file.name}`
73
+ );
74
+ }
75
+ if (uploadResponse.file.state === "FAILED") {
76
+ throw new import_n8n_workflow.NodeOperationError(
77
+ this.getNode(),
78
+ uploadResponse.file.error?.message ?? "Unknown error",
79
+ {
80
+ description: "Error uploading file"
81
+ }
82
+ );
83
+ }
84
+ return { fileUri: uploadResponse.file.uri, mimeType: uploadResponse.file.mimeType };
85
+ }
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ downloadFile,
89
+ uploadFile
90
+ });
91
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/helpers/utils.ts"],"sourcesContent":["import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';\nimport { NodeOperationError } from 'n8n-workflow';\n\nimport { apiRequest } from '../transport';\n\ninterface File {\n\tname: string;\n\turi: string;\n\tmimeType: string;\n\tstate: string;\n\terror?: { message: string };\n}\n\nexport async function downloadFile(\n\tthis: IExecuteFunctions,\n\turl: string,\n\tfallbackMimeType?: string,\n\tqs?: IDataObject,\n) {\n\tconst downloadResponse = (await this.helpers.httpRequest({\n\t\tmethod: 'GET',\n\t\turl,\n\t\tqs,\n\t\treturnFullResponse: true,\n\t\tencoding: 'arraybuffer',\n\t})) as { body: ArrayBuffer; headers: IDataObject };\n\n\tconst mimeType =\n\t\t(downloadResponse.headers?.['content-type'] as string)?.split(';')?.[0] ?? fallbackMimeType;\n\tconst fileContent = Buffer.from(downloadResponse.body);\n\treturn {\n\t\tfileContent,\n\t\tmimeType,\n\t};\n}\n\nexport async function uploadFile(this: IExecuteFunctions, fileContent: Buffer, mimeType: string) {\n\tconst numBytes = fileContent.length.toString();\n\tconst uploadInitResponse = (await apiRequest.call(this, 'POST', '/upload/v1beta/files', {\n\t\theaders: {\n\t\t\t'X-Goog-Upload-Protocol': 'resumable',\n\t\t\t'X-Goog-Upload-Command': 'start',\n\t\t\t'X-Goog-Upload-Header-Content-Length': numBytes,\n\t\t\t'X-Goog-Upload-Header-Content-Type': mimeType,\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\toption: {\n\t\t\treturnFullResponse: true,\n\t\t},\n\t})) as { headers: IDataObject };\n\tconst uploadUrl = uploadInitResponse.headers['x-goog-upload-url'] as string;\n\n\tconst uploadResponse = (await this.helpers.httpRequest({\n\t\tmethod: 'POST',\n\t\turl: uploadUrl,\n\t\theaders: {\n\t\t\t'Content-Length': numBytes,\n\t\t\t'X-Goog-Upload-Offset': '0',\n\t\t\t'X-Goog-Upload-Command': 'upload, finalize',\n\t\t},\n\t\tbody: fileContent,\n\t})) as { file: File };\n\n\twhile (uploadResponse.file.state !== 'ACTIVE' && uploadResponse.file.state !== 'FAILED') {\n\t\tawait new Promise((resolve) => setTimeout(resolve, 1000));\n\t\tuploadResponse.file = (await apiRequest.call(\n\t\t\tthis,\n\t\t\t'GET',\n\t\t\t`/v1beta/${uploadResponse.file.name}`,\n\t\t)) as File;\n\t}\n\n\tif (uploadResponse.file.state === 'FAILED') {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\tuploadResponse.file.error?.message ?? 'Unknown error',\n\t\t\t{\n\t\t\t\tdescription: 'Error uploading file',\n\t\t\t},\n\t\t);\n\t}\n\n\treturn { fileUri: uploadResponse.file.uri, mimeType: uploadResponse.file.mimeType };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAmC;AAEnC,uBAA2B;AAU3B,eAAsB,aAErB,KACA,kBACA,IACC;AACD,QAAM,mBAAoB,MAAM,KAAK,QAAQ,YAAY;AAAA,IACxD,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB,UAAU;AAAA,EACX,CAAC;AAED,QAAM,WACJ,iBAAiB,UAAU,cAAc,GAAc,MAAM,GAAG,IAAI,CAAC,KAAK;AAC5E,QAAM,cAAc,OAAO,KAAK,iBAAiB,IAAI;AACrD,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEA,eAAsB,WAAoC,aAAqB,UAAkB;AAChG,QAAM,WAAW,YAAY,OAAO,SAAS;AAC7C,QAAM,qBAAsB,MAAM,4BAAW,KAAK,MAAM,QAAQ,wBAAwB;AAAA,IACvF,SAAS;AAAA,MACR,0BAA0B;AAAA,MAC1B,yBAAyB;AAAA,MACzB,uCAAuC;AAAA,MACvC,qCAAqC;AAAA,MACrC,gBAAgB;AAAA,IACjB;AAAA,IACA,QAAQ;AAAA,MACP,oBAAoB;AAAA,IACrB;AAAA,EACD,CAAC;AACD,QAAM,YAAY,mBAAmB,QAAQ,mBAAmB;AAEhE,QAAM,iBAAkB,MAAM,KAAK,QAAQ,YAAY;AAAA,IACtD,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,SAAS;AAAA,MACR,kBAAkB;AAAA,MAClB,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAC1B;AAAA,IACA,MAAM;AAAA,EACP,CAAC;AAED,SAAO,eAAe,KAAK,UAAU,YAAY,eAAe,KAAK,UAAU,UAAU;AACxF,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAI,CAAC;AACxD,mBAAe,OAAQ,MAAM,4BAAW;AAAA,MACvC;AAAA,MACA;AAAA,MACA,WAAW,eAAe,KAAK,IAAI;AAAA,IACpC;AAAA,EACD;AAEA,MAAI,eAAe,KAAK,UAAU,UAAU;AAC3C,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb,eAAe,KAAK,OAAO,WAAW;AAAA,MACtC;AAAA,QACC,aAAa;AAAA,MACd;AAAA,IACD;AAAA,EACD;AAEA,SAAO,EAAE,SAAS,eAAe,KAAK,KAAK,UAAU,eAAe,KAAK,SAAS;AACnF;","names":[]}
@@ -0,0 +1,39 @@
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 methods_exports = {};
30
+ __export(methods_exports, {
31
+ listSearch: () => listSearch
32
+ });
33
+ module.exports = __toCommonJS(methods_exports);
34
+ var listSearch = __toESM(require("./listSearch"));
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ listSearch
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/methods/index.ts"],"sourcesContent":["export * as listSearch from './listSearch';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA4B;","names":[]}
@@ -0,0 +1,74 @@
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 listSearch_exports = {};
20
+ __export(listSearch_exports, {
21
+ audioModelSearch: () => audioModelSearch,
22
+ imageGenerationModelSearch: () => imageGenerationModelSearch,
23
+ modelSearch: () => modelSearch,
24
+ videoGenerationModelSearch: () => videoGenerationModelSearch
25
+ });
26
+ module.exports = __toCommonJS(listSearch_exports);
27
+ var import_transport = require("../transport");
28
+ async function baseModelSearch(modelFilter, filter) {
29
+ const response = await import_transport.apiRequest.call(this, "GET", "/v1beta/models", {
30
+ qs: {
31
+ pageSize: 1e3
32
+ }
33
+ });
34
+ let models = response.models.filter((model) => modelFilter(model.name));
35
+ if (filter) {
36
+ models = models.filter((model) => model.name.toLowerCase().includes(filter.toLowerCase()));
37
+ }
38
+ return {
39
+ results: models.map((model) => ({ name: model.name, value: model.name }))
40
+ };
41
+ }
42
+ async function modelSearch(filter) {
43
+ return await baseModelSearch.call(
44
+ this,
45
+ (model) => !model.includes("embedding") && !model.includes("aqa") && !model.includes("image") && !model.includes("vision") && !model.includes("veo") && !model.includes("audio") && !model.includes("tts"),
46
+ filter
47
+ );
48
+ }
49
+ async function audioModelSearch(filter) {
50
+ return await baseModelSearch.call(
51
+ this,
52
+ (model) => !model.includes("embedding") && !model.includes("aqa") && !model.includes("image") && !model.includes("vision") && !model.includes("veo") && !model.includes("tts"),
53
+ // we don't have a tts operation
54
+ filter
55
+ );
56
+ }
57
+ async function imageGenerationModelSearch(filter) {
58
+ return await baseModelSearch.call(
59
+ this,
60
+ (model) => model.includes("imagen") || model.includes("image-generation"),
61
+ filter
62
+ );
63
+ }
64
+ async function videoGenerationModelSearch(filter) {
65
+ return await baseModelSearch.call(this, (model) => model.includes("veo"), filter);
66
+ }
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ audioModelSearch,
70
+ imageGenerationModelSearch,
71
+ modelSearch,
72
+ videoGenerationModelSearch
73
+ });
74
+ //# sourceMappingURL=listSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/methods/listSearch.ts"],"sourcesContent":["import type { ILoadOptionsFunctions, INodeListSearchResult } from 'n8n-workflow';\n\nimport { apiRequest } from '../transport';\n\nasync function baseModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tmodelFilter: (model: string) => boolean,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst response = (await apiRequest.call(this, 'GET', '/v1beta/models', {\n\t\tqs: {\n\t\t\tpageSize: 1000,\n\t\t},\n\t})) as {\n\t\tmodels: Array<{ name: string }>;\n\t};\n\n\tlet models = response.models.filter((model) => modelFilter(model.name));\n\tif (filter) {\n\t\tmodels = models.filter((model) => model.name.toLowerCase().includes(filter.toLowerCase()));\n\t}\n\n\treturn {\n\t\tresults: models.map((model) => ({ name: model.name, value: model.name })),\n\t};\n}\n\nexport async function modelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await baseModelSearch.call(\n\t\tthis,\n\t\t(model) =>\n\t\t\t!model.includes('embedding') &&\n\t\t\t!model.includes('aqa') &&\n\t\t\t!model.includes('image') &&\n\t\t\t!model.includes('vision') &&\n\t\t\t!model.includes('veo') &&\n\t\t\t!model.includes('audio') &&\n\t\t\t!model.includes('tts'),\n\t\tfilter,\n\t);\n}\n\nexport async function audioModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await baseModelSearch.call(\n\t\tthis,\n\t\t(model) =>\n\t\t\t!model.includes('embedding') &&\n\t\t\t!model.includes('aqa') &&\n\t\t\t!model.includes('image') &&\n\t\t\t!model.includes('vision') &&\n\t\t\t!model.includes('veo') &&\n\t\t\t!model.includes('tts'), // we don't have a tts operation\n\t\tfilter,\n\t);\n}\n\nexport async function imageGenerationModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await baseModelSearch.call(\n\t\tthis,\n\t\t(model) => model.includes('imagen') || model.includes('image-generation'),\n\t\tfilter,\n\t);\n}\n\nexport async function videoGenerationModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await baseModelSearch.call(this, (model) => model.includes('veo'), filter);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAA2B;AAE3B,eAAe,gBAEd,aACA,QACiC;AACjC,QAAM,WAAY,MAAM,4BAAW,KAAK,MAAM,OAAO,kBAAkB;AAAA,IACtE,IAAI;AAAA,MACH,UAAU;AAAA,IACX;AAAA,EACD,CAAC;AAID,MAAI,SAAS,SAAS,OAAO,OAAO,CAAC,UAAU,YAAY,MAAM,IAAI,CAAC;AACtE,MAAI,QAAQ;AACX,aAAS,OAAO,OAAO,CAAC,UAAU,MAAM,KAAK,YAAY,EAAE,SAAS,OAAO,YAAY,CAAC,CAAC;AAAA,EAC1F;AAEA,SAAO;AAAA,IACN,SAAS,OAAO,IAAI,CAAC,WAAW,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,KAAK,EAAE;AAAA,EACzE;AACD;AAEA,eAAsB,YAErB,QACiC;AACjC,SAAO,MAAM,gBAAgB;AAAA,IAC5B;AAAA,IACA,CAAC,UACA,CAAC,MAAM,SAAS,WAAW,KAC3B,CAAC,MAAM,SAAS,KAAK,KACrB,CAAC,MAAM,SAAS,OAAO,KACvB,CAAC,MAAM,SAAS,QAAQ,KACxB,CAAC,MAAM,SAAS,KAAK,KACrB,CAAC,MAAM,SAAS,OAAO,KACvB,CAAC,MAAM,SAAS,KAAK;AAAA,IACtB;AAAA,EACD;AACD;AAEA,eAAsB,iBAErB,QACiC;AACjC,SAAO,MAAM,gBAAgB;AAAA,IAC5B;AAAA,IACA,CAAC,UACA,CAAC,MAAM,SAAS,WAAW,KAC3B,CAAC,MAAM,SAAS,KAAK,KACrB,CAAC,MAAM,SAAS,OAAO,KACvB,CAAC,MAAM,SAAS,QAAQ,KACxB,CAAC,MAAM,SAAS,KAAK,KACrB,CAAC,MAAM,SAAS,KAAK;AAAA;AAAA,IACtB;AAAA,EACD;AACD;AAEA,eAAsB,2BAErB,QACiC;AACjC,SAAO,MAAM,gBAAgB;AAAA,IAC5B;AAAA,IACA,CAAC,UAAU,MAAM,SAAS,QAAQ,KAAK,MAAM,SAAS,kBAAkB;AAAA,IACxE;AAAA,EACD;AACD;AAEA,eAAsB,2BAErB,QACiC;AACjC,SAAO,MAAM,gBAAgB,KAAK,MAAM,CAAC,UAAU,MAAM,SAAS,KAAK,GAAG,MAAM;AACjF;","names":[]}
@@ -0,0 +1,48 @@
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 transport_exports = {};
20
+ __export(transport_exports, {
21
+ apiRequest: () => apiRequest
22
+ });
23
+ module.exports = __toCommonJS(transport_exports);
24
+ async function apiRequest(method, endpoint, parameters) {
25
+ const { body, qs, option, headers } = parameters ?? {};
26
+ const credentials = await this.getCredentials("googlePalmApi");
27
+ let url = `https://generativelanguage.googleapis.com${endpoint}`;
28
+ if (credentials.url) {
29
+ url = `${credentials?.url}${endpoint}`;
30
+ }
31
+ const options = {
32
+ headers,
33
+ method,
34
+ body,
35
+ qs,
36
+ url,
37
+ json: true
38
+ };
39
+ if (option && Object.keys(option).length !== 0) {
40
+ Object.assign(options, option);
41
+ }
42
+ return await this.helpers.httpRequestWithAuthentication.call(this, "googlePalmApi", options);
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ apiRequest
47
+ });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/vendors/GoogleGemini/transport/index.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tIHttpRequestMethods,\n\tILoadOptionsFunctions,\n} from 'n8n-workflow';\n\ntype RequestParameters = {\n\theaders?: IDataObject;\n\tbody?: IDataObject | string;\n\tqs?: IDataObject;\n\toption?: IDataObject;\n};\n\nexport async function apiRequest(\n\tthis: IExecuteFunctions | ILoadOptionsFunctions,\n\tmethod: IHttpRequestMethods,\n\tendpoint: string,\n\tparameters?: RequestParameters,\n) {\n\tconst { body, qs, option, headers } = parameters ?? {};\n\n\tconst credentials = await this.getCredentials('googlePalmApi');\n\n\tlet url = `https://generativelanguage.googleapis.com${endpoint}`;\n\n\tif (credentials.url) {\n\t\turl = `${credentials?.url as string}${endpoint}`;\n\t}\n\n\tconst options = {\n\t\theaders,\n\t\tmethod,\n\t\tbody,\n\t\tqs,\n\t\turl,\n\t\tjson: true,\n\t};\n\n\tif (option && Object.keys(option).length !== 0) {\n\t\tObject.assign(options, option);\n\t}\n\n\treturn await this.helpers.httpRequestWithAuthentication.call(this, 'googlePalmApi', options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,eAAsB,WAErB,QACA,UACA,YACC;AACD,QAAM,EAAE,MAAM,IAAI,QAAQ,QAAQ,IAAI,cAAc,CAAC;AAErD,QAAM,cAAc,MAAM,KAAK,eAAe,eAAe;AAE7D,MAAI,MAAM,4CAA4C,QAAQ;AAE9D,MAAI,YAAY,KAAK;AACpB,UAAM,GAAG,aAAa,GAAa,GAAG,QAAQ;AAAA,EAC/C;AAEA,QAAM,UAAU;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,EACP;AAEA,MAAI,UAAU,OAAO,KAAK,MAAM,EAAE,WAAW,GAAG;AAC/C,WAAO,OAAO,SAAS,MAAM;AAAA,EAC9B;AAEA,SAAO,MAAM,KAAK,QAAQ,8BAA8B,KAAK,MAAM,iBAAiB,OAAO;AAC5F;","names":[]}
@@ -2,9 +2,9 @@
2
2
  {"name":"anthropicApi","displayName":"Anthropic","documentationUrl":"anthropic","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"string","default":"https://api.anthropic.com","description":"Override the default base URL for the API"}],"authenticate":{"type":"generic","properties":{"headers":{"x-api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials?.url}}","url":"/v1/messages","method":"POST","headers":{"anthropic-version":"2023-06-01"},"body":{"model":"claude-3-haiku-20240307","messages":[{"role":"user","content":"Hey"}],"max_tokens":1}}},"supportedNodes":["lmChatAnthropic"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LMChatAnthropic/anthropic.svg"},
3
3
  {"name":"azureOpenAiApi","displayName":"Azure Open AI","documentationUrl":"azureopenai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2025-03-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"}],"authenticate":{"type":"generic","properties":{"headers":{"api-key":"={{$credentials.apiKey}}"}}},"supportedNodes":["embeddingsAzureOpenAi","lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg"},
4
4
  {"name":"azureEntraCognitiveServicesOAuth2Api","displayName":"Azure Entra ID (Azure Active Directory) API","extends":["oAuth2Api"],"documentationUrl":"azureEntraCognitiveServicesOAuth2Api","properties":[{"displayName":"Grant Type","name":"grantType","type":"hidden","default":"authorizationCode"},{"displayName":"Resource Name","name":"resourceName","type":"string","required":true,"default":""},{"displayName":"API Version","name":"apiVersion","type":"string","required":true,"default":"2025-03-01-preview"},{"displayName":"Endpoint","name":"endpoint","type":"string","placeholder":"https://westeurope.api.cognitive.microsoft.com"},{"displayName":"Tenant ID","name":"tenantId","type":"string","default":"common","description":"Enter your Azure Tenant ID (Directory ID) or keep \"common\" for multi-tenant apps. Using a specific Tenant ID is generally recommended and required for certain authentication flows.","placeholder":"e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common"},{"displayName":"Authorization URL","name":"authUrl","type":"hidden","default":"=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/authorize"},{"displayName":"Access Token URL","name":"accessTokenUrl","type":"hidden","default":"=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/token"},{"displayName":"Additional Body Properties","name":"additionalBodyProperties","type":"hidden","default":"{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}"},{"displayName":"Authentication","name":"authentication","type":"hidden","default":"body"},{"displayName":"Custom Scopes","name":"customScopes","type":"boolean","default":false,"description":"Define custom scopes. You might need this if the default scopes are not sufficient or if you want to minimize permissions. Ensure you include \"openid\" and \"offline_access\"."},{"displayName":"Auth URI Query Parameters","name":"authQueryParameters","type":"hidden","default":"","description":"For some services additional query parameters have to be set which can be defined here","placeholder":""},{"displayName":"Enabled Scopes","name":"enabledScopes","type":"string","displayOptions":{"show":{"customScopes":[true]}},"default":"openid offline_access","placeholder":"openid offline_access","description":"Space-separated list of scopes to request."},{"displayName":"Scope","name":"scope","type":"hidden","default":"={{ $self.customScopes ? $self.enabledScopes : \"openid offline_access\"}}"}],"supportedNodes":["lmChatAzureOpenAi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAzureOpenAi/azure.svg"},
5
- {"name":"cohereApi","displayName":"CohereApi","documentationUrl":"cohere","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.cohere.ai","url":"/v1/models?page_size=1"}},"supportedNodes":["embeddingsCohere","lmCohere","rerankerCohere"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.dark.svg"}},
5
+ {"name":"cohereApi","displayName":"CohereApi","documentationUrl":"cohere","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.cohere.ai"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/v1/models?page_size=1"}},"supportedNodes":["embeddingsCohere","lmChatCohere","lmCohere","rerankerCohere"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsCohere/cohere.dark.svg"}},
6
6
  {"name":"deepSeekApi","displayName":"DeepSeek","documentationUrl":"deepseek","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.deepseek.com"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/models"}},"supportedNodes":["lmChatDeepSeek"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatDeepSeek/deepseek.svg"},
7
- {"name":"googlePalmApi","displayName":"Google Gemini(PaLM) Api","documentationUrl":"google","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://generativelanguage.googleapis.com"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/v1beta/models"}},"supportedNodes":["embeddingsGoogleGemini","lmChatGoogleGemini"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsGoogleGemini/google.svg"},
7
+ {"name":"googlePalmApi","displayName":"Google Gemini(PaLM) Api","documentationUrl":"google","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://generativelanguage.googleapis.com"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/v1beta/models"}},"supportedNodes":["googleGemini","embeddingsGoogleGemini","lmChatGoogleGemini"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vendors/GoogleGemini/gemini.svg"},
8
8
  {"name":"groqApi","displayName":"Groq","documentationUrl":"groq","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api.groq.com/openai/v1","url":"/models"}},"supportedNodes":["lmChatGroq"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatGroq/groq.svg"},
9
9
  {"name":"huggingFaceApi","displayName":"HuggingFaceApi","documentationUrl":"huggingface","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://api-inference.huggingface.co","url":"/models/gpt2"}},"supportedNodes":["embeddingsHuggingFaceInference","lmOpenHuggingFaceInference"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg"},
10
10
  {"name":"motorheadApi","displayName":"MotorheadApi","documentationUrl":"motorhead","properties":[{"displayName":"Host","name":"host","required":true,"type":"string","default":"https://api.getmetal.io/v1"},{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Client ID","name":"clientId","type":"string","default":""}],"authenticate":{"type":"generic","properties":{"headers":{"x-metal-client-id":"={{$credentials.clientId}}","x-metal-api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.host}}/keys/current"}},"supportedNodes":["memoryMotorhead"],"icon":"fa:file-export","iconColor":"black"},