n8n-nodes-github-copilot 3.32.2 → 3.32.3
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.
|
@@ -31,7 +31,7 @@ class GitHubCopilotChatAPI {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
async execute() {
|
|
34
|
-
var _a, _b, _c, _d
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
35
|
const items = this.getInputData();
|
|
36
36
|
const returnData = [];
|
|
37
37
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -114,14 +114,13 @@ class GitHubCopilotChatAPI {
|
|
|
114
114
|
while (attempt <= totalAttempts) {
|
|
115
115
|
try {
|
|
116
116
|
response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, hasMedia);
|
|
117
|
-
retriesUsed =
|
|
118
|
-
attempt = ((_b = response._retryMetadata) === null || _b === void 0 ? void 0 : _b.attempts) || 1;
|
|
117
|
+
retriesUsed = attempt - 1;
|
|
119
118
|
break;
|
|
120
119
|
}
|
|
121
120
|
catch (error) {
|
|
122
121
|
const isLastAttempt = attempt >= totalAttempts;
|
|
123
122
|
const errorObj = error;
|
|
124
|
-
const is403Error = errorObj.status === 403 || ((
|
|
123
|
+
const is403Error = errorObj.status === 403 || ((_a = errorObj.message) === null || _a === void 0 ? void 0 : _a.includes("403"));
|
|
125
124
|
if (is403Error && enableRetry && !isLastAttempt) {
|
|
126
125
|
const delay = Math.min(1000 * Math.pow(2, attempt - 1), 30000);
|
|
127
126
|
console.log(`GitHub Copilot API attempt ${attempt}/${totalAttempts} failed with 403, retrying in ${delay}ms...`);
|
|
@@ -137,13 +136,12 @@ class GitHubCopilotChatAPI {
|
|
|
137
136
|
throw new Error(`Failed to get response from GitHub Copilot API after ${totalAttempts} attempts (${retriesUsed} retries)`);
|
|
138
137
|
}
|
|
139
138
|
const result = {
|
|
140
|
-
message: ((
|
|
139
|
+
message: ((_c = (_b = response.choices[0]) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.content) || "",
|
|
141
140
|
model,
|
|
142
141
|
operation,
|
|
143
142
|
usage: response.usage || null,
|
|
144
|
-
finish_reason: ((
|
|
143
|
+
finish_reason: ((_d = response.choices[0]) === null || _d === void 0 ? void 0 : _d.finish_reason) || "unknown",
|
|
145
144
|
retries: retriesUsed,
|
|
146
|
-
attempts: attempt,
|
|
147
145
|
};
|
|
148
146
|
returnData.push({
|
|
149
147
|
json: result,
|
|
@@ -30,7 +30,7 @@ class GitHubCopilotOpenAI {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
async execute() {
|
|
33
|
-
var _a
|
|
33
|
+
var _a;
|
|
34
34
|
const items = this.getInputData();
|
|
35
35
|
const returnData = [];
|
|
36
36
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -165,9 +165,8 @@ class GitHubCopilotOpenAI {
|
|
|
165
165
|
}
|
|
166
166
|
const response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, false);
|
|
167
167
|
const retriesUsed = ((_a = response._retryMetadata) === null || _a === void 0 ? void 0 : _a.retries) || 0;
|
|
168
|
-
const attemptsUsed = ((_b = response._retryMetadata) === null || _b === void 0 ? void 0 : _b.attempts) || 1;
|
|
169
168
|
if (retriesUsed > 0) {
|
|
170
|
-
console.log(`ℹ️ Request completed
|
|
169
|
+
console.log(`ℹ️ Request completed with ${retriesUsed} retry(ies)`);
|
|
171
170
|
}
|
|
172
171
|
const cleanJsonFromMarkdown = (content) => {
|
|
173
172
|
if (!content || typeof content !== 'string') {
|
|
@@ -238,7 +237,6 @@ class GitHubCopilotOpenAI {
|
|
|
238
237
|
},
|
|
239
238
|
...(retriesUsed > 0 && {
|
|
240
239
|
_retry_info: {
|
|
241
|
-
attempts: attemptsUsed,
|
|
242
240
|
retries: retriesUsed,
|
|
243
241
|
}
|
|
244
242
|
}),
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.32.
|
|
3
|
+
"version": "3.32.3",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - 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.32.
|
|
3
|
+
"version": "3.32.3",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - 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",
|