n8n-nodes-github-copilot 4.4.17 → 4.5.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.
@@ -1,432 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nodeProperties = void 0;
4
- const ModelProperties_1 = require("../../shared/properties/ModelProperties");
5
- exports.nodeProperties = [
6
- ...ModelProperties_1.CHAT_MODEL_PROPERTIES,
7
- {
8
- displayName: 'Messages Input Mode',
9
- name: 'messagesInputMode',
10
- type: 'options',
11
- options: [
12
- {
13
- name: 'Manual (UI)',
14
- value: 'manual',
15
- description: 'Enter messages one by one using the UI',
16
- },
17
- {
18
- name: 'JSON (Programmatic)',
19
- value: 'json',
20
- description: 'Provide messages as JSON array',
21
- },
22
- ],
23
- default: 'manual',
24
- description: 'How to provide the messages for the conversation',
25
- },
26
- {
27
- displayName: 'Messages (JSON)',
28
- name: 'messagesJson',
29
- type: 'json',
30
- default: `[
31
- {
32
- "role": "system",
33
- "content": "You are a helpful assistant."
34
- },
35
- {
36
- "role": "user",
37
- "content": "Hello!"
38
- }
39
- ]`,
40
- placeholder: 'Enter messages as JSON array',
41
- description: 'Array of messages in OpenAI format: [{"role": "user", "content": "..."}]',
42
- displayOptions: {
43
- show: {
44
- messagesInputMode: ['json'],
45
- },
46
- },
47
- },
48
- {
49
- displayName: 'Messages',
50
- name: 'messages',
51
- type: 'fixedCollection',
52
- typeOptions: {
53
- multipleValues: true,
54
- sortable: true,
4
+ const chatCompletionProperties_1 = require("./properties/chatCompletionProperties");
5
+ const modelsProperties_1 = require("./properties/modelsProperties");
6
+ function forOperation(props, operation) {
7
+ return props.map((p) => {
8
+ var _a;
9
+ return ({
10
+ ...p,
11
+ displayOptions: {
12
+ ...p.displayOptions,
13
+ show: {
14
+ ...(_a = p.displayOptions) === null || _a === void 0 ? void 0 : _a.show,
15
+ operation: [operation],
16
+ },
17
+ },
18
+ });
19
+ });
20
+ }
21
+ const OPERATION_PROPERTY = {
22
+ displayName: 'Operation',
23
+ name: 'operation',
24
+ type: 'options',
25
+ noDataExpression: true,
26
+ options: [
27
+ {
28
+ name: 'Chat Completions',
29
+ value: 'chatCompletions',
30
+ description: 'Send messages and receive AI completions',
31
+ action: 'Chat Completions',
55
32
  },
56
- default: {
57
- message: [
58
- {
59
- role: 'user',
60
- content: '',
61
- },
62
- ],
33
+ {
34
+ name: 'List Models',
35
+ value: 'listModels',
36
+ description: 'Return available models in OpenAI-compatible format (GET /v1/models)',
37
+ action: 'List Models',
63
38
  },
64
- displayOptions: {
65
- show: {
66
- messagesInputMode: ['manual'],
67
- },
68
- },
69
- options: [
70
- {
71
- name: 'message',
72
- displayName: 'Message',
73
- values: [
74
- {
75
- displayName: 'Role',
76
- name: 'role',
77
- type: 'options',
78
- options: [
79
- {
80
- name: 'System',
81
- value: 'system',
82
- description: 'System message to set the behavior of the AI',
83
- },
84
- {
85
- name: 'User',
86
- value: 'user',
87
- description: 'Message from the user',
88
- },
89
- {
90
- name: 'Assistant',
91
- value: 'assistant',
92
- description: 'Previous response from the AI assistant',
93
- },
94
- ],
95
- default: 'user',
96
- },
97
- {
98
- displayName: 'Content',
99
- name: 'content',
100
- type: 'string',
101
- typeOptions: {
102
- rows: 3,
103
- },
104
- default: '',
105
- placeholder: 'Enter message content...',
106
- description: 'The content of the message',
107
- displayOptions: {
108
- show: {
109
- type: ['text', 'file'],
110
- },
111
- },
112
- },
113
- {
114
- displayName: 'Caption',
115
- name: 'caption',
116
- type: 'string',
117
- typeOptions: {
118
- rows: 2,
119
- },
120
- default: '',
121
- placeholder: 'Optional prompt for the image...',
122
- description: 'Text to accompany the image (optional)',
123
- displayOptions: {
124
- show: {
125
- type: ['file_binary'],
126
- },
127
- },
128
- },
129
- {
130
- displayName: 'Type',
131
- name: 'type',
132
- type: 'options',
133
- options: [
134
- {
135
- name: 'Text',
136
- value: 'text',
137
- description: 'Regular text message',
138
- },
139
- {
140
- name: 'File (URL / Base64)',
141
- value: 'file',
142
- description: 'File attachment using URL or Base64 string',
143
- },
144
- {
145
- name: 'File (Binary)',
146
- value: 'file_binary',
147
- description: 'File attachment from binary input',
148
- },
149
- ],
150
- default: 'text',
151
- description: 'The type of message content',
152
- },
153
- {
154
- displayName: 'Input Binary Field',
155
- name: 'binaryPropertyName',
156
- type: 'string',
157
- default: 'data',
158
- required: true,
159
- displayOptions: {
160
- show: {
161
- type: ['file_binary'],
162
- },
163
- },
164
- description: 'The name of the binary property that contains the file to upload',
165
- },
166
- ],
167
- },
168
- ],
169
- description: 'Array of messages for the conversation',
170
- },
171
- {
172
- displayName: 'Advanced Options',
173
- name: 'advancedOptions',
174
- type: 'collection',
175
- placeholder: 'Add Advanced Option',
176
- default: {},
177
- options: [
178
- {
179
- displayName: 'Response Format',
180
- name: 'response_format',
181
- type: 'options',
182
- options: [
183
- {
184
- name: 'Text',
185
- value: 'text',
186
- description: 'Return response as plain text',
187
- },
188
- {
189
- name: 'JSON Object',
190
- value: 'json_object',
191
- description: 'Return response as JSON object',
192
- },
193
- ],
194
- default: 'text',
195
- description: 'The format of the response',
196
- },
197
- {
198
- displayName: 'Temperature',
199
- name: 'temperature',
200
- type: 'number',
201
- typeOptions: {
202
- minValue: 0,
203
- maxValue: 2,
204
- numberPrecision: 2,
205
- },
206
- default: 1,
207
- description: 'Controls randomness in the response. Lower values make responses more focused and deterministic.',
208
- },
209
- {
210
- displayName: 'Max Tokens',
211
- name: 'max_tokens',
212
- type: 'number',
213
- typeOptions: {
214
- minValue: 1,
215
- maxValue: 16384,
216
- },
217
- default: 4096,
218
- placeholder: '4096',
219
- description: 'Maximum number of tokens to generate in the response',
220
- hint: 'Default: 4096 tokens. Increase for longer responses, decrease for shorter ones.',
221
- },
222
- {
223
- displayName: 'Top P',
224
- name: 'top_p',
225
- type: 'number',
226
- typeOptions: {
227
- minValue: 0,
228
- maxValue: 1,
229
- numberPrecision: 2,
230
- },
231
- default: 1,
232
- description: 'Controls diversity via nucleus sampling',
233
- },
234
- {
235
- displayName: 'Frequency Penalty',
236
- name: 'frequency_penalty',
237
- type: 'number',
238
- typeOptions: {
239
- minValue: -2,
240
- maxValue: 2,
241
- numberPrecision: 2,
242
- },
243
- default: 0,
244
- description: 'Penalty for repeated tokens based on their frequency',
245
- },
246
- {
247
- displayName: 'Presence Penalty',
248
- name: 'presence_penalty',
249
- type: 'number',
250
- typeOptions: {
251
- minValue: -2,
252
- maxValue: 2,
253
- numberPrecision: 2,
254
- },
255
- default: 0,
256
- description: 'Penalty for repeated tokens based on their presence',
257
- },
258
- {
259
- displayName: 'Stop Sequences',
260
- name: 'stop',
261
- type: 'string',
262
- default: '',
263
- placeholder: '["\\n", "Human:", "AI:"]',
264
- description: 'JSON array of strings where the API will stop generating tokens',
265
- },
266
- {
267
- displayName: 'Stream',
268
- name: 'stream',
269
- type: 'boolean',
270
- default: false,
271
- description: 'Whether to stream the response',
272
- },
273
- {
274
- displayName: 'Seed',
275
- name: 'seed',
276
- type: 'number',
277
- default: 0,
278
- placeholder: '12345',
279
- description: 'Seed for deterministic sampling (0 = disabled)',
280
- },
281
- {
282
- displayName: 'User ID',
283
- name: 'user',
284
- type: 'string',
285
- default: '',
286
- placeholder: 'user-123',
287
- description: 'Unique identifier for the end-user',
288
- },
289
- {
290
- displayName: 'Tools (Function Calling)',
291
- name: 'tools',
292
- type: 'string',
293
- default: '',
294
- typeOptions: {
295
- rows: 10,
296
- },
297
- placeholder: `[
298
- {
299
- "type": "function",
300
- "function": {
301
- "name": "get_weather",
302
- "description": "Get current weather",
303
- "parameters": {
304
- "type": "object",
305
- "properties": {
306
- "location": {
307
- "type": "string",
308
- "description": "City name"
309
- }
310
- },
311
- "required": ["location"]
312
- }
313
- }
314
- }
315
- ]`,
316
- description: 'Optional: Array of tools/functions available to the model (OpenAI format). Leave empty if not using function calling.',
317
- hint: "JSON array of tool definitions in OpenAI format. Leave this field empty if you don't need function calling.",
318
- },
319
- {
320
- displayName: 'Tool Choice',
321
- name: 'tool_choice',
322
- type: 'options',
323
- options: [
324
- {
325
- name: 'Auto',
326
- value: 'auto',
327
- description: 'Let the model decide whether to call functions',
328
- },
329
- {
330
- name: 'None',
331
- value: 'none',
332
- description: 'Force the model to not call any functions',
333
- },
334
- {
335
- name: 'Required',
336
- value: 'required',
337
- description: 'Force the model to call at least one function',
338
- },
339
- ],
340
- default: 'auto',
341
- description: 'Control how the model uses tools',
342
- displayOptions: {
343
- show: {
344
- tools: ['/.+/'],
345
- },
346
- },
347
- },
348
- {
349
- displayName: 'Enable Retry',
350
- name: 'enableRetry',
351
- type: 'boolean',
352
- default: true,
353
- description: 'Whether to retry failed requests',
354
- },
355
- {
356
- displayName: 'Max Retries',
357
- name: 'maxRetries',
358
- type: 'number',
359
- default: 3,
360
- description: 'Maximum number of retries for failed requests',
361
- displayOptions: {
362
- show: {
363
- enableRetry: [true],
364
- },
365
- },
366
- },
367
- {
368
- displayName: 'Retry Delay (ms)',
369
- name: 'retryDelay',
370
- type: 'number',
371
- default: 1000,
372
- description: 'Delay between retries in milliseconds',
373
- displayOptions: {
374
- show: {
375
- enableRetry: [true],
376
- },
377
- },
378
- },
379
- {
380
- displayName: 'Request Timeout (ms)',
381
- name: 'timeout',
382
- type: 'number',
383
- default: 60000,
384
- description: 'Request timeout in milliseconds',
385
- },
386
- {
387
- displayName: 'Debug Mode',
388
- name: 'debugMode',
389
- type: 'boolean',
390
- default: false,
391
- description: 'Enable debug logging',
392
- },
393
- {
394
- displayName: 'Enable Vision Fallback',
395
- name: 'enableVisionFallback',
396
- type: 'boolean',
397
- default: false,
398
- description: 'When the primary model does not support vision, automatically use a vision-capable fallback model to process images. Enable this if you want to send images but your primary model does not support vision.',
399
- },
400
- {
401
- displayName: 'Vision Fallback Model',
402
- name: 'visionFallbackModel',
403
- type: 'options',
404
- typeOptions: {
405
- loadOptionsMethod: 'getVisionFallbackModels',
406
- },
407
- default: '',
408
- description: 'Select a vision-capable model to use when processing images with a non-vision primary model',
409
- displayOptions: {
410
- show: {
411
- enableVisionFallback: [true],
412
- },
413
- },
414
- },
415
- {
416
- displayName: 'Custom Vision Model',
417
- name: 'visionFallbackCustomModel',
418
- type: 'string',
419
- default: '',
420
- placeholder: 'gpt-4o, claude-sonnet-4, gemini-2.0-flash, etc.',
421
- description: 'Enter the model name manually for vision fallback',
422
- hint: 'Enter the exact model ID for vision processing (e.g., gpt-4o, claude-sonnet-4)',
423
- displayOptions: {
424
- show: {
425
- enableVisionFallback: [true],
426
- visionFallbackModel: ['__manual__'],
427
- },
428
- },
429
- },
430
- ],
431
- },
39
+ ],
40
+ default: 'chatCompletions',
41
+ };
42
+ exports.nodeProperties = [
43
+ OPERATION_PROPERTY,
44
+ ...forOperation(chatCompletionProperties_1.CHAT_COMPLETION_PROPERTIES, 'chatCompletions'),
45
+ ...forOperation(modelsProperties_1.MODELS_PROPERTIES, 'listModels'),
432
46
  ];
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const CHAT_COMPLETION_PROPERTIES: INodeProperties[];