@n8n/n8n-nodes-langchain 1.104.0 → 1.105.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 (27) hide show
  1. package/dist/credentials/VercelAiGatewayApi.credentials.js +81 -0
  2. package/dist/credentials/VercelAiGatewayApi.credentials.js.map +1 -0
  3. package/dist/known/credentials.json +7 -0
  4. package/dist/known/nodes.json +4 -0
  5. package/dist/nodes/ModelSelector/ModelSelector.node.js +13 -0
  6. package/dist/nodes/ModelSelector/ModelSelector.node.js.map +1 -1
  7. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +2 -0
  8. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
  9. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +85 -1
  10. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
  11. package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js +248 -0
  12. package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js.map +1 -0
  13. package/dist/nodes/llms/LmChatVercelAiGateway/vercel.dark.svg +1 -0
  14. package/dist/nodes/llms/LmChatVercelAiGateway/vercel.svg +6 -0
  15. package/dist/nodes/trigger/ChatTrigger/error.js +2 -2
  16. package/dist/nodes/trigger/ChatTrigger/error.js.map +1 -1
  17. package/dist/nodes/trigger/ChatTrigger/templates.js +1 -1
  18. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -1
  19. package/dist/nodes/vendors/Anthropic/actions/versionDescription.js +1 -1
  20. package/dist/nodes/vendors/Anthropic/actions/versionDescription.js.map +1 -1
  21. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js +2 -2
  22. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js.map +1 -1
  23. package/dist/types/credentials.json +1 -0
  24. package/dist/types/nodes.json +6 -5
  25. package/dist/utils/output_parsers/N8nStructuredOutputParser.js +1 -1
  26. package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -1
  27. package/package.json +8 -5
