n8n-nodes-github-copilot 3.38.24 → 3.38.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/GitHubCopilotApi.credentials.d.ts +1 -1
- package/dist/credentials/GitHubCopilotApi.credentials.js +25 -25
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +166 -166
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.js +539 -539
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +46 -44
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +82 -82
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +26 -26
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +12 -12
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +4 -4
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +19 -19
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +23 -23
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +163 -110
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.js +114 -114
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +74 -69
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +181 -181
- package/dist/nodes/GitHubCopilotOpenAI/utils/index.d.ts +2 -2
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.d.ts +10 -10
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.js +53 -53
- package/dist/nodes/GitHubCopilotOpenAI/utils/types.d.ts +12 -12
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.js +120 -116
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ async function listAvailableModels(token, enableRetry = true, maxRetries = 3) {
|
|
|
14
14
|
for (let attempt = 1; attempt <= maxRetries + 1; attempt++) {
|
|
15
15
|
try {
|
|
16
16
|
const response = await fetch(GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getModelsUrl(), {
|
|
17
|
-
method:
|
|
17
|
+
method: 'GET',
|
|
18
18
|
headers: GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getAuthHeaders(token),
|
|
19
19
|
});
|
|
20
20
|
if (!response.ok) {
|
|
@@ -55,12 +55,12 @@ async function listAvailableModels(token, enableRetry = true, maxRetries = 3) {
|
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
57
|
if (attempt >= maxRetries + 1 || !enableRetry) {
|
|
58
|
-
const errorMessage = error instanceof Error ? error.message :
|
|
58
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
59
59
|
return {
|
|
60
60
|
success: false,
|
|
61
61
|
timestamp: new Date().toISOString(),
|
|
62
62
|
error: errorMessage,
|
|
63
|
-
details:
|
|
63
|
+
details: 'Failed to fetch models from GitHub Copilot API',
|
|
64
64
|
retryInfo: {
|
|
65
65
|
totalAttempts: retryInfo.attempts,
|
|
66
66
|
totalRetries: retryInfo.retries.length,
|
|
@@ -76,8 +76,8 @@ async function listAvailableModels(token, enableRetry = true, maxRetries = 3) {
|
|
|
76
76
|
return {
|
|
77
77
|
success: false,
|
|
78
78
|
timestamp: new Date().toISOString(),
|
|
79
|
-
error:
|
|
80
|
-
details:
|
|
79
|
+
error: 'Maximum retry attempts exceeded',
|
|
80
|
+
details: 'Failed to fetch models after all retry attempts',
|
|
81
81
|
retryInfo: {
|
|
82
82
|
totalAttempts: retryInfo.attempts,
|
|
83
83
|
totalRetries: retryInfo.retries.length,
|
|
@@ -91,13 +91,13 @@ async function listAvailableModels(token, enableRetry = true, maxRetries = 3) {
|
|
|
91
91
|
async function refreshModelsCache(githubToken, enableRetry = true, maxRetries = 3) {
|
|
92
92
|
const startTime = Date.now();
|
|
93
93
|
try {
|
|
94
|
-
console.log(
|
|
95
|
-
console.log(
|
|
94
|
+
console.log('🔄 Starting models cache refresh...');
|
|
95
|
+
console.log('🔑 Generating OAuth token...');
|
|
96
96
|
const oauthToken = await OAuthTokenManager_1.OAuthTokenManager.getValidOAuthToken(githubToken);
|
|
97
97
|
const cacheInfoBefore = DynamicModelsManager_1.DynamicModelsManager.getCacheInfo(oauthToken);
|
|
98
|
-
console.log(
|
|
98
|
+
console.log('🗑️ Clearing existing cache...');
|
|
99
99
|
DynamicModelsManager_1.DynamicModelsManager.clearCache(oauthToken);
|
|
100
|
-
console.log(
|
|
100
|
+
console.log('📥 Fetching fresh models from API...');
|
|
101
101
|
const models = await DynamicModelsManager_1.DynamicModelsManager.getAvailableModels(oauthToken);
|
|
102
102
|
const cacheInfoAfter = DynamicModelsManager_1.DynamicModelsManager.getCacheInfo(oauthToken);
|
|
103
103
|
const executionTime = Date.now() - startTime;
|
|
@@ -112,7 +112,7 @@ async function refreshModelsCache(githubToken, enableRetry = true, maxRetries =
|
|
|
112
112
|
};
|
|
113
113
|
models.forEach((model) => {
|
|
114
114
|
var _a;
|
|
115
|
-
const vendor = model.vendor ||
|
|
115
|
+
const vendor = model.vendor || 'Unknown';
|
|
116
116
|
modelsByVendor[vendor] = (modelsByVendor[vendor] || 0) + 1;
|
|
117
117
|
if ((_a = model.capabilities) === null || _a === void 0 ? void 0 : _a.supports) {
|
|
118
118
|
const supports = model.capabilities.supports;
|
|
@@ -132,34 +132,38 @@ async function refreshModelsCache(githubToken, enableRetry = true, maxRetries =
|
|
|
132
132
|
});
|
|
133
133
|
return {
|
|
134
134
|
success: true,
|
|
135
|
-
operation:
|
|
135
|
+
operation: 'refreshCache',
|
|
136
136
|
timestamp: new Date().toISOString(),
|
|
137
137
|
executionTime: `${executionTime}ms`,
|
|
138
|
-
message:
|
|
138
|
+
message: '✅ Models cache refreshed successfully',
|
|
139
139
|
summary: {
|
|
140
140
|
totalModels: models.length,
|
|
141
141
|
modelsByVendor,
|
|
142
142
|
capabilities: capabilitiesCount,
|
|
143
143
|
},
|
|
144
144
|
cache: {
|
|
145
|
-
before: cacheInfoBefore
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
145
|
+
before: cacheInfoBefore
|
|
146
|
+
? {
|
|
147
|
+
cached: true,
|
|
148
|
+
modelsCount: cacheInfoBefore.modelsCount,
|
|
149
|
+
expiresIn: `${Math.round(cacheInfoBefore.expiresIn / 1000)}s`,
|
|
150
|
+
fetchedAt: cacheInfoBefore.fetchedAt,
|
|
151
|
+
}
|
|
152
|
+
: {
|
|
153
|
+
cached: false,
|
|
154
|
+
message: 'No cache existed before refresh',
|
|
155
|
+
},
|
|
156
|
+
after: cacheInfoAfter
|
|
157
|
+
? {
|
|
158
|
+
cached: true,
|
|
159
|
+
modelsCount: cacheInfoAfter.modelsCount,
|
|
160
|
+
expiresIn: `${Math.round(cacheInfoAfter.expiresIn / 1000)}s`,
|
|
161
|
+
fetchedAt: cacheInfoAfter.fetchedAt,
|
|
162
|
+
}
|
|
163
|
+
: {
|
|
164
|
+
cached: false,
|
|
165
|
+
message: 'Cache refresh failed',
|
|
166
|
+
},
|
|
163
167
|
},
|
|
164
168
|
models: models.map((model) => {
|
|
165
169
|
var _a;
|
|
@@ -174,14 +178,14 @@ async function refreshModelsCache(githubToken, enableRetry = true, maxRetries =
|
|
|
174
178
|
}
|
|
175
179
|
catch (error) {
|
|
176
180
|
const executionTime = Date.now() - startTime;
|
|
177
|
-
const errorMessage = error instanceof Error ? error.message :
|
|
181
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
178
182
|
return {
|
|
179
183
|
success: false,
|
|
180
|
-
operation:
|
|
184
|
+
operation: 'refreshCache',
|
|
181
185
|
timestamp: new Date().toISOString(),
|
|
182
186
|
executionTime: `${executionTime}ms`,
|
|
183
187
|
error: errorMessage,
|
|
184
|
-
message:
|
|
188
|
+
message: '❌ Failed to refresh models cache',
|
|
185
189
|
details: error instanceof Error ? error.stack : String(error),
|
|
186
190
|
};
|
|
187
191
|
}
|
|
@@ -193,13 +197,13 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
193
197
|
let successfulTests = 0;
|
|
194
198
|
let failedTests = 0;
|
|
195
199
|
try {
|
|
196
|
-
console.log(
|
|
200
|
+
console.log('🧪 Starting Consolidated Model Test...');
|
|
197
201
|
const modelsResponse = await listAvailableModels(token, enableRetry, maxRetries);
|
|
198
202
|
if (!modelsResponse.success || !modelsResponse.data) {
|
|
199
203
|
return {
|
|
200
204
|
success: false,
|
|
201
205
|
timestamp: new Date().toISOString(),
|
|
202
|
-
error:
|
|
206
|
+
error: 'Failed to fetch models list for consolidated test',
|
|
203
207
|
details: modelsResponse,
|
|
204
208
|
};
|
|
205
209
|
}
|
|
@@ -207,8 +211,8 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
207
211
|
const availableModels = allModels.filter((modelItem) => {
|
|
208
212
|
var _a;
|
|
209
213
|
const model = modelItem;
|
|
210
|
-
const modelType = (
|
|
211
|
-
return modelType !==
|
|
214
|
+
const modelType = (_a = model.capabilities) === null || _a === void 0 ? void 0 : _a.type;
|
|
215
|
+
return modelType !== 'embeddings';
|
|
212
216
|
});
|
|
213
217
|
const testMessage = "Hello! Please respond with just 'OK' to confirm you're working.";
|
|
214
218
|
console.log(`📊 Testing ${availableModels.length} chat models, ${testsPerModel} times each...`);
|
|
@@ -219,7 +223,7 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
219
223
|
modelInfo: {
|
|
220
224
|
id: modelId,
|
|
221
225
|
name: model.name || modelId,
|
|
222
|
-
vendor: model.vendor ||
|
|
226
|
+
vendor: model.vendor || 'unknown',
|
|
223
227
|
capabilities: model.capabilities || {},
|
|
224
228
|
},
|
|
225
229
|
tests: [],
|
|
@@ -239,13 +243,13 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
239
243
|
modelResults.summary.totalAttempts++;
|
|
240
244
|
try {
|
|
241
245
|
const response = await fetch(GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getChatCompletionsUrl(), {
|
|
242
|
-
method:
|
|
246
|
+
method: 'POST',
|
|
243
247
|
headers: GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getAuthHeaders(token),
|
|
244
248
|
body: JSON.stringify({
|
|
245
249
|
model: modelId,
|
|
246
250
|
messages: [
|
|
247
251
|
{
|
|
248
|
-
role:
|
|
252
|
+
role: 'user',
|
|
249
253
|
content: testMessage,
|
|
250
254
|
},
|
|
251
255
|
],
|
|
@@ -267,9 +271,9 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
267
271
|
testNumber: testNum,
|
|
268
272
|
success: true,
|
|
269
273
|
responseTime: responseTime,
|
|
270
|
-
response: message.content ||
|
|
274
|
+
response: message.content || 'No content',
|
|
271
275
|
usage: usage || null,
|
|
272
|
-
finishReason: firstChoice.finish_reason ||
|
|
276
|
+
finishReason: firstChoice.finish_reason || 'unknown',
|
|
273
277
|
timestamp: new Date().toISOString(),
|
|
274
278
|
};
|
|
275
279
|
modelResults.tests.push(testResult);
|
|
@@ -300,7 +304,7 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
300
304
|
testNumber: testNum,
|
|
301
305
|
success: false,
|
|
302
306
|
responseTime: responseTime,
|
|
303
|
-
error: error instanceof Error ? error.message :
|
|
307
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
304
308
|
timestamp: new Date().toISOString(),
|
|
305
309
|
});
|
|
306
310
|
}
|
|
@@ -344,14 +348,14 @@ async function consolidatedModelTest(token, enableRetry = true, maxRetries = 3,
|
|
|
344
348
|
modelResults: testResults,
|
|
345
349
|
recommendations: generateTestRecommendations(testResults),
|
|
346
350
|
};
|
|
347
|
-
console.log(
|
|
351
|
+
console.log('✅ Consolidated test completed successfully!');
|
|
348
352
|
return consolidatedSummary;
|
|
349
353
|
}
|
|
350
354
|
catch (error) {
|
|
351
355
|
return {
|
|
352
356
|
success: false,
|
|
353
357
|
timestamp: new Date().toISOString(),
|
|
354
|
-
error: error instanceof Error ? error.message :
|
|
358
|
+
error: error instanceof Error ? error.message : 'Unknown error in consolidated test',
|
|
355
359
|
partialResults: testResults,
|
|
356
360
|
testDuration: Date.now() - testStartTime,
|
|
357
361
|
};
|
|
@@ -376,19 +380,19 @@ function generateTestRecommendations(testResults) {
|
|
|
376
380
|
.slice(0, 3);
|
|
377
381
|
if (bestModels.length > 0) {
|
|
378
382
|
recommendations.push({
|
|
379
|
-
type:
|
|
380
|
-
title:
|
|
383
|
+
type: 'best_performance',
|
|
384
|
+
title: 'Top Performing Models (100% success rate)',
|
|
381
385
|
models: bestModels,
|
|
382
|
-
description:
|
|
386
|
+
description: 'These models completed all tests successfully with fastest response times',
|
|
383
387
|
});
|
|
384
388
|
}
|
|
385
389
|
const problematicModels = modelStats.filter((m) => m.successRate < 80);
|
|
386
390
|
if (problematicModels.length > 0) {
|
|
387
391
|
recommendations.push({
|
|
388
|
-
type:
|
|
389
|
-
title:
|
|
392
|
+
type: 'attention_needed',
|
|
393
|
+
title: 'Models Requiring Attention (< 80% success rate)',
|
|
390
394
|
models: problematicModels,
|
|
391
|
-
description:
|
|
395
|
+
description: 'These models had reliability issues during testing',
|
|
392
396
|
});
|
|
393
397
|
}
|
|
394
398
|
const vendorStats = modelStats.reduce((acc, model) => {
|
|
@@ -408,10 +412,10 @@ function generateTestRecommendations(testResults) {
|
|
|
408
412
|
vendorData.avgResponseTime = Math.round(vendorData.avgResponseTime / vendorData.count);
|
|
409
413
|
});
|
|
410
414
|
recommendations.push({
|
|
411
|
-
type:
|
|
412
|
-
title:
|
|
415
|
+
type: 'vendor_analysis',
|
|
416
|
+
title: 'Performance by Vendor',
|
|
413
417
|
vendors: vendorStats,
|
|
414
|
-
description:
|
|
418
|
+
description: 'Comparative analysis of model performance by vendor',
|
|
415
419
|
});
|
|
416
420
|
return recommendations;
|
|
417
421
|
}
|
|
@@ -419,10 +423,10 @@ async function testEmbeddingModels(githubToken, enableRetry = true, maxRetries =
|
|
|
419
423
|
var _a, _b, _c, _d;
|
|
420
424
|
const testStartTime = Date.now();
|
|
421
425
|
try {
|
|
422
|
-
console.log(
|
|
426
|
+
console.log('🧪 Testing embedding models...');
|
|
423
427
|
const modelsUrl = `${GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.URLS.MODELS}`;
|
|
424
428
|
const modelsResponse = await fetch(modelsUrl, {
|
|
425
|
-
method:
|
|
429
|
+
method: 'GET',
|
|
426
430
|
headers: GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getAuthHeaders(githubToken),
|
|
427
431
|
});
|
|
428
432
|
if (!modelsResponse.ok) {
|
|
@@ -432,12 +436,12 @@ async function testEmbeddingModels(githubToken, enableRetry = true, maxRetries =
|
|
|
432
436
|
const embeddingModels = modelsData.data.filter((model) => {
|
|
433
437
|
var _a;
|
|
434
438
|
const modelType = (_a = model.capabilities) === null || _a === void 0 ? void 0 : _a.type;
|
|
435
|
-
return modelType ===
|
|
439
|
+
return modelType === 'embeddings';
|
|
436
440
|
});
|
|
437
441
|
console.log(`📊 Found ${embeddingModels.length} embedding models to test`);
|
|
438
442
|
const oauthToken = await OAuthTokenManager_1.OAuthTokenManager.getValidOAuthToken(githubToken);
|
|
439
443
|
const testResults = {};
|
|
440
|
-
const testText =
|
|
444
|
+
const testText = 'This is a test sentence for embeddings generation.';
|
|
441
445
|
for (const model of embeddingModels) {
|
|
442
446
|
console.log(`\n🔬 Testing model: ${model.name} (${model.id})`);
|
|
443
447
|
const modelResults = {
|
|
@@ -477,7 +481,7 @@ async function testEmbeddingModels(githubToken, enableRetry = true, maxRetries =
|
|
|
477
481
|
}
|
|
478
482
|
catch (error) {
|
|
479
483
|
const testDuration = Date.now() - testStart;
|
|
480
|
-
const errorMessage = error instanceof Error ? error.message :
|
|
484
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
481
485
|
modelResults.tests.push({
|
|
482
486
|
testNumber: testNum,
|
|
483
487
|
success: false,
|
|
@@ -532,7 +536,7 @@ async function testEmbeddingModels(githubToken, enableRetry = true, maxRetries =
|
|
|
532
536
|
return {
|
|
533
537
|
success: false,
|
|
534
538
|
timestamp: new Date().toISOString(),
|
|
535
|
-
error: error instanceof Error ? error.message :
|
|
539
|
+
error: error instanceof Error ? error.message : 'Unknown error in embedding models test',
|
|
536
540
|
testDuration: Date.now() - testStartTime,
|
|
537
541
|
};
|
|
538
542
|
}
|
|
@@ -540,64 +544,64 @@ async function testEmbeddingModels(githubToken, enableRetry = true, maxRetries =
|
|
|
540
544
|
class GitHubCopilotTest {
|
|
541
545
|
constructor() {
|
|
542
546
|
this.description = {
|
|
543
|
-
displayName:
|
|
544
|
-
name:
|
|
545
|
-
icon:
|
|
546
|
-
group: [
|
|
547
|
+
displayName: 'GitHub Copilot Test',
|
|
548
|
+
name: 'gitHubCopilotTest',
|
|
549
|
+
icon: 'file:../../shared/icons/copilot.svg',
|
|
550
|
+
group: ['transform'],
|
|
547
551
|
version: 1,
|
|
548
|
-
subtitle:
|
|
549
|
-
description:
|
|
552
|
+
subtitle: '={{$parameter["testFunction"]}}',
|
|
553
|
+
description: 'Test GitHub Copilot API credentials with predefined functions',
|
|
550
554
|
defaults: {
|
|
551
|
-
name:
|
|
555
|
+
name: 'GitHub Copilot Test',
|
|
552
556
|
},
|
|
553
|
-
inputs: [
|
|
554
|
-
outputs: [
|
|
557
|
+
inputs: ['main'],
|
|
558
|
+
outputs: ['main'],
|
|
555
559
|
credentials: [
|
|
556
560
|
{
|
|
557
|
-
name:
|
|
561
|
+
name: 'githubCopilotApi',
|
|
558
562
|
required: true,
|
|
559
563
|
},
|
|
560
564
|
],
|
|
561
565
|
properties: [
|
|
562
566
|
{
|
|
563
|
-
displayName:
|
|
564
|
-
name:
|
|
565
|
-
type:
|
|
567
|
+
displayName: 'Test Function',
|
|
568
|
+
name: 'testFunction',
|
|
569
|
+
type: 'options',
|
|
566
570
|
noDataExpression: true,
|
|
567
571
|
options: [
|
|
568
572
|
{
|
|
569
|
-
name:
|
|
570
|
-
value:
|
|
571
|
-
description:
|
|
573
|
+
name: 'List Available Models',
|
|
574
|
+
value: 'listModels',
|
|
575
|
+
description: 'Get all models available for your GitHub Copilot subscription',
|
|
572
576
|
},
|
|
573
577
|
{
|
|
574
|
-
name:
|
|
575
|
-
value:
|
|
576
|
-
description:
|
|
578
|
+
name: 'Refresh Models Cache',
|
|
579
|
+
value: 'refreshCache',
|
|
580
|
+
description: 'Force refresh the cached models list (clears cache and fetches fresh data from API)',
|
|
577
581
|
},
|
|
578
582
|
{
|
|
579
|
-
name:
|
|
580
|
-
value:
|
|
581
|
-
description:
|
|
583
|
+
name: 'Test Embedding Models',
|
|
584
|
+
value: 'testEmbeddings',
|
|
585
|
+
description: 'Test all embedding models (text-embedding-*) with sample text generation',
|
|
582
586
|
},
|
|
583
587
|
{
|
|
584
|
-
name:
|
|
585
|
-
value:
|
|
586
|
-
description:
|
|
588
|
+
name: 'Test Chat Models',
|
|
589
|
+
value: 'consolidatedTest',
|
|
590
|
+
description: 'Test all available chat models 5 times each and generate comprehensive report ⚠️ This test may take up to 2 minutes to complete',
|
|
587
591
|
},
|
|
588
592
|
],
|
|
589
|
-
default:
|
|
590
|
-
description:
|
|
593
|
+
default: 'listModels',
|
|
594
|
+
description: 'Select the test function to execute',
|
|
591
595
|
},
|
|
592
596
|
{
|
|
593
|
-
displayName:
|
|
594
|
-
name:
|
|
595
|
-
type:
|
|
597
|
+
displayName: 'Tests Per Model',
|
|
598
|
+
name: 'testsPerModel',
|
|
599
|
+
type: 'number',
|
|
596
600
|
default: 5,
|
|
597
|
-
description:
|
|
601
|
+
description: 'Number of times to test each model (affects accuracy of results)',
|
|
598
602
|
displayOptions: {
|
|
599
603
|
show: {
|
|
600
|
-
testFunction: [
|
|
604
|
+
testFunction: ['consolidatedTest'],
|
|
601
605
|
},
|
|
602
606
|
},
|
|
603
607
|
typeOptions: {
|
|
@@ -606,26 +610,26 @@ class GitHubCopilotTest {
|
|
|
606
610
|
},
|
|
607
611
|
},
|
|
608
612
|
{
|
|
609
|
-
displayName:
|
|
610
|
-
name:
|
|
611
|
-
type:
|
|
612
|
-
placeholder:
|
|
613
|
+
displayName: 'Advanced Options',
|
|
614
|
+
name: 'advancedOptions',
|
|
615
|
+
type: 'collection',
|
|
616
|
+
placeholder: 'Add Option',
|
|
613
617
|
default: {},
|
|
614
|
-
description:
|
|
618
|
+
description: 'Additional options for the test execution',
|
|
615
619
|
options: [
|
|
616
620
|
{
|
|
617
|
-
displayName:
|
|
618
|
-
name:
|
|
619
|
-
type:
|
|
621
|
+
displayName: 'Auto Retry on 403 Error',
|
|
622
|
+
name: 'enableRetry',
|
|
623
|
+
type: 'boolean',
|
|
620
624
|
default: true,
|
|
621
|
-
description:
|
|
625
|
+
description: 'Automatically retry requests when hitting TPM (Transactions Per Minute) quota limits (HTTP 403)',
|
|
622
626
|
},
|
|
623
627
|
{
|
|
624
|
-
displayName:
|
|
625
|
-
name:
|
|
626
|
-
type:
|
|
628
|
+
displayName: 'Max Retry Attempts',
|
|
629
|
+
name: 'maxRetries',
|
|
630
|
+
type: 'number',
|
|
627
631
|
default: 3,
|
|
628
|
-
description:
|
|
632
|
+
description: 'Maximum number of retry attempts for 403 errors',
|
|
629
633
|
displayOptions: {
|
|
630
634
|
show: {
|
|
631
635
|
enableRetry: [true],
|
|
@@ -642,14 +646,14 @@ class GitHubCopilotTest {
|
|
|
642
646
|
const returnData = [];
|
|
643
647
|
for (let i = 0; i < items.length; i++) {
|
|
644
648
|
try {
|
|
645
|
-
const testFunction = this.getNodeParameter(
|
|
646
|
-
const advancedOptions = this.getNodeParameter(
|
|
649
|
+
const testFunction = this.getNodeParameter('testFunction', i);
|
|
650
|
+
const advancedOptions = this.getNodeParameter('advancedOptions', i, {});
|
|
647
651
|
const enableRetry = advancedOptions.enableRetry !== false;
|
|
648
652
|
const maxRetries = advancedOptions.maxRetries || 3;
|
|
649
|
-
const testsPerModel = testFunction ===
|
|
650
|
-
? this.getNodeParameter(
|
|
653
|
+
const testsPerModel = testFunction === 'consolidatedTest'
|
|
654
|
+
? this.getNodeParameter('testsPerModel', i)
|
|
651
655
|
: 5;
|
|
652
|
-
const credentials = await this.getCredentials(
|
|
656
|
+
const credentials = await this.getCredentials('githubCopilotApi', i);
|
|
653
657
|
const token = credentials.token;
|
|
654
658
|
if (!token) {
|
|
655
659
|
throw new Error(GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ERRORS.CREDENTIALS_REQUIRED);
|
|
@@ -659,16 +663,16 @@ class GitHubCopilotTest {
|
|
|
659
663
|
}
|
|
660
664
|
let result = {};
|
|
661
665
|
switch (testFunction) {
|
|
662
|
-
case
|
|
666
|
+
case 'listModels':
|
|
663
667
|
result = await listAvailableModels(token, enableRetry, maxRetries);
|
|
664
668
|
break;
|
|
665
|
-
case
|
|
669
|
+
case 'refreshCache':
|
|
666
670
|
result = await refreshModelsCache(token, enableRetry, maxRetries);
|
|
667
671
|
break;
|
|
668
|
-
case
|
|
672
|
+
case 'testEmbeddings':
|
|
669
673
|
result = await testEmbeddingModels(token, enableRetry, maxRetries);
|
|
670
674
|
break;
|
|
671
|
-
case
|
|
675
|
+
case 'consolidatedTest':
|
|
672
676
|
result = await consolidatedModelTest(token, enableRetry, maxRetries, testsPerModel);
|
|
673
677
|
break;
|
|
674
678
|
default:
|
|
@@ -680,12 +684,12 @@ class GitHubCopilotTest {
|
|
|
680
684
|
});
|
|
681
685
|
}
|
|
682
686
|
catch (error) {
|
|
683
|
-
const errorMessage = error instanceof Error ? error.message :
|
|
687
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
684
688
|
if (this.continueOnFail()) {
|
|
685
689
|
returnData.push({
|
|
686
690
|
json: {
|
|
687
691
|
error: errorMessage,
|
|
688
|
-
testFunction: this.getNodeParameter(
|
|
692
|
+
testFunction: this.getNodeParameter('testFunction', i),
|
|
689
693
|
},
|
|
690
694
|
pairedItem: { item: i },
|
|
691
695
|
});
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.26",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows with full tools and function calling support - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.26",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows with full tools and function calling support - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|