n8n-nodes-github-copilot 3.31.19 → 3.31.21
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.
|
@@ -117,6 +117,16 @@ class GitHubCopilotOpenAI {
|
|
|
117
117
|
requestBody.seed = seed;
|
|
118
118
|
}
|
|
119
119
|
const response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, false);
|
|
120
|
+
const cleanJsonContent = (content) => {
|
|
121
|
+
if (!content)
|
|
122
|
+
return content;
|
|
123
|
+
const jsonBlockRegex = /^```(?:json)?\s*\n([\s\S]*?)\n```$/;
|
|
124
|
+
const match = content.match(jsonBlockRegex);
|
|
125
|
+
if (match) {
|
|
126
|
+
return match[1].trim();
|
|
127
|
+
}
|
|
128
|
+
return content;
|
|
129
|
+
};
|
|
120
130
|
const openAIResponse = {
|
|
121
131
|
id: response.id || `chatcmpl-${Date.now()}`,
|
|
122
132
|
object: response.object || "chat.completion",
|
|
@@ -126,7 +136,11 @@ class GitHubCopilotOpenAI {
|
|
|
126
136
|
index: choice.index,
|
|
127
137
|
message: {
|
|
128
138
|
role: choice.message.role,
|
|
129
|
-
content
|
|
139
|
+
...(choice.message.content !== null && choice.message.content !== undefined && {
|
|
140
|
+
content: (response_format === null || response_format === void 0 ? void 0 : response_format.type) === 'json_object'
|
|
141
|
+
? cleanJsonContent(choice.message.content)
|
|
142
|
+
: choice.message.content
|
|
143
|
+
}),
|
|
130
144
|
...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
|
|
131
145
|
},
|
|
132
146
|
finish_reason: choice.finish_reason,
|
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.21",
|
|
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.31.
|
|
3
|
+
"version": "3.31.21",
|
|
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",
|