n8n-nodes-github-copilot 3.31.17 → 3.31.19
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.
|
@@ -124,7 +124,11 @@ class GitHubCopilotOpenAI {
|
|
|
124
124
|
model: model,
|
|
125
125
|
choices: response.choices.map((choice) => ({
|
|
126
126
|
index: choice.index,
|
|
127
|
-
message:
|
|
127
|
+
message: {
|
|
128
|
+
role: choice.message.role,
|
|
129
|
+
content: choice.message.content,
|
|
130
|
+
...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
|
|
131
|
+
},
|
|
128
132
|
finish_reason: choice.finish_reason,
|
|
129
133
|
})),
|
|
130
134
|
usage: response.usage || {
|
|
@@ -144,12 +148,36 @@ class GitHubCopilotOpenAI {
|
|
|
144
148
|
}
|
|
145
149
|
catch (error) {
|
|
146
150
|
if (this.continueOnFail()) {
|
|
151
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
152
|
+
let errorType = "invalid_request_error";
|
|
153
|
+
let errorCode = null;
|
|
154
|
+
if (errorMessage.includes("403") || errorMessage.includes("Forbidden")) {
|
|
155
|
+
errorType = "invalid_request_error";
|
|
156
|
+
errorCode = "insufficient_quota";
|
|
157
|
+
}
|
|
158
|
+
else if (errorMessage.includes("401") || errorMessage.includes("Unauthorized")) {
|
|
159
|
+
errorType = "invalid_request_error";
|
|
160
|
+
errorCode = "invalid_api_key";
|
|
161
|
+
}
|
|
162
|
+
else if (errorMessage.includes("400") || errorMessage.includes("Bad Request")) {
|
|
163
|
+
errorType = "invalid_request_error";
|
|
164
|
+
errorCode = "invalid_request";
|
|
165
|
+
}
|
|
166
|
+
else if (errorMessage.includes("429") || errorMessage.includes("rate limit")) {
|
|
167
|
+
errorType = "rate_limit_error";
|
|
168
|
+
errorCode = "rate_limit_exceeded";
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
errorType = "api_error";
|
|
172
|
+
errorCode = "internal_error";
|
|
173
|
+
}
|
|
147
174
|
returnData.push({
|
|
148
175
|
json: {
|
|
149
176
|
error: {
|
|
150
|
-
message:
|
|
151
|
-
type:
|
|
152
|
-
|
|
177
|
+
message: errorMessage,
|
|
178
|
+
type: errorType,
|
|
179
|
+
param: null,
|
|
180
|
+
code: errorCode,
|
|
153
181
|
},
|
|
154
182
|
},
|
|
155
183
|
pairedItem: { item: i },
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.19",
|
|
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",
|
|
@@ -9,6 +9,15 @@ export interface CopilotResponse {
|
|
|
9
9
|
message: {
|
|
10
10
|
role: string;
|
|
11
11
|
content: string;
|
|
12
|
+
tool_calls?: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
function: {
|
|
16
|
+
name: string;
|
|
17
|
+
arguments: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
[key: string]: unknown;
|
|
12
21
|
};
|
|
13
22
|
finish_reason: string;
|
|
14
23
|
}>;
|
|
@@ -42,7 +42,6 @@ async function makeGitHubCopilotRequest(context, endpoint, body, hasMedia = fals
|
|
|
42
42
|
const headers = {
|
|
43
43
|
...GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.HEADERS.WITH_AUTH(token),
|
|
44
44
|
"User-Agent": "GitHub-Copilot/1.0 (n8n-node)",
|
|
45
|
-
"X-GitHub-Api-Version": "2022-11-28",
|
|
46
45
|
"Editor-Version": "vscode/1.95.0",
|
|
47
46
|
"Editor-Plugin-Version": "copilot/1.0.0",
|
|
48
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.19",
|
|
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",
|