n8n-nodes-github-copilot 3.38.8 → 3.38.10

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,5 +1,10 @@
1
- import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData } from "n8n-workflow";
1
+ import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData, ILoadOptionsFunctions, INodePropertyOptions } from "n8n-workflow";
2
2
  export declare class GitHubCopilotChatModel implements INodeType {
3
3
  description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getAvailableModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
4
9
  supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
5
10
  }
@@ -4,6 +4,7 @@ exports.GitHubCopilotChatModel = void 0;
4
4
  const openai_1 = require("@langchain/openai");
5
5
  const GitHubCopilotModels_1 = require("../../shared/models/GitHubCopilotModels");
6
6
  const GitHubCopilotEndpoints_1 = require("../../shared/utils/GitHubCopilotEndpoints");
7
+ const DynamicModelLoader_1 = require("../../shared/models/DynamicModelLoader");
7
8
  class GitHubCopilotChatModel {
8
9
  constructor() {
9
10
  this.description = {
@@ -44,9 +45,11 @@ class GitHubCopilotChatModel {
44
45
  displayName: "Model",
45
46
  name: "model",
46
47
  type: "options",
48
+ typeOptions: {
49
+ loadOptionsMethod: "getAvailableModels",
50
+ },
47
51
  default: GitHubCopilotModels_1.DEFAULT_MODELS.GENERAL,
48
- description: "The GitHub Copilot model to use",
49
- options: GitHubCopilotModels_1.GitHubCopilotModelsManager.toN8nOptions(),
52
+ description: "Select the GitHub Copilot model to use (loaded dynamically based on your subscription)",
50
53
  },
51
54
  {
52
55
  displayName: "Options",
@@ -122,6 +125,13 @@ class GitHubCopilotChatModel {
122
125
  },
123
126
  ],
124
127
  };
128
+ this.methods = {
129
+ loadOptions: {
130
+ async getAvailableModels() {
131
+ return await DynamicModelLoader_1.loadAvailableModels.call(this);
132
+ },
133
+ },
134
+ };
125
135
  }
126
136
  async supplyData(itemIndex) {
127
137
  const model = this.getNodeParameter("model", itemIndex);
@@ -195,13 +195,6 @@ class GitHubCopilotEmbeddings {
195
195
  default: "float",
196
196
  description: "The format to return the embeddings in",
197
197
  },
198
- {
199
- displayName: "Return Full Response",
200
- name: "returnFullResponse",
201
- type: "boolean",
202
- default: false,
203
- description: "Whether to return the full API response including usage statistics",
204
- },
205
198
  {
206
199
  displayName: "Enable Retry",
207
200
  name: "enableRetry",
@@ -309,42 +302,20 @@ class GitHubCopilotEmbeddings {
309
302
  requestBody.encoding_format = options.encoding_format;
310
303
  }
311
304
  const result = await (0, EmbeddingsApiUtils_1.executeEmbeddingsRequest)(oauthToken, requestBody, enableRetry, maxRetries);
312
- const returnFullResponse = options.returnFullResponse === true;
313
- if (returnFullResponse) {
314
- returnData.push({
315
- json: result,
316
- pairedItem: { item: i },
317
- });
318
- }
319
- else {
320
- if (inputMode === "batch") {
321
- const embeddings = result.data.map((item) => ({
322
- index: item.index,
323
- embedding: item.embedding,
324
- dimensions: item.embedding.length,
325
- }));
326
- returnData.push({
327
- json: {
328
- model: result.model,
329
- embeddings,
330
- usage: result.usage,
331
- },
332
- pairedItem: { item: i },
333
- });
334
- }
335
- else {
336
- const embeddingData = result.data[0];
337
- returnData.push({
338
- json: {
339
- embedding: embeddingData.embedding,
340
- dimensions: embeddingData.embedding.length,
341
- model: result.model,
342
- usage: result.usage,
343
- },
344
- pairedItem: { item: i },
345
- });
346
- }
347
- }
305
+ const openAIResponse = {
306
+ object: "list",
307
+ data: result.data.map((item) => ({
308
+ object: "embedding",
309
+ index: item.index,
310
+ embedding: item.embedding,
311
+ })),
312
+ model: result.model,
313
+ usage: result.usage,
314
+ };
315
+ returnData.push({
316
+ json: openAIResponse,
317
+ pairedItem: { item: i },
318
+ });
348
319
  }
349
320
  catch (error) {
350
321
  if (this.continueOnFail()) {
@@ -106,10 +106,14 @@ class GitHubCopilotOpenAI {
106
106
  console.log('📥 Manual mode - messagesParam:', JSON.stringify(messagesParam, null, 2));
107
107
  if (messagesParam.message && Array.isArray(messagesParam.message)) {
108
108
  for (const msg of messagesParam.message) {
109
- messages.push({
109
+ const message = {
110
110
  role: msg.role,
111
111
  content: msg.content,
112
- });
112
+ };
113
+ if (msg.type && msg.type !== 'text') {
114
+ message.type = msg.type;
115
+ }
116
+ messages.push(message);
113
117
  }
114
118
  }
115
119
  console.log('📥 Manual mode - parsed messages:', JSON.stringify(messages, null, 2));
@@ -226,23 +230,6 @@ class GitHubCopilotOpenAI {
226
230
  }
227
231
  if (response_format) {
228
232
  requestBody.response_format = response_format;
229
- if (response_format.type === 'json_object') {
230
- const allMessagesText = messages.map(m => m.content).join(' ').toLowerCase();
231
- if (!allMessagesText.includes('json')) {
232
- const systemMessageIndex = messages.findIndex(m => m.role === 'system');
233
- if (systemMessageIndex !== -1) {
234
- messages[systemMessageIndex].content += '\n\nResponse format: json';
235
- console.log('ℹ️ Auto-injected "json" keyword into existing system message for json_object format');
236
- }
237
- else {
238
- messages.unshift({
239
- role: 'system',
240
- content: 'Response format: json'
241
- });
242
- console.log('ℹ️ Auto-injected system message with "json" keyword for json_object format');
243
- }
244
- }
245
- }
246
233
  }
247
234
  if (seed > 0) {
248
235
  requestBody.seed = seed;
@@ -181,6 +181,25 @@ exports.nodeProperties = [
181
181
  placeholder: "Enter message content...",
182
182
  description: "The content of the message",
183
183
  },
184
+ {
185
+ displayName: "Type",
186
+ name: "type",
187
+ type: "options",
188
+ options: [
189
+ {
190
+ name: "Text",
191
+ value: "text",
192
+ description: "Regular text message",
193
+ },
194
+ {
195
+ name: "File",
196
+ value: "file",
197
+ description: "File attachment (use content as data URL or base64)",
198
+ },
199
+ ],
200
+ default: "text",
201
+ description: "The type of message content (optional)",
202
+ },
184
203
  ],
185
204
  },
186
205
  ],
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.38.8",
3
+ "version": "3.38.10",
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.38.8",
3
+ "version": "3.38.10",
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",