@@ -0,0 +1,248 @@
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 LmChatVercelAiGateway_node_exports = {};
20
+ __export(LmChatVercelAiGateway_node_exports, {
21
+ LmChatVercelAiGateway: () => LmChatVercelAiGateway
22
+ });
23
+ module.exports = __toCommonJS(LmChatVercelAiGateway_node_exports);
24
+ var import_openai = require("@langchain/openai");
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_httpProxyAgent = require("../../../utils/httpProxyAgent");
27
+ var import_sharedFields = require("../../../utils/sharedFields");
28
+ var import_error_handling = require("../../vendors/OpenAi/helpers/error-handling");
29
+ var import_n8nLlmFailedAttemptHandler = require("../n8nLlmFailedAttemptHandler");
30
+ var import_N8nLlmTracing = require("../N8nLlmTracing");
31
+ class LmChatVercelAiGateway {
32
+ constructor() {
33
+ this.description = {
34
+ displayName: "Vercel AI Gateway Chat Model",
35
+ name: "lmChatVercelAiGateway",
36
+ icon: { light: "file:vercel.dark.svg", dark: "file:vercel.svg" },
37
+ group: ["transform"],
38
+ version: [1],
39
+ description: "For advanced usage with an AI chain via Vercel AI Gateway",
40
+ defaults: {
41
+ name: "Vercel AI Gateway Chat Model"
42
+ },
43
+ codex: {
44
+ categories: ["AI"],
45
+ subcategories: {
46
+ AI: ["Language Models", "Root Nodes"],
47
+ "Language Models": ["Chat Models (Recommended)"]
48
+ },
49
+ resources: {
50
+ primaryDocumentation: [
51
+ {
52
+ url: "https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatvercel/"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ inputs: [],
58
+ outputs: [import_n8n_workflow.NodeConnectionTypes.AiLanguageModel],
59
+ outputNames: ["Model"],
60
+ credentials: [
61
+ {
62
+ name: "vercelAiGatewayApi",
63
+ required: true
64
+ }
65
+ ],
66
+ requestDefaults: {
67
+ ignoreHttpStatusErrors: true,
68
+ baseURL: "={{ $credentials?.url }}"
69
+ },
70
+ properties: [
71
+ (0, import_sharedFields.getConnectionHintNoticeField)([import_n8n_workflow.NodeConnectionTypes.AiChain, import_n8n_workflow.NodeConnectionTypes.AiAgent]),
72
+ {
73
+ displayName: 'If using JSON response format, you must include word "json" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',
74
+ name: "notice",
75
+ type: "notice",
76
+ default: "",
77
+ displayOptions: {
78
+ show: {
79
+ "/options.responseFormat": ["json_object"]
80
+ }
81
+ }
82
+ },
83
+ {
84
+ displayName: "Model",
85
+ name: "model",
86
+ type: "options",
87
+ description: "The model which will generate the completion",
88
+ typeOptions: {
89
+ loadOptions: {
90
+ routing: {
91
+ request: {
92
+ method: "GET",
93
+ url: "/models"
94
+ },
95
+ output: {
96
+ postReceive: [
97
+ {
98
+ type: "rootProperty",
99
+ properties: {
100
+ property: "data"
101
+ }
102
+ },
103
+ {
104
+ type: "setKeyValue",
105
+ properties: {
106
+ name: "={{$responseItem.id}}",
107
+ value: "={{$responseItem.id}}"
108
+ }
109
+ },
110
+ {
111
+ type: "sort",
112
+ properties: {
113
+ key: "name"
114
+ }
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ }
120
+ },
121
+ routing: {
122
+ send: {
123
+ type: "body",
124
+ property: "model"
125
+ }
126
+ },
127
+ default: "openai/gpt-4o"
128
+ },
129
+ {
130
+ displayName: "Options",
131
+ name: "options",
132
+ placeholder: "Add Option",
133
+ description: "Additional options to add",
134
+ type: "collection",
135
+ default: {},
136
+ options: [
137
+ {
138
+ displayName: "Frequency Penalty",
139
+ name: "frequencyPenalty",
140
+ default: 0,
141
+ typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
142
+ 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",
143
+ type: "number"
144
+ },
145
+ {
146
+ displayName: "Maximum Number of Tokens",
147
+ name: "maxTokens",
148
+ default: -1,
149
+ description: "The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).",
150
+ type: "number",
151
+ typeOptions: {
152
+ maxValue: 32768
153
+ }
154
+ },
155
+ {
156
+ displayName: "Response Format",
157
+ name: "responseFormat",
158
+ default: "text",
159
+ type: "options",
160
+ options: [
161
+ {
162
+ name: "Text",
163
+ value: "text",
164
+ description: "Regular text response"
165
+ },
166
+ {
167
+ name: "JSON",
168
+ value: "json_object",
169
+ description: "Enables JSON mode, which should guarantee the message the model generates is valid JSON"
170
+ }
171
+ ]
172
+ },
173
+ {
174
+ displayName: "Presence Penalty",
175
+ name: "presencePenalty",
176
+ default: 0,
177
+ typeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },
178
+ 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",
179
+ type: "number"
180
+ },
181
+ {
182
+ displayName: "Sampling Temperature",
183
+ name: "temperature",
184
+ default: 0.7,
185
+ typeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },
186
+ description: "Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.",
187
+ type: "number"
188
+ },
189
+ {
190
+ displayName: "Timeout",
191
+ name: "timeout",
192
+ default: 36e4,
193
+ description: "Maximum amount of time a request is allowed to take in milliseconds",
194
+ type: "number"
195
+ },
196
+ {
197
+ displayName: "Max Retries",
198
+ name: "maxRetries",
199
+ default: 2,
200
+ description: "Maximum number of retries to attempt",
201
+ type: "number"
202
+ },
203
+ {
204
+ displayName: "Top P",
205
+ name: "topP",
206
+ default: 1,
207
+ typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
208
+ description: "Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.",
209
+ type: "number"
210
+ }
211
+ ]
212
+ }
213
+ ]
214
+ };
215
+ }
216
+ async supplyData(itemIndex) {
217
+ const credentials = await this.getCredentials("vercelAiGatewayApi");
218
+ const modelName = this.getNodeParameter("model", itemIndex);
219
+ const options = this.getNodeParameter("options", itemIndex, {});
220
+ const configuration = {
221
+ baseURL: credentials.url,
222
+ fetchOptions: {
223
+ dispatcher: (0, import_httpProxyAgent.getProxyAgent)(credentials.url)
224
+ }
225
+ };
226
+ const model = new import_openai.ChatOpenAI({
227
+ openAIApiKey: credentials.apiKey,
228
+ model: modelName,
229
+ ...options,
230
+ timeout: options.timeout ?? 6e4,
231
+ maxRetries: options.maxRetries ?? 2,
232
+ configuration,
233
+ callbacks: [new import_N8nLlmTracing.N8nLlmTracing(this)],
234
+ modelKwargs: options.responseFormat ? {
235
+ response_format: { type: options.responseFormat }
236
+ } : void 0,
237
+ onFailedAttempt: (0, import_n8nLlmFailedAttemptHandler.makeN8nLlmFailedAttemptHandler)(this, import_error_handling.openAiFailedAttemptHandler)
238
+ });
239
+ return {
240
+ response: model
241
+ };
242
+ }
243
+ }
244
+ // Annotate the CommonJS export names for ESM import in node:
245
+ 0 && (module.exports = {
246
+ LmChatVercelAiGateway
247
+ });
248
+ //# sourceMappingURL=LmChatVercelAiGateway.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.ts"],"sourcesContent":["import { ChatOpenAI, type ClientOptions } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getProxyAgent } from '@utils/httpProxyAgent';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport type { OpenAICompatibleCredential } from '../../../types/types';\nimport { openAiFailedAttemptHandler } from '../../vendors/OpenAi/helpers/error-handling';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatVercelAiGateway implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Vercel AI Gateway Chat Model',\n\t\tname: 'lmChatVercelAiGateway',\n\t\ticon: { light: 'file:vercel.dark.svg', dark: 'file:vercel.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription: 'For advanced usage with an AI chain via Vercel AI Gateway',\n\t\tdefaults: {\n\t\t\tname: 'Vercel AI Gateway Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatvercel/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'vercelAiGatewayApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials?.url }}',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/options.responseFormat': ['json_object'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'The model which will generate the completion',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tloadOptions: {\n\t\t\t\t\t\trouting: {\n\t\t\t\t\t\t\trequest: {\n\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\turl: '/models',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\t\tpostReceive: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'rootProperty',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tproperty: 'data',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'setKeyValue',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tname: '={{$responseItem.id}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.id}}',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'sort',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tkey: 'name',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\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\trouting: {\n\t\t\t\t\tsend: {\n\t\t\t\t\t\ttype: 'body',\n\t\t\t\t\t\tproperty: 'model',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'openai/gpt-4o',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdescription: 'Additional options to add',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Frequency Penalty',\n\t\t\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\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\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Response Format',\n\t\t\t\t\t\tname: 'responseFormat',\n\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Regular text response',\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: 'JSON',\n\t\t\t\t\t\t\t\tvalue: 'json_object',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Enables JSON mode, which should guarantee the message the model generates is valid JSON',\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\t{\n\t\t\t\t\t\tdisplayName: 'Presence Penalty',\n\t\t\t\t\t\tname: 'presencePenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\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\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: 360000,\n\t\t\t\t\t\tdescription: 'Maximum amount of time a request is allowed to take in milliseconds',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials<OpenAICompatibleCredential>('vercelAiGatewayApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tfrequencyPenalty?: number;\n\t\t\tmaxTokens?: number;\n\t\t\tmaxRetries: number;\n\t\t\ttimeout: number;\n\t\t\tpresencePenalty?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopP?: number;\n\t\t\tresponseFormat?: 'text' | 'json_object';\n\t\t};\n\n\t\tconst configuration: ClientOptions = {\n\t\t\tbaseURL: credentials.url,\n\t\t\tfetchOptions: {\n\t\t\t\tdispatcher: getProxyAgent(credentials.url),\n\t\t\t},\n\t\t};\n\n\t\tconst model = new ChatOpenAI({\n\t\t\topenAIApiKey: credentials.apiKey,\n\t\t\tmodel: modelName,\n\t\t\t...options,\n\t\t\ttimeout: options.timeout ?? 60000,\n\t\t\tmaxRetries: options.maxRetries ?? 2,\n\t\t\tconfiguration,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tmodelKwargs: options.responseFormat\n\t\t\t\t? {\n\t\t\t\t\t\tresponse_format: { type: options.responseFormat },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this, openAiFailedAttemptHandler),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+C;AAC/C,0BAMO;AAEP,4BAA8B;AAC9B,0BAA6C;AAG7C,4BAA2C;AAC3C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,sBAA2C;AAAA,EAAjD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAE,OAAO,wBAAwB,MAAM,kBAAkB;AAAA,MAC/D,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,CAAC;AAAA,MACX,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,iBAAiB;AAAA,QAChB,wBAAwB;AAAA,QACxB,SAAS;AAAA,MACV;AAAA,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AuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAA2C,oBAAoB;AAE9F,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAW9D,UAAM,gBAA+B;AAAA,MACpC,SAAS,YAAY;AAAA,MACrB,cAAc;AAAA,QACb,gBAAY,qCAAc,YAAY,GAAG;AAAA,MAC1C;AAAA,IACD;AAEA,UAAM,QAAQ,IAAI,yBAAW;AAAA,MAC5B,cAAc,YAAY;AAAA,MAC1B,OAAO;AAAA,MACP,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW;AAAA,MAC5B,YAAY,QAAQ,cAAc;AAAA,MAClC;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,aAAa,QAAQ,iBAClB;AAAA,QACA,iBAAiB,EAAE,MAAM,QAAQ,eAAe;AAAA,MACjD,IACC;AAAA,MACH,qBAAiB,kEAA+B,MAAM,gDAA0B;AAAA,IACjF,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1 @@
1
+ <svg width="76" height="65" viewBox="0 0 76 65" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M37.5274 0L75.0548 65H0L37.5274 0Z" fill="#000000"/></svg>
@@ -0,0 +1,6 @@
1
+ <svg
2
+ width="76"
3
+ height="65"
4
+ viewBox="0 0 76 65"
5
+ fill="none" xmlns="http://www.w3.org/2000/svg"><path
6
+ d="M37.5274 0L75.0548 65H0L37.5274 0Z" fill="#ffffff"/></svg>
@@ -21,8 +21,8 @@ __export(error_exports, {
21
21
  ChatTriggerAuthorizationError: () => ChatTriggerAuthorizationError
22
22
  });
23
23
  module.exports = __toCommonJS(error_exports);
24
- var import_n8n_workflow = require("n8n-workflow");
25
- class ChatTriggerAuthorizationError extends import_n8n_workflow.ApplicationError {
24
+ var import_errors = require("@n8n/errors");
25
+ class ChatTriggerAuthorizationError extends import_errors.ApplicationError {
26
26
  constructor(responseCode, message) {
27
27
  if (message === void 0) {
28
28
  message = "Authorization problem!";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/error.ts"],"sourcesContent":["import { ApplicationError } from 'n8n-workflow';\n\nexport class ChatTriggerAuthorizationError extends ApplicationError {\n\tconstructor(\n\t\treadonly responseCode: number,\n\t\tmessage?: string,\n\t) {\n\t\tif (message === undefined) {\n\t\t\tmessage = 'Authorization problem!';\n\t\t\tif (responseCode === 401) {\n\t\t\t\tmessage = 'Authorization is required!';\n\t\t\t} else if (responseCode === 403) {\n\t\t\t\tmessage = 'Authorization data is wrong!';\n\t\t\t}\n\t\t}\n\t\tsuper(message);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiC;AAE1B,MAAM,sCAAsC,qCAAiB;AAAA,EACnE,YACU,cACT,SACC;AACD,QAAI,YAAY,QAAW;AAC1B,gBAAU;AACV,UAAI,iBAAiB,KAAK;AACzB,kBAAU;AAAA,MACX,WAAW,iBAAiB,KAAK;AAChC,kBAAU;AAAA,MACX;AAAA,IACD;AACA,UAAM,OAAO;AAXJ;AAAA,EAYV;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/error.ts"],"sourcesContent":["import { ApplicationError } from '@n8n/errors';\n\nexport class ChatTriggerAuthorizationError extends ApplicationError {\n\tconstructor(\n\t\treadonly responseCode: number,\n\t\tmessage?: string,\n\t) {\n\t\tif (message === undefined) {\n\t\t\tmessage = 'Authorization problem!';\n\t\t\tif (responseCode === 401) {\n\t\t\t\tmessage = 'Authorization is required!';\n\t\t\t} else if (responseCode === 403) {\n\t\t\t\tmessage = 'Authorization data is wrong!';\n\t\t\t}\n\t\t}\n\t\tsuper(message);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAiC;AAE1B,MAAM,sCAAsC,+BAAiB;AAAA,EACnE,YACU,cACT,SACC;AACD,QAAI,YAAY,QAAW;AAC1B,gBAAU;AACV,UAAI,iBAAiB,KAAK;AACzB,kBAAU;AAAA,MACX,WAAW,iBAAiB,KAAK;AAChC,kBAAU;AAAA,MACX;AAAA,IACD;AACA,UAAM,OAAO;AAXJ;AAAA,EAYV;AACD;","names":[]}
@@ -86,7 +86,7 @@ function createPage({
86
86
  </head>
87
87
  <body>
88
88
  <script type="module">
89
- import { createChat } from 'https://cdn.jsdelivr.net/npm/n8n-chat-atekron@0.49.0/dist/chat.bundle.es.js';
89
+ import { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';
90
90
 
91
91
  (async function () {
92
92
  const authentication = '${sanitizedAuthentication}';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/templates.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html';\n\nimport type { AuthenticationChatOption, LoadPreviousSessionChatOption } from './types';\nexport function createPage({\n\tinstanceId,\n\twebhookUrl,\n\tshowWelcomeScreen,\n\tloadPreviousSession,\n\ti18n: { en },\n\tinitialMessages,\n\tauthentication,\n\tallowFileUploads,\n\tallowedFilesMimeTypes,\n\tcustomCss,\n\tenableStreaming,\n}: {\n\tinstanceId: string;\n\twebhookUrl?: string;\n\tshowWelcomeScreen?: boolean;\n\tloadPreviousSession?: LoadPreviousSessionChatOption;\n\ti18n: {\n\t\ten: Record<string, string>;\n\t};\n\tinitialMessages: string[];\n\tmode: 'test' | 'production';\n\tauthentication: AuthenticationChatOption;\n\tallowFileUploads?: boolean;\n\tallowedFilesMimeTypes?: string;\n\tcustomCss?: string;\n\tenableStreaming?: boolean;\n}) {\n\tconst validAuthenticationOptions: AuthenticationChatOption[] = [\n\t\t'none',\n\t\t'basicAuth',\n\t\t'n8nUserAuth',\n\t];\n\tconst validLoadPreviousSessionOptions: LoadPreviousSessionChatOption[] = [\n\t\t'manually',\n\t\t'memory',\n\t\t'notSupported',\n\t];\n\n\tconst sanitizedAuthentication = validAuthenticationOptions.includes(authentication)\n\t\t? authentication\n\t\t: 'none';\n\tconst sanitizedShowWelcomeScreen = !!showWelcomeScreen;\n\tconst sanitizedAllowFileUploads = !!allowFileUploads;\n\tconst sanitizedAllowedFilesMimeTypes = allowedFilesMimeTypes?.toString() ?? '';\n\tconst sanitizedCustomCss = sanitizeHtml(`<style>${customCss?.toString() ?? ''}</style>`, {\n\t\tallowedTags: ['style'],\n\t\tallowedAttributes: false,\n\t});\n\n\tconst sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(\n\t\tloadPreviousSession as LoadPreviousSessionChatOption,\n\t)\n\t\t? loadPreviousSession\n\t\t: 'notSupported';\n\n\treturn `<!doctype html>\n\t<html lang=\"en\">\n\t\t<head>\n\t\t\t<meta charset=\"utf-8\">\n\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t\t<title>Chat</title>\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css\" rel=\"stylesheet\" />\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css\" rel=\"stylesheet\" />\n\t\t\t<style>\n\t\t\t\thtml,\n\t\t\t\tbody,\n\t\t\t\t#n8n-chat {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t${sanitizedCustomCss}\n\t\t</head>\n\t\t<body>\n\t\t\t<script type=\"module\">\n\t\t\t\timport { createChat } from 'https://cdn.jsdelivr.net/npm/n8n-chat-atekron@0.49.0/dist/chat.bundle.es.js';\n\n\t\t\t\t(async function () {\n\t\t\t\t\tconst authentication = '${sanitizedAuthentication}';\n\t\t\t\t\tlet metadata;\n\t\t\t\t\tif (authentication === 'n8nUserAuth') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst response = await fetch('/rest/login', {\n\t\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\t\theaders: { 'browser-id': localStorage.getItem('n8n-browserId') }\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (response.status !== 200) {\n\t\t\t\t\t\t\t\tthrow new Error('Not logged in');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst responseData = await response.json();\n\t\t\t\t\t\t\tmetadata = {\n\t\t\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\t\t\tid: responseData.data.id,\n\t\t\t\t\t\t\t\t\tfirstName: responseData.data.firstName,\n\t\t\t\t\t\t\t\t\tlastName: responseData.data.lastName,\n\t\t\t\t\t\t\t\t\temail: responseData.data.email,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\twindow.location.href = '/signin?redirect=' + window.location.href;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateChat({\n\t\t\t\t\t\tmode: 'fullscreen',\n\t\t\t\t\t\twebhookUrl: '${webhookUrl}',\n\t\t\t\t\t\tshowWelcomeScreen: ${sanitizedShowWelcomeScreen},\n\t\t\t\t\t\tloadPreviousSession: ${sanitizedLoadPreviousSession !== 'notSupported'},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t\twebhookConfig: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t\t'X-Instance-Id': '${instanceId}',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowFileUploads: ${sanitizedAllowFileUploads},\n\t\t\t\t\t\tallowedFilesMimeTypes: '${sanitizedAllowedFilesMimeTypes}',\n\t\t\t\t\t\ti18n: {\n\t\t\t\t\t\t\t${en ? `en: ${JSON.stringify(en)},` : ''}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t${initialMessages.length ? `initialMessages: ${JSON.stringify(initialMessages)},` : ''}\n\t\t\t\t\t\tenableStreaming: ${!!enableStreaming},\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t</script>\n\t\t</body>\n\t</html>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAyB;AAGlB,SAAS,WAAW;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM,EAAE,GAAG;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAeG;AACF,QAAM,6BAAyD;AAAA,IAC9D;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,QAAM,kCAAmE;AAAA,IACxE;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,QAAM,0BAA0B,2BAA2B,SAAS,cAAc,IAC/E,iBACA;AACH,QAAM,6BAA6B,CAAC,CAAC;AACrC,QAAM,4BAA4B,CAAC,CAAC;AACpC,QAAM,iCAAiC,uBAAuB,SAAS,KAAK;AAC5E,QAAM,yBAAqB,qBAAAA,SAAa,UAAU,WAAW,SAAS,KAAK,EAAE,YAAY;AAAA,IACxF,aAAa,CAAC,OAAO;AAAA,IACrB,mBAAmB;AAAA,EACpB,CAAC;AAED,QAAM,+BAA+B,gCAAgC;AAAA,IACpE;AAAA,EACD,IACG,sBACA;AAEH,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAgBH,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAOQ,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBA8BjC,UAAU;AAAA,2BACJ,0BAA0B;AAAA,6BACxB,iCAAiC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKhD,UAAU;AAAA;AAAA;AAAA,0BAGZ,yBAAyB;AAAA,gCACnB,8BAA8B;AAAA;AAAA,SAErD,KAAK,OAAO,KAAK,UAAU,EAAE,CAAC,MAAM,EAAE;AAAA;AAAA,QAEvC,gBAAgB,SAAS,oBAAoB,KAAK,UAAU,eAAe,CAAC,MAAM,EAAE;AAAA,yBACnE,CAAC,CAAC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAM1C;","names":["sanitizeHtml"]}
1
+ {"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/templates.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html';\n\nimport type { AuthenticationChatOption, LoadPreviousSessionChatOption } from './types';\nexport function createPage({\n\tinstanceId,\n\twebhookUrl,\n\tshowWelcomeScreen,\n\tloadPreviousSession,\n\ti18n: { en },\n\tinitialMessages,\n\tauthentication,\n\tallowFileUploads,\n\tallowedFilesMimeTypes,\n\tcustomCss,\n\tenableStreaming,\n}: {\n\tinstanceId: string;\n\twebhookUrl?: string;\n\tshowWelcomeScreen?: boolean;\n\tloadPreviousSession?: LoadPreviousSessionChatOption;\n\ti18n: {\n\t\ten: Record<string, string>;\n\t};\n\tinitialMessages: string[];\n\tmode: 'test' | 'production';\n\tauthentication: AuthenticationChatOption;\n\tallowFileUploads?: boolean;\n\tallowedFilesMimeTypes?: string;\n\tcustomCss?: string;\n\tenableStreaming?: boolean;\n}) {\n\tconst validAuthenticationOptions: AuthenticationChatOption[] = [\n\t\t'none',\n\t\t'basicAuth',\n\t\t'n8nUserAuth',\n\t];\n\tconst validLoadPreviousSessionOptions: LoadPreviousSessionChatOption[] = [\n\t\t'manually',\n\t\t'memory',\n\t\t'notSupported',\n\t];\n\n\tconst sanitizedAuthentication = validAuthenticationOptions.includes(authentication)\n\t\t? authentication\n\t\t: 'none';\n\tconst sanitizedShowWelcomeScreen = !!showWelcomeScreen;\n\tconst sanitizedAllowFileUploads = !!allowFileUploads;\n\tconst sanitizedAllowedFilesMimeTypes = allowedFilesMimeTypes?.toString() ?? '';\n\tconst sanitizedCustomCss = sanitizeHtml(`<style>${customCss?.toString() ?? ''}</style>`, {\n\t\tallowedTags: ['style'],\n\t\tallowedAttributes: false,\n\t});\n\n\tconst sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(\n\t\tloadPreviousSession as LoadPreviousSessionChatOption,\n\t)\n\t\t? loadPreviousSession\n\t\t: 'notSupported';\n\n\treturn `<!doctype html>\n\t<html lang=\"en\">\n\t\t<head>\n\t\t\t<meta charset=\"utf-8\">\n\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t\t<title>Chat</title>\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css\" rel=\"stylesheet\" />\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css\" rel=\"stylesheet\" />\n\t\t\t<style>\n\t\t\t\thtml,\n\t\t\t\tbody,\n\t\t\t\t#n8n-chat {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t${sanitizedCustomCss}\n\t\t</head>\n\t\t<body>\n\t\t\t<script type=\"module\">\n\t\t\t\timport { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';\n\n\t\t\t\t(async function () {\n\t\t\t\t\tconst authentication = '${sanitizedAuthentication}';\n\t\t\t\t\tlet metadata;\n\t\t\t\t\tif (authentication === 'n8nUserAuth') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst response = await fetch('/rest/login', {\n\t\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\t\theaders: { 'browser-id': localStorage.getItem('n8n-browserId') }\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (response.status !== 200) {\n\t\t\t\t\t\t\t\tthrow new Error('Not logged in');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst responseData = await response.json();\n\t\t\t\t\t\t\tmetadata = {\n\t\t\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\t\t\tid: responseData.data.id,\n\t\t\t\t\t\t\t\t\tfirstName: responseData.data.firstName,\n\t\t\t\t\t\t\t\t\tlastName: responseData.data.lastName,\n\t\t\t\t\t\t\t\t\temail: responseData.data.email,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\twindow.location.href = '/signin?redirect=' + window.location.href;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateChat({\n\t\t\t\t\t\tmode: 'fullscreen',\n\t\t\t\t\t\twebhookUrl: '${webhookUrl}',\n\t\t\t\t\t\tshowWelcomeScreen: ${sanitizedShowWelcomeScreen},\n\t\t\t\t\t\tloadPreviousSession: ${sanitizedLoadPreviousSession !== 'notSupported'},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t\twebhookConfig: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t\t'X-Instance-Id': '${instanceId}',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowFileUploads: ${sanitizedAllowFileUploads},\n\t\t\t\t\t\tallowedFilesMimeTypes: '${sanitizedAllowedFilesMimeTypes}',\n\t\t\t\t\t\ti18n: {\n\t\t\t\t\t\t\t${en ? `en: ${JSON.stringify(en)},` : ''}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t${initialMessages.length ? `initialMessages: ${JSON.stringify(initialMessages)},` : ''}\n\t\t\t\t\t\tenableStrea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;AAAA,6BACxB,iCAAiC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKhD,UAAU;AAAA;AAAA;AAAA,0BAGZ,yBAAyB;AAAA,gCACnB,8BAA8B;AAAA;AAAA,SAErD,KAAK,OAAO,KAAK,UAAU,EAAE,CAAC,MAAM,EAAE;AAAA;AAAA,QAEvC,gBAAgB,SAAS,oBAAoB,KAAK,UAAU,eAAe,CAAC,MAAM,EAAE;AAAA,yBACnE,CAAC,CAAC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAM1C;","names":["sanitizeHtml"]}
@@ -50,7 +50,7 @@ const versionDescription = {
50
50
  },
51
51
  usableAsTool: true,
52
52
  codex: {
53
- alias: ["LangChain", "document", "image", "assistant"],
53
+ alias: ["LangChain", "document", "image", "assistant", "claude"],
54
54
  categories: ["AI"],
55
55
  subcategories: {
56
56
  AI: ["Agents", "Miscellaneous", "Root Nodes"]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/vendors/Anthropic/actions/versionDescription.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow';\n\nimport * as document from './document';\nimport * as file from './file';\nimport * as image from './image';\nimport * as prompt from './prompt';\nimport * as text from './text';\n\nexport const versionDescription: INodeTypeDescription = {\n\tdisplayName: 'Anthropic',\n\tname: 'anthropic',\n\ticon: 'file:anthropic.svg',\n\tgroup: ['transform'],\n\tversion: 1,\n\tsubtitle: '={{ $parameter[\"operation\"] + \": \" + $parameter[\"resource\"] }}',\n\tdescription: 'Interact with Anthropic AI models',\n\tdefaults: {\n\t\tname: 'Anthropic',\n\t},\n\tusableAsTool: true,\n\tcodex: {\n\t\talias: ['LangChain', 'document', 'image', '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.anthropic/',\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: 'anthropicApi',\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: '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: 'Prompt',\n\t\t\t\t\tvalue: 'prompt',\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],\n\t\t\tdefault: 'text',\n\t\t},\n\t\t...document.description,\n\t\t...file.description,\n\t\t...image.description,\n\t\t...prompt.description,\n\t\t...text.description,\n\t],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA+D;AAE/D,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AAEf,MAAM,qBAA2C;AAAA,EACvD,aAAa;AA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3,"sources":["../../../../../nodes/vendors/Anthropic/actions/versionDescription.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport { NodeConnectionTypes, type INodeTypeDescription } from 'n8n-workflow';\n\nimport * as document from './document';\nimport * as file from './file';\nimport * as image from './image';\nimport * as prompt from './prompt';\nimport * as text from './text';\n\nexport const versionDescription: INodeTypeDescription = {\n\tdisplayName: 'Anthropic',\n\tname: 'anthropic',\n\ticon: 'file:anthropic.svg',\n\tgroup: ['transform'],\n\tversion: 1,\n\tsubtitle: '={{ $parameter[\"operation\"] + \": \" + $parameter[\"resource\"] }}',\n\tdescription: 'Interact with Anthropic AI models',\n\tdefaults: {\n\t\tname: 'Anthropic',\n\t},\n\tusableAsTool: true,\n\tcodex: {\n\t\talias: ['LangChain', 'document', 'image', 'assistant', 'claude'],\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.anthropic/',\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: 'anthropicApi',\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: '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: 'Prompt',\n\t\t\t\t\tvalue: 'prompt',\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],\n\t\t\tdefault: 'text',\n\t\t},\n\t\t...document.description,\n\t\t...file.description,\n\t\t...image.description,\n\t\t...prompt.description,\n\t\t...text.description,\n\t],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA+D;AAE/D,eAA0B;AAC1B,WAAsB;AACtB,YAAuB;AACvB,aAAwB;AACxB,WAAsB;AAEf,MAAM,qBAA2C;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,WAAW;AAAA,EACnB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,IACT,MAAM;AAAA,EACP;AAAA,EACA,cAAc;AAAA,EACd,OAAO;AAAA,IACN,OAAO,CAAC,aAAa,YAAY,SAAS,aAAa,QAAQ;AAAA,IAC/D,YAAY,CAAC,IAAI;AAAA,IACjB,eAAe;AAAA,MACd,IAAI,CAAC,UAAU,iBAAiB,YAAY;AAAA,IAC7C;AAAA,IACA,WAAW;AAAA,MACV,sBAAsB;AAAA,QACrB;AAAA,UACC,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWR,SAAS,CAAC,wCAAoB,IAAI;AAAA,EAClC,aAAa;AAAA,IACZ;AAAA,MACC,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,YAAY;AAAA,IACX;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,kBAAkB;AAAA,MAClB,SAAS;AAAA,QACR;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,MACD;AAAA,MACA,SAAS;AAAA,IACV;AAAA,IACA,GAAG,SAAS;AAAA,IACZ,GAAG,KAAK;AAAA,IACR,GAAG,MAAM;AAAA,IACT,GAAG,OAAO;AAAA,IACV,GAAG,KAAK;AAAA,EACT;AACD;","names":[]}
@@ -79,7 +79,7 @@ const properties = [
79
79
  name: "durationSeconds",
80
80
  type: "number",
81
81
  default: 8,
82
- description: "Length of the generated video in seconds",
82
+ description: "Length of the generated video in seconds. Supported only by certain models.",
83
83
  typeOptions: {
84
84
  minValue: 5,
85
85
  maxValue: 8
@@ -173,7 +173,7 @@ async function execute(i) {
173
173
  aspectRatio: options.aspectRatio,
174
174
  personGeneration: options.personGeneration,
175
175
  sampleCount: options.sampleCount ?? 1,
176
- durationSeconds: options.durationSeconds ?? 8
176
+ durationSeconds: options.durationSeconds
177
177
  }
178
178
  };
179
179
  let response = await import_transport.apiRequest.call(this, "POST", `/v1beta/${model}:predictLongRunning`, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../nodes/vendors/GoogleGemini/actions/video/generate.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError, updateDisplayOptions } from 'n8n-workflow';\n\nimport type { VeoResponse } from '../../helpers/interfaces';\nimport { downloadFile } from '../../helpers/utils';\nimport { apiRequest } from '../../transport';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('videoGenerationModelSearch'),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. Panning wide shot of a calico kitten sleeping in the sunshine',\n\t\tdescription: 'A text description of the desired video',\n\t\tdefault: '',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Return As',\n\t\tname: 'returnAs',\n\t\ttype: 'options',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Video',\n\t\t\t\tvalue: 'video',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'URL',\n\t\t\t\tvalue: 'url',\n\t\t\t},\n\t\t],\n\t\tdescription:\n\t\t\t'Whether to return the video as a binary file or a URL that can be used to download the video later',\n\t\tdefault: 'video',\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: 'Number of Videos',\n\t\t\t\tname: 'sampleCount',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'How many videos to generate',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tmaxValue: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Duration (Seconds)',\n\t\t\t\tname: 'durationSeconds',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 8,\n\t\t\t\tdescription: 'Length of the generated video in seconds',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 5,\n\t\t\t\t\tmaxValue: 8,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Aspect Ratio',\n\t\t\t\tname: 'aspectRatio',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Widescreen (16:9)',\n\t\t\t\t\t\tvalue: '16:9',\n\t\t\t\t\t\tdescription: 'Most common aspect ratio for televisions and monitors',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Portrait (9:16)',\n\t\t\t\t\t\tvalue: '9:16',\n\t\t\t\t\t\tdescription: 'Popular for short-form videos like YouTube Shorts',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: '16:9',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Person Generation',\n\t\t\t\tname: 'personGeneration',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Don't Allow\",\n\t\t\t\t\t\tvalue: 'dont_allow',\n\t\t\t\t\t\tdescription: 'Prevent generation of people in the video',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Allow Adult',\n\t\t\t\t\t\tvalue: 'allow_adult',\n\t\t\t\t\t\tdescription: 'Allow generation of adult people in the video',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Allow All',\n\t\t\t\t\t\tvalue: 'allow_all',\n\t\t\t\t\t\tdescription: 'Allow generation of all people in the video',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'dont_allow',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Put Output in Field',\n\t\t\t\tname: 'binaryPropertyOutput',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\thint: 'The name of the output field to put the binary file data in',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['generate'],\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\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst prompt = this.getNodeParameter('prompt', i, '') as string;\n\tconst returnAs = this.getNodeParameter('returnAs', i, 'video');\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst binaryPropertyOutput = this.getNodeParameter(\n\t\t'options.binaryPropertyOutput',\n\t\ti,\n\t\t'data',\n\t) as string;\n\tconst credentials = await this.getCredentials('googlePalmApi');\n\n\tif (!model.includes('veo')) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Model ${model} is not supported for video generation. Please use a Veo model`,\n\t\t\t{\n\t\t\t\tdescription: 'Video generation is only supported by Veo models',\n\t\t\t},\n\t\t);\n\t}\n\n\tconst body = {\n\t\tinstances: [\n\t\t\t{\n\t\t\t\tprompt,\n\t\t\t},\n\t\t],\n\t\tparameters: {\n\t\t\taspectRatio: options.aspectRatio,\n\t\t\tpersonGeneration: options.personGeneration,\n\t\t\tsampleCount: options.sampleCount ?? 1,\n\t\t\tdurationSeconds: options.durationSeconds ?? 8,\n\t\t},\n\t};\n\tlet response = (await apiRequest.call(this, 'POST', `/v1beta/${model}:predictLongRunning`, {\n\t\tbody,\n\t})) as VeoResponse;\n\n\twhile (!response.done) {\n\t\tawait new Promise((resolve) => setTimeout(resolve, 5000));\n\t\tresponse = (await apiRequest.call(this, 'GET', `/v1beta/${response.name}`)) as VeoResponse;\n\t}\n\n\tif (response.error) {\n\t\tthrow new NodeOperationError(this.getNode(), response.error.message, {\n\t\t\tdescription: 'Error generating video',\n\t\t});\n\t}\n\n\tif (returnAs === 'video') {\n\t\tconst promises = response.response.generateVideoResponse.generatedSamples.map(\n\t\t\tasync (sample) => {\n\t\t\t\tconst { fileContent, mimeType } = await downloadFile.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tsample.video.uri,\n\t\t\t\t\t'video/mp4',\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: credentials.apiKey as string,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tconst binaryData = await this.helpers.prepareBinaryData(fileContent, 'video.mp4', mimeType);\n\t\t\t\treturn {\n\t\t\t\t\tbinary: { [binaryPropertyOutput]: binaryData },\n\t\t\t\t\tjson: {\n\t\t\t\t\t\t...binaryData,\n\t\t\t\t\t\tdata: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tpairedItem: { item: i },\n\t\t\t\t};\n\t\t\t},\n\t\t);\n\n\t\treturn await Promise.all(promises);\n\t} else {\n\t\treturn response.response.generateVideoResponse.generatedSamples.map((sample) => ({\n\t\t\tjson: {\n\t\t\t\turl: sample.video.uri,\n\t\t\t},\n\t\t\tpairedItem: { item: i },\n\t\t}));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAyD;AAGzD,mBAA6B;AAC7B,uBAA2B;AAC3B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,MACrC,8BAAS,4BAA4B;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,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,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA,aACC;AAAA,IACD,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,SAAS;AAAA,MACR;AAAA,QACC,aAA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ACzE,OAAO,WAAW;AACjB,cAAM,EAAE,aAAa,SAAS,IAAI,MAAM,0BAAa;AAAA,UACpD;AAAA,UACA,OAAO,MAAM;AAAA,UACb;AAAA,UACA;AAAA,YACC,KAAK,YAAY;AAAA,UAClB;AAAA,QACD;AACA,cAAM,aAAa,MAAM,KAAK,QAAQ,kBAAkB,aAAa,aAAa,QAAQ;AAC1F,eAAO;AAAA,UACN,QAAQ,EAAE,CAAC,oBAAoB,GAAG,WAAW;AAAA,UAC7C,MAAM;AAAA,YACL,GAAG;AAAA,YACH,MAAM;AAAA,UACP;AAAA,UACA,YAAY,EAAE,MAAM,EAAE;AAAA,QACvB;AAAA,MACD;AAAA,IACD;AAEA,WAAO,MAAM,QAAQ,IAAI,QAAQ;AAAA,EAClC,OAAO;AACN,WAAO,SAAS,SAAS,sBAAsB,iBAAiB,IAAI,CAAC,YAAY;AAAA,MAChF,MAAM;AAAA,QACL,KAAK,OAAO,MAAM;AAAA,MACnB;AAAA,MACA,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB,EAAE;AAAA,EACH;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../../nodes/vendors/GoogleGemini/actions/video/generate.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { NodeOperationError, updateDisplayOptions } from 'n8n-workflow';\n\nimport type { VeoResponse } from '../../helpers/interfaces';\nimport { downloadFile } from '../../helpers/utils';\nimport { apiRequest } from '../../transport';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('videoGenerationModelSearch'),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. Panning wide shot of a calico kitten sleeping in the sunshine',\n\t\tdescription: 'A text description of the desired video',\n\t\tdefault: '',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Return As',\n\t\tname: 'returnAs',\n\t\ttype: 'options',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Video',\n\t\t\t\tvalue: 'video',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'URL',\n\t\t\t\tvalue: 'url',\n\t\t\t},\n\t\t],\n\t\tdescription:\n\t\t\t'Whether to return the video as a binary file or a URL that can be used to download the video later',\n\t\tdefault: 'video',\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: 'Number of Videos',\n\t\t\t\tname: 'sampleCount',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'How many videos to generate',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tmaxValue: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Duration (Seconds)',\n\t\t\t\tname: 'durationSeconds',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 8,\n\t\t\t\tdescription: 'Length of the generated video in seconds. Supported only by certain models.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 5,\n\t\t\t\t\tmaxValue: 8,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Aspect Ratio',\n\t\t\t\tname: 'aspectRatio',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Widescreen (16:9)',\n\t\t\t\t\t\tvalue: '16:9',\n\t\t\t\t\t\tdescription: 'Most common aspect ratio for televisions and monitors',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Portrait (9:16)',\n\t\t\t\t\t\tvalue: '9:16',\n\t\t\t\t\t\tdescription: 'Popular for short-form videos like YouTube Shorts',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: '16:9',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Person Generation',\n\t\t\t\tname: 'personGeneration',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"Don't Allow\",\n\t\t\t\t\t\tvalue: 'dont_allow',\n\t\t\t\t\t\tdescription: 'Prevent generation of people in the video',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Allow Adult',\n\t\t\t\t\t\tvalue: 'allow_adult',\n\t\t\t\t\t\tdescription: 'Allow generation of adult people in the video',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Allow All',\n\t\t\t\t\t\tvalue: 'allow_all',\n\t\t\t\t\t\tdescription: 'Allow generation of all people in the video',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'dont_allow',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Put Output in Field',\n\t\t\t\tname: 'binaryPropertyOutput',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\thint: 'The name of the output field to put the binary file data in',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['generate'],\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\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst prompt = this.getNodeParameter('prompt', i, '') as string;\n\tconst returnAs = this.getNodeParameter('returnAs', i, 'video');\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst binaryPropertyOutput = this.getNodeParameter(\n\t\t'options.binaryPropertyOutput',\n\t\ti,\n\t\t'data',\n\t) as string;\n\tconst credentials = await this.getCredentials('googlePalmApi');\n\n\tif (!model.includes('veo')) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Model ${model} is not supported for video generation. Please use a Veo model`,\n\t\t\t{\n\t\t\t\tdescription: 'Video generation is only supported by Veo models',\n\t\t\t},\n\t\t);\n\t}\n\n\tconst body = {\n\t\tinstances: [\n\t\t\t{\n\t\t\t\tprompt,\n\t\t\t},\n\t\t],\n\t\tparameters: {\n\t\t\taspectRatio: options.aspectRatio,\n\t\t\tpersonGeneration: options.personGeneration,\n\t\t\tsampleCount: options.sampleCount ?? 1,\n\t\t\tdurationSeconds: options.durationSeconds,\n\t\t},\n\t};\n\tlet response = (await apiRequest.call(this, 'POST', `/v1beta/${model}:predictLongRunning`, {\n\t\tbody,\n\t})) as VeoResponse;\n\n\twhile (!response.done) {\n\t\tawait new Promise((resolve) => setTimeout(resolve, 5000));\n\t\tresponse = (await apiRequest.call(this, 'GET', `/v1beta/${response.name}`)) as VeoResponse;\n\t}\n\n\tif (response.error) {\n\t\tthrow new NodeOperationError(this.getNode(), response.error.message, {\n\t\t\tdescription: 'Error generating video',\n\t\t});\n\t}\n\n\tif (returnAs === 'video') {\n\t\tconst promises = response.response.generateVideoResponse.generatedSamples.map(\n\t\t\tasync (sample) => {\n\t\t\t\tconst { fileContent, mimeType } = await downloadFile.call(\n\t\t\t\t\tthis,\n\t\t\t\t\tsample.video.uri,\n\t\t\t\t\t'video/mp4',\n\t\t\t\t\t{\n\t\t\t\t\t\tkey: credentials.apiKey as string,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tconst binaryData = await this.helpers.prepareBinaryData(fileContent, 'video.mp4', mimeType);\n\t\t\t\treturn {\n\t\t\t\t\tbinary: { [binaryPropertyOutput]: binaryData },\n\t\t\t\t\tjson: {\n\t\t\t\t\t\t...binaryData,\n\t\t\t\t\t\tdata: undefined,\n\t\t\t\t\t},\n\t\t\t\t\tpairedItem: { item: i },\n\t\t\t\t};\n\t\t\t},\n\t\t);\n\n\t\treturn await Promise.all(promises);\n\t} else {\n\t\treturn response.response.generateVideoResponse.generatedSamples.map((sample) => ({\n\t\t\tjson: {\n\t\t\t\turl: sample.video.uri,\n\t\t\t},\n\t\t\tpairedItem: { item: i },\n\t\t}));\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAyD;AAGzD,mBAA6B;AAC7B,uBAA2B;AAC3B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,MACrC,8BAAS,4BAA4B;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,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,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,IACA,aACC;AAAA,IACD,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,SAAS;AAAA,MACR;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,UAAU;AAAA,UACV,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,QACb,aAAa;AAAA,UACZ,UAAU;AAAA,UACV,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;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A,QACvB;AAAA,MACD;AAAA,IACD;AAEA,WAAO,MAAM,QAAQ,IAAI,QAAQ;AAAA,EAClC,OAAO;AACN,WAAO,SAAS,SAAS,sBAAsB,iBAAiB,IAAI,CAAC,YAAY;AAAA,MAChF,MAAM;AAAA,QACL,KAAK,OAAO,MAAM;AAAA,MACnB;AAAA,MACA,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB,EAAE;AAAA,EACH;AACD;","names":[]}
@@ -16,6 +16,7 @@
16
16
  {"name":"qdrantApi","displayName":"QdrantApi","documentationUrl":"https://docs.n8n.io/integrations/builtin/credentials/qdrant/","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":false,"default":""},{"displayName":"Qdrant URL","name":"qdrantUrl","type":"string","required":true,"default":""}],"authenticate":{"type":"generic","properties":{"headers":{"api-key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{$credentials.qdrantUrl}}","url":"/collections"}},"supportedNodes":["vectorStoreQdrant"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreQdrant/qdrant.svg"},
17
17
  {"name":"searXngApi","displayName":"SearXNG","documentationUrl":"searxng","properties":[{"displayName":"API URL","name":"apiUrl","type":"string","default":"","required":true}],"supportedNodes":["toolSearXng"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSearXng/searXng.svg"},
18
18
  {"name":"serpApi","displayName":"SerpAPI","documentationUrl":"serp","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"api_key":"={{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"https://serpapi.com","url":"/account.json "}},"supportedNodes":["toolSerpApi"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolSerpApi/serpApi.svg"},
19
+ {"name":"vercelAiGatewayApi","displayName":"Vercel AI Gateway","documentationUrl":"vercelaigateway","properties":[{"displayName":"API Key or OIDC Token","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":"","description":"Your credentials for the Vercel AI Gateway"},{"displayName":"Base URL","name":"url","type":"string","required":true,"default":"https://ai-gateway.vercel.sh/v1","description":"The base URL for your Vercel AI Gateway instance","placeholder":"https://ai-gateway.vercel.sh/v1"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}","http-referer":"https://n8n.io/","x-title":"n8n"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/chat/completions","method":"POST","headers":{"http-referer":"https://n8n.io/","x-title":"n8n"},"body":{"model":"openai/gpt-4.1-nano","messages":[{"role":"user","content":"test"}],"max_tokens":1}}},"supportedNodes":["lmChatVercelAiGateway"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatVercelAiGateway/vercel.dark.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatVercelAiGateway/vercel.svg"}},
19
20
  {"name":"weaviateApi","displayName":"Weaviate Credentials","documentationUrl":"https://docs.n8n.io/integrations/builtin/credentials/weaviate/","properties":[{"displayName":"Connection Type","name":"connection_type","type":"options","options":[{"name":"Weaviate Cloud","value":"weaviate_cloud"},{"name":"Custom Connection","value":"custom_connection"}],"default":"weaviate_cloud","description":"Choose whether to connect to a Weaviate Cloud instance or a custom Weaviate instance."},{"displayName":"Weaviate Cloud Endpoint","name":"weaviate_cloud_endpoint","description":"The Endpoint of a Weaviate Cloud instance.","placeholder":"https://your-cluster.weaviate.cloud","type":"string","required":true,"default":"","displayOptions":{"show":{"connection_type":["weaviate_cloud"]}}},{"displayName":"Weaviate Api Key","name":"weaviate_api_key","description":"The API key for the Weaviate instance.","type":"string","typeOptions":{"password":true},"default":""},{"displayName":"Custom Connection HTTP Host","name":"custom_connection_http_host","description":"The host of your Weaviate instance.","type":"string","required":true,"default":"weaviate","displayOptions":{"show":{"connection_type":["custom_connection"]}}},{"displayName":"Custom Connection HTTP Port","name":"custom_connection_http_port","description":"The port of your Weaviate instance.","type":"number","required":true,"default":8080,"displayOptions":{"show":{"connection_type":["custom_connection"]}}},{"displayName":"Custom Connection HTTP Secure","name":"custom_connection_http_secure","description":"Whether to use a secure connection for HTTP.","type":"boolean","required":true,"default":false,"displayOptions":{"show":{"connection_type":["custom_connection"]}}},{"displayName":"Custom Connection gRPC Host","name":"custom_connection_grpc_host","description":"The gRPC host of your Weaviate instance.","type":"string","required":true,"default":"weaviate","displayOptions":{"show":{"connection_type":["custom_connection"]}}},{"displayName":"Custom Connection gRPC Port","name":"custom_connection_grpc_port","description":"The gRPC port of your Weaviate instance.","type":"number","required":true,"default":50051,"displayOptions":{"show":{"connection_type":["custom_connection"]}}},{"displayName":"Custom Connection gRPC Secure","name":"custom_connection_grpc_secure","description":"Whether to use a secure connection for gRPC.","type":"boolean","required":true,"default":false,"displayOptions":{"show":{"connection_type":["custom_connection"]}}}],"test":{"request":{"baseURL":"={{$credentials.weaviate_cloud_endpoint?$credentials.weaviate_cloud_endpoint.startsWith(\"http://\") || $credentials.weaviate_cloud_endpoint.startsWith(\"https://\")?$credentials.weaviate_cloud_endpoint:\"https://\" + $credentials.weaviate_cloud_endpoint:($credentials.custom_connection_http_secure ? \"https\" : \"http\") + \"://\" + $credentials.custom_connection_http_host + \":\" + $credentials.custom_connection_http_port }}","url":"/v1/nodes","disableFollowRedirect":false,"headers":{"Authorization":"={{$if($credentials.weaviate_api_key, \"Bearer \" + $credentials.weaviate_api_key, undefined)}}"}}},"supportedNodes":["vectorStoreWeaviate"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/vector_store/VectorStoreWeaviate/weaviate.svg"},
20
21
  {"name":"wolframAlphaApi","displayName":"WolframAlphaApi","documentationUrl":"wolframalpha","properties":[{"displayName":"App ID","name":"appId","type":"string","typeOptions":{"password":true},"required":true,"default":""}],"authenticate":{"type":"generic","properties":{"qs":{"api_key":"={{$credentials.appId}}"}}},"test":{"request":{"baseURL":"https://api.wolframalpha.com/v1","url":"=/simple","qs":{"i":"How much is 1 1","appid":"={{$credentials.appId}}"}}},"supportedNodes":["toolWolframAlpha"],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg"},
21
22
  {"name":"xAiApi","displayName":"xAi","documentationUrl":"xai","properties":[{"displayName":"API Key","name":"apiKey","type":"string","typeOptions":{"password":true},"required":true,"default":""},{"displayName":"Base URL","name":"url","type":"hidden","default":"https://api.x.ai/v1"}],"authenticate":{"type":"generic","properties":{"headers":{"Authorization":"=Bearer {{$credentials.apiKey}}"}}},"test":{"request":{"baseURL":"={{ $credentials.url }}","url":"/models"}},"supportedNodes":["lmChatXAiGrok"],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.dark.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatXAiGrok/logo.svg"}},