n8n-nvidia-chat-agent 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # n8n-nodes-nvidia-chat
2
+
3
+ ## Custom Node para n8n - NVIDIA NIM Chat Agent
4
+
5
+ Este pacote contém um custom node para o n8n que permite integrar com a API da NVIDIA NIM para criar chat agents com modelos de IA.
6
+
7
+ ### 🚀 Modelos Suportados
8
+
9
+ - **Llama 3.1** (8B, 70B, 405B)
10
+ - **Llama 3.3** (70B)
11
+ - **Mixtral** (8x7B, 8x22B)
12
+ - **Nemotron** (340B)
13
+ - **DeepSeek R1**
14
+ - Modelos customizados
15
+
16
+ ### 📦 Instalação
17
+
18
+ 1. Instale as dependências:
19
+ ```bash
20
+ npm install
21
+ ```
22
+
23
+ 2. Compile o projeto:
24
+ ```bash
25
+ npm run build
26
+ ```
27
+
28
+ 3. Linke ao n8n (desenvolvimento):
29
+ ```bash
30
+ npm link
31
+ cd ~/.n8n
32
+ npm link n8n-nodes-nvidia-chat
33
+ ```
34
+
35
+ 4. Reinicie o n8n:
36
+ ```bash
37
+ n8n start
38
+ ```
39
+
40
+ ### 🔑 Configuração
41
+
42
+ 1. Acesse [NVIDIA Build](https://build.nvidia.com/) e crie uma conta
43
+ 2. Gere uma API Key
44
+ 3. No n8n, adicione uma credencial "NVIDIA NIM API" com sua chave
45
+
46
+ ### 📋 Operações Disponíveis
47
+
48
+ - **Chat Completion**: Envie uma mensagem e receba uma resposta
49
+ - **Chat com Histórico**: Mantenha contexto de conversação
50
+ - **Agent Autônomo**: Execute tarefas complexas com instruções detalhadas
51
+
52
+ ### 📄 Licença
53
+
54
+ MIT
@@ -0,0 +1,9 @@
1
+ import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class NvidiaApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NvidiaApi = void 0;
4
+ class NvidiaApi {
5
+ constructor() {
6
+ this.name = 'nvidiaApi';
7
+ this.displayName = 'NVIDIA NIM API';
8
+ this.documentationUrl = 'https://build.nvidia.com/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: {
15
+ password: true,
16
+ },
17
+ default: '',
18
+ required: true,
19
+ description: 'Sua chave de API do NVIDIA NIM. Obtenha em https://build.nvidia.com/',
20
+ },
21
+ {
22
+ displayName: 'Base URL',
23
+ name: 'baseUrl',
24
+ type: 'string',
25
+ default: 'https://integrate.api.nvidia.com/v1',
26
+ required: true,
27
+ description: 'URL base da API NVIDIA NIM',
28
+ },
29
+ ];
30
+ this.authenticate = {
31
+ type: 'generic',
32
+ properties: {
33
+ headers: {
34
+ Authorization: '=Bearer {{$credentials.apiKey}}',
35
+ 'Content-Type': 'application/json',
36
+ },
37
+ },
38
+ };
39
+ this.test = {
40
+ request: {
41
+ baseURL: '={{$credentials.baseUrl}}',
42
+ url: '/models',
43
+ method: 'GET',
44
+ },
45
+ };
46
+ }
47
+ }
48
+ exports.NvidiaApi = NvidiaApi;
49
+ //# sourceMappingURL=NvidiaApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NvidiaApi.credentials.js","sourceRoot":"","sources":["../../credentials/NvidiaApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,SAAS;IAAtB;QACE,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,qBAAgB,GAAG,+BAA+B,CAAC;QAEnD,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,sEAAsE;aACpF;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qCAAqC;gBAC9C,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,4BAA4B;aAC1C;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,aAAa,EAAE,iCAAiC;oBAChD,cAAc,EAAE,kBAAkB;iBACnC;aACF;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,SAAS;gBACd,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CAAA;AA5CD,8BA4CC"}
@@ -0,0 +1,2 @@
1
+ export * from './nodes/NvidiaChatAgent/NvidiaChatAgent.node';
2
+ export * from './credentials/NvidiaApi.credentials';
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Arquivo de entrada principal
3
+ // Exporta todos os nodes e credentials
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./nodes/NvidiaChatAgent/NvidiaChatAgent.node"), exports);
20
+ __exportStar(require("./credentials/NvidiaApi.credentials"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,uCAAuC;;;;;;;;;;;;;;;;AAEvC,+EAA6D;AAC7D,sEAAoD"}
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class NvidiaChatAgent implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,405 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NvidiaChatAgent = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ class NvidiaChatAgent {
6
+ constructor() {
7
+ this.description = {
8
+ displayName: 'NVIDIA Chat Agent',
9
+ name: 'nvidiaChatAgent',
10
+ icon: 'file:nvidia.svg',
11
+ group: ['transform'],
12
+ version: 1,
13
+ subtitle: '={{$parameter["operation"]}}',
14
+ description: 'Interaja com modelos de IA da NVIDIA NIM como um Chat Agent',
15
+ defaults: {
16
+ name: 'NVIDIA Chat Agent',
17
+ },
18
+ inputs: ['main'],
19
+ outputs: ['main'],
20
+ credentials: [
21
+ {
22
+ name: 'nvidiaApi',
23
+ required: true,
24
+ },
25
+ ],
26
+ properties: [
27
+ // ===== OPERAÇÃO =====
28
+ {
29
+ displayName: 'Operação',
30
+ name: 'operation',
31
+ type: 'options',
32
+ noDataExpression: true,
33
+ options: [
34
+ {
35
+ name: 'Chat Completion',
36
+ value: 'chatCompletion',
37
+ description: 'Enviar mensagem e receber resposta do modelo',
38
+ action: 'Enviar mensagem para o chat',
39
+ },
40
+ {
41
+ name: 'Chat com Histórico',
42
+ value: 'chatWithHistory',
43
+ description: 'Enviar mensagem com histórico de conversação',
44
+ action: 'Chat com histórico de conversação',
45
+ },
46
+ {
47
+ name: 'Agent Autônomo',
48
+ value: 'autonomousAgent',
49
+ description: 'Executar como agente autônomo com instruções de sistema',
50
+ action: 'Executar como agente autônomo',
51
+ },
52
+ ],
53
+ default: 'chatCompletion',
54
+ },
55
+ // ===== MODELO =====
56
+ {
57
+ displayName: 'Modelo',
58
+ name: 'model',
59
+ type: 'options',
60
+ options: [
61
+ {
62
+ name: 'Llama 3.1 405B',
63
+ value: 'meta/llama-3.1-405b-instruct',
64
+ },
65
+ {
66
+ name: 'Llama 3.1 70B',
67
+ value: 'meta/llama-3.1-70b-instruct',
68
+ },
69
+ {
70
+ name: 'Llama 3.1 8B',
71
+ value: 'meta/llama-3.1-8b-instruct',
72
+ },
73
+ {
74
+ name: 'Llama 3.3 70B',
75
+ value: 'meta/llama-3.3-70b-instruct',
76
+ },
77
+ {
78
+ name: 'Mixtral 8x22B',
79
+ value: 'mistralai/mixtral-8x22b-instruct-v0.1',
80
+ },
81
+ {
82
+ name: 'Mixtral 8x7B',
83
+ value: 'mistralai/mixtral-8x7b-instruct-v0.1',
84
+ },
85
+ {
86
+ name: 'Nemotron 70B',
87
+ value: 'nvidia/nemotron-4-340b-instruct',
88
+ },
89
+ {
90
+ name: 'DeepSeek R1',
91
+ value: 'deepseek-ai/deepseek-r1',
92
+ },
93
+ {
94
+ name: 'Modelo Customizado',
95
+ value: 'custom',
96
+ },
97
+ ],
98
+ default: 'meta/llama-3.1-70b-instruct',
99
+ description: 'Modelo da NVIDIA NIM a ser utilizado',
100
+ },
101
+ // ===== MODELO CUSTOMIZADO =====
102
+ {
103
+ displayName: 'ID do Modelo Customizado',
104
+ name: 'customModel',
105
+ type: 'string',
106
+ default: '',
107
+ placeholder: 'ex: nvidia/modelo-custom',
108
+ description: 'ID do modelo customizado hospedado no NVIDIA NIM',
109
+ displayOptions: {
110
+ show: {
111
+ model: ['custom'],
112
+ },
113
+ },
114
+ },
115
+ // ===== SYSTEM PROMPT =====
116
+ {
117
+ displayName: 'System Prompt',
118
+ name: 'systemPrompt',
119
+ type: 'string',
120
+ typeOptions: {
121
+ rows: 6,
122
+ },
123
+ default: 'Você é um assistente de IA útil, preciso e amigável. Responda sempre em português brasileiro.',
124
+ description: 'Instrução de sistema que define o comportamento do agente',
125
+ },
126
+ // ===== MENSAGEM DO USUÁRIO =====
127
+ {
128
+ displayName: 'Mensagem',
129
+ name: 'userMessage',
130
+ type: 'string',
131
+ typeOptions: {
132
+ rows: 4,
133
+ },
134
+ default: '',
135
+ required: true,
136
+ description: 'Mensagem do usuário para o chat agent',
137
+ displayOptions: {
138
+ show: {
139
+ operation: ['chatCompletion', 'autonomousAgent'],
140
+ },
141
+ },
142
+ },
143
+ // ===== HISTÓRICO (JSON) =====
144
+ {
145
+ displayName: 'Histórico de Mensagens (JSON)',
146
+ name: 'messageHistory',
147
+ type: 'json',
148
+ default: '[]',
149
+ description: 'Array JSON com o histórico de mensagens. Formato: [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]',
150
+ displayOptions: {
151
+ show: {
152
+ operation: ['chatWithHistory'],
153
+ },
154
+ },
155
+ },
156
+ // ===== NOVA MENSAGEM (HISTÓRICO) =====
157
+ {
158
+ displayName: 'Nova Mensagem',
159
+ name: 'newMessage',
160
+ type: 'string',
161
+ typeOptions: {
162
+ rows: 4,
163
+ },
164
+ default: '',
165
+ required: true,
166
+ description: 'Nova mensagem a ser adicionada ao histórico',
167
+ displayOptions: {
168
+ show: {
169
+ operation: ['chatWithHistory'],
170
+ },
171
+ },
172
+ },
173
+ // ===== INSTRUÇÕES DO AGENTE =====
174
+ {
175
+ displayName: 'Instruções do Agente',
176
+ name: 'agentInstructions',
177
+ type: 'string',
178
+ typeOptions: {
179
+ rows: 8,
180
+ },
181
+ default: `Você é um agente autônomo de IA. Siga estas diretrizes:
182
+
183
+ 1. Analise cuidadosamente a solicitação do usuário
184
+ 2. Quebre problemas complexos em etapas menores
185
+ 3. Forneça respostas estruturadas e detalhadas
186
+ 4. Sempre valide suas respostas antes de apresentá-las
187
+ 5. Se não tiver certeza, informe suas limitações`,
188
+ description: 'Instruções detalhadas para o comportamento do agente autônomo',
189
+ displayOptions: {
190
+ show: {
191
+ operation: ['autonomousAgent'],
192
+ },
193
+ },
194
+ },
195
+ // ===== OPÇÕES AVANÇADAS =====
196
+ {
197
+ displayName: 'Opções Avançadas',
198
+ name: 'advancedOptions',
199
+ type: 'collection',
200
+ placeholder: 'Adicionar Opção',
201
+ default: {},
202
+ options: [
203
+ {
204
+ displayName: 'Temperatura',
205
+ name: 'temperature',
206
+ type: 'number',
207
+ typeOptions: {
208
+ minValue: 0,
209
+ maxValue: 2,
210
+ numberPrecision: 2,
211
+ },
212
+ default: 0.7,
213
+ description: 'Controla a criatividade das respostas (0 = determinístico, 2 = muito criativo)',
214
+ },
215
+ {
216
+ displayName: 'Max Tokens',
217
+ name: 'maxTokens',
218
+ type: 'number',
219
+ typeOptions: {
220
+ minValue: 1,
221
+ maxValue: 16384,
222
+ },
223
+ default: 4096,
224
+ description: 'Número máximo de tokens na resposta',
225
+ },
226
+ {
227
+ displayName: 'Top P',
228
+ name: 'topP',
229
+ type: 'number',
230
+ typeOptions: {
231
+ minValue: 0,
232
+ maxValue: 1,
233
+ numberPrecision: 2,
234
+ },
235
+ default: 0.9,
236
+ description: 'Nucleus sampling - controla a diversidade das respostas',
237
+ },
238
+ {
239
+ displayName: 'Frequency Penalty',
240
+ name: 'frequencyPenalty',
241
+ type: 'number',
242
+ typeOptions: {
243
+ minValue: -2,
244
+ maxValue: 2,
245
+ numberPrecision: 2,
246
+ },
247
+ default: 0,
248
+ description: 'Penalidade por frequência de tokens repetidos',
249
+ },
250
+ {
251
+ displayName: 'Presence Penalty',
252
+ name: 'presencePenalty',
253
+ type: 'number',
254
+ typeOptions: {
255
+ minValue: -2,
256
+ maxValue: 2,
257
+ numberPrecision: 2,
258
+ },
259
+ default: 0,
260
+ description: 'Penalidade por presença de tokens já usados',
261
+ },
262
+ {
263
+ displayName: 'Stop Sequences',
264
+ name: 'stop',
265
+ type: 'string',
266
+ default: '',
267
+ description: 'Sequências de parada separadas por vírgula',
268
+ },
269
+ {
270
+ displayName: 'Seed',
271
+ name: 'seed',
272
+ type: 'number',
273
+ default: 0,
274
+ description: 'Seed para reprodutibilidade (0 = aleatório)',
275
+ },
276
+ {
277
+ displayName: 'Incluir Uso de Tokens',
278
+ name: 'includeUsage',
279
+ type: 'boolean',
280
+ default: true,
281
+ description: 'Incluir informações de uso de tokens na resposta',
282
+ },
283
+ ],
284
+ },
285
+ ],
286
+ };
287
+ }
288
+ async execute() {
289
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
290
+ const items = this.getInputData();
291
+ const returnData = [];
292
+ const credentials = await this.getCredentials('nvidiaApi');
293
+ const baseUrl = credentials.baseUrl;
294
+ for (let i = 0; i < items.length; i++) {
295
+ try {
296
+ const operation = this.getNodeParameter('operation', i);
297
+ const modelParam = this.getNodeParameter('model', i);
298
+ const model = modelParam === 'custom'
299
+ ? this.getNodeParameter('customModel', i)
300
+ : modelParam;
301
+ const systemPrompt = this.getNodeParameter('systemPrompt', i);
302
+ const advancedOptions = this.getNodeParameter('advancedOptions', i, {});
303
+ // Construir mensagens baseado da operação
304
+ const messages = [];
305
+ if (operation === 'chatCompletion') {
306
+ const userMessage = this.getNodeParameter('userMessage', i);
307
+ messages.push({ role: 'system', content: systemPrompt }, { role: 'user', content: userMessage });
308
+ }
309
+ else if (operation === 'chatWithHistory') {
310
+ const messageHistory = this.getNodeParameter('messageHistory', i);
311
+ const newMessage = this.getNodeParameter('newMessage', i);
312
+ let history = [];
313
+ try {
314
+ history = typeof messageHistory === 'string'
315
+ ? JSON.parse(messageHistory)
316
+ : messageHistory;
317
+ }
318
+ catch (e) {
319
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Histórico de mensagens inválido. Deve ser um JSON array válido.', { itemIndex: i });
320
+ }
321
+ messages.push({ role: 'system', content: systemPrompt }, ...history, { role: 'user', content: newMessage });
322
+ }
323
+ else if (operation === 'autonomousAgent') {
324
+ const userMessage = this.getNodeParameter('userMessage', i);
325
+ const agentInstructions = this.getNodeParameter('agentInstructions', i);
326
+ const fullSystemPrompt = `${agentInstructions}\n\nContexto adicional:\n${systemPrompt}`;
327
+ messages.push({ role: 'system', content: fullSystemPrompt }, { role: 'user', content: userMessage });
328
+ }
329
+ // Construir body da requisição
330
+ const body = {
331
+ model,
332
+ messages,
333
+ temperature: (_a = advancedOptions.temperature) !== null && _a !== void 0 ? _a : 0.7,
334
+ max_tokens: (_b = advancedOptions.maxTokens) !== null && _b !== void 0 ? _b : 4096,
335
+ top_p: (_c = advancedOptions.topP) !== null && _c !== void 0 ? _c : 0.9,
336
+ stream: false,
337
+ };
338
+ if (advancedOptions.frequencyPenalty) {
339
+ body.frequency_penalty = advancedOptions.frequencyPenalty;
340
+ }
341
+ if (advancedOptions.presencePenalty) {
342
+ body.presence_penalty = advancedOptions.presencePenalty;
343
+ }
344
+ if (advancedOptions.stop) {
345
+ body.stop = advancedOptions.stop.split(',').map((s) => s.trim());
346
+ }
347
+ if (advancedOptions.seed && advancedOptions.seed > 0) {
348
+ body.seed = advancedOptions.seed;
349
+ }
350
+ // Fazer requisição à API NVIDIA NIM
351
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'nvidiaApi', {
352
+ method: 'POST',
353
+ url: `${baseUrl}/chat/completions`,
354
+ body,
355
+ json: true,
356
+ headers: {
357
+ 'Content-Type': 'application/json',
358
+ },
359
+ });
360
+ // Processar resposta
361
+ const assistantMessage = (_g = (_f = (_e = (_d = response.choices) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.message) === null || _f === void 0 ? void 0 : _f.content) !== null && _g !== void 0 ? _g : '';
362
+ const finishReason = (_k = (_j = (_h = response.choices) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.finish_reason) !== null && _k !== void 0 ? _k : 'unknown';
363
+ // Construir histórico atualizado
364
+ const updatedHistory = [
365
+ ...messages,
366
+ { role: 'assistant', content: assistantMessage },
367
+ ];
368
+ const outputData = {
369
+ response: assistantMessage,
370
+ model: response.model,
371
+ finishReason,
372
+ messageHistory: updatedHistory,
373
+ operation,
374
+ };
375
+ // Incluir uso de tokens se solicitado
376
+ if (advancedOptions.includeUsage !== false && response.usage) {
377
+ outputData.usage = {
378
+ promptTokens: response.usage.prompt_tokens,
379
+ completionTokens: response.usage.completion_tokens,
380
+ totalTokens: response.usage.total_tokens,
381
+ };
382
+ }
383
+ returnData.push({
384
+ json: outputData,
385
+ pairedItem: { item: i },
386
+ });
387
+ }
388
+ catch (error) {
389
+ if (this.continueOnFail()) {
390
+ returnData.push({
391
+ json: {
392
+ error: error.message,
393
+ },
394
+ pairedItem: { item: i },
395
+ });
396
+ continue;
397
+ }
398
+ throw error;
399
+ }
400
+ }
401
+ return [returnData];
402
+ }
403
+ }
404
+ exports.NvidiaChatAgent = NvidiaChatAgent;
405
+ //# sourceMappingURL=NvidiaChatAgent.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NvidiaChatAgent.node.js","sourceRoot":"","sources":["../../../nodes/NvidiaChatAgent/NvidiaChatAgent.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AA2BtB,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACpC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,iBAAiB;YACvB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE;gBACV,IAAI,EAAE,mBAAmB;aACxB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,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AAC,CAAC;oBACH,SAAS;gBACT,CAAC;gBACD,MAAM,KAAK,CAAC;YACZ,CAAC;QACD,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACpB,CAAC;CACD;AAncD,0CAmcC"}
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#76B900">
2
+ <path d="M8.948 8.798v-1.43a6.7 6.7 0 0 1 .424-.018c3.922-.124 6.493 3.374 6.493 3.374s-2.81 3.807-5.834 3.807a5.2 5.2 0 0 1-1.083-.126v-4.563c1.593.164 1.915.864 2.86 2.412l2.124-1.78s-1.67-1.878-3.957-1.878a6.4 6.4 0 0 0-1.027.082zm0-4.578V5.77a10 10 0 0 1 .424-.012c5.944-.182 9.888 4.87 9.888 4.87s-4.52 5.456-8.827 5.456c-.528 0-1.017-.074-1.485-.196v1.463c.39.06.797.098 1.22.098 4.028 0 6.946-2.058 9.768-4.523.467.374 2.387 1.29 2.782 1.694-2.726 2.394-9.07 4.29-12.48 4.29a8 8 0 0 1-1.29-.108v1.684h14.074V4.22H8.948zM8.948 15.907V17.4c-4.394-.736-5.604-5.04-5.604-5.04s1.578-1.753 3.594-2.152v1.554l-.01-.002c-1.18-.356-2.084.933-2.084.933s.79 2.482 4.104 3.214z"/>
3
+ </svg>
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "n8n-nvidia-chat-agent",
3
+ "version": "1.0.0",
4
+ "description": "NVIDIA NIM Chat Agent node for n8n - Integrate with Llama, Mixtral, DeepSeek and other NVIDIA NIM models",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n-nodes",
8
+ "nvidia",
9
+ "nvidia-nim",
10
+ "chat",
11
+ "ai",
12
+ "llama",
13
+ "mixtral",
14
+ "deepseek",
15
+ "llm"
16
+ ],
17
+ "license": "MIT",
18
+ "homepage": "https://github.com/seu-usuario/n8n-nvidia-chat-agent#readme",
19
+ "author": {
20
+ "name": "kripors",
21
+ "email": "kripors@gmail.com"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/seu-usuario/n8n-nvidia-chat-agent.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/seu-usuario/n8n-nvidia-chat-agent/issues"
29
+ },
30
+ "main": "dist/index.js",
31
+ "scripts": {
32
+ "build": "tsc && gulp build:icons",
33
+ "dev": "tsc --watch",
34
+ "format": "prettier --write src/",
35
+ "lint": "eslint nodes credentials --ext .ts",
36
+ "prepublishOnly": "npm run build"
37
+ },
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "n8n": {
42
+ "n8nNodesApiVersion": 1,
43
+ "credentials": [
44
+ "dist/credentials/NvidiaApi.credentials.js"
45
+ ],
46
+ "nodes": [
47
+ "dist/nodes/NvidiaChatAgent/NvidiaChatAgent.node.js"
48
+ ]
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^20.0.0",
52
+ "eslint": "^8.56.0",
53
+ "gulp": "^4.0.2",
54
+ "n8n-workflow": "^1.20.0",
55
+ "prettier": "^3.2.0",
56
+ "typescript": "^5.3.0"
57
+ },
58
+ "peerDependencies": {
59
+ "n8n-workflow": "*"
60
+ },
61
+ "dependencies": {
62
+ "n8n-core": "^1.20.0"
63
+ }
64
+ }