n8n-nodes-github-copilot 3.31.11 → 3.31.13

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.
@@ -34,18 +34,30 @@ class GitHubCopilotOpenAI {
34
34
  const operation = this.getNodeParameter("operation", i);
35
35
  if (operation === "chat") {
36
36
  const model = this.getNodeParameter("model", i, "gpt-4o");
37
- const messagesParam = this.getNodeParameter("messages", i, {
38
- message: [],
39
- });
37
+ const messagesInputMode = this.getNodeParameter("messagesInputMode", i, "manual");
40
38
  const temperature = this.getNodeParameter("temperature", i, 1);
41
39
  const tools = this.getNodeParameter("tools", i, "");
42
- const messages = [];
43
- if (messagesParam.message && Array.isArray(messagesParam.message)) {
44
- for (const msg of messagesParam.message) {
45
- messages.push({
46
- role: msg.role,
47
- content: msg.content,
48
- });
40
+ let messages = [];
41
+ if (messagesInputMode === "json") {
42
+ const messagesJson = this.getNodeParameter("messagesJson", i, "[]");
43
+ try {
44
+ messages = JSON.parse(messagesJson);
45
+ }
46
+ catch (error) {
47
+ throw new Error(`Failed to parse messages JSON: ${error instanceof Error ? error.message : "Unknown error"}`);
48
+ }
49
+ }
50
+ else {
51
+ const messagesParam = this.getNodeParameter("messages", i, {
52
+ message: [],
53
+ });
54
+ if (messagesParam.message && Array.isArray(messagesParam.message)) {
55
+ for (const msg of messagesParam.message) {
56
+ messages.push({
57
+ role: msg.role,
58
+ content: msg.content,
59
+ });
60
+ }
49
61
  }
50
62
  }
51
63
  if (messages.length === 0) {
@@ -24,6 +24,47 @@ exports.nodeProperties = [
24
24
  placeholder: "gpt-4o",
25
25
  description: "The model to use for the completion. Supports all OpenAI model names that map to GitHub Copilot models.",
26
26
  },
27
+ {
28
+ displayName: "Messages Input Mode",
29
+ name: "messagesInputMode",
30
+ type: "options",
31
+ options: [
32
+ {
33
+ name: "Manual (UI)",
34
+ value: "manual",
35
+ description: "Enter messages one by one using the UI",
36
+ },
37
+ {
38
+ name: "JSON (Programmatic)",
39
+ value: "json",
40
+ description: "Provide messages as JSON array",
41
+ },
42
+ ],
43
+ default: "manual",
44
+ description: "How to provide the messages for the conversation",
45
+ },
46
+ {
47
+ displayName: "Messages (JSON)",
48
+ name: "messagesJson",
49
+ type: "json",
50
+ default: `[
51
+ {
52
+ "role": "system",
53
+ "content": "You are a helpful assistant."
54
+ },
55
+ {
56
+ "role": "user",
57
+ "content": "Hello!"
58
+ }
59
+ ]`,
60
+ placeholder: "Enter messages as JSON array",
61
+ description: "Array of messages in OpenAI format: [{\"role\": \"user\", \"content\": \"...\"}]",
62
+ displayOptions: {
63
+ show: {
64
+ messagesInputMode: ["json"],
65
+ },
66
+ },
67
+ },
27
68
  {
28
69
  displayName: "Messages",
29
70
  name: "messages",
@@ -40,6 +81,11 @@ exports.nodeProperties = [
40
81
  },
41
82
  ],
42
83
  },
84
+ displayOptions: {
85
+ show: {
86
+ messagesInputMode: ["manual"],
87
+ },
88
+ },
43
89
  options: [
44
90
  {
45
91
  name: "message",
@@ -85,10 +131,13 @@ exports.nodeProperties = [
85
131
  description: "Array of messages for the conversation",
86
132
  },
87
133
  {
88
- displayName: "Tools",
134
+ displayName: "Tools (Optional)",
89
135
  name: "tools",
90
- type: "json",
136
+ type: "string",
91
137
  default: "",
138
+ typeOptions: {
139
+ rows: 10,
140
+ },
92
141
  placeholder: `[
93
142
  {
94
143
  "type": "function",
@@ -108,8 +157,8 @@ exports.nodeProperties = [
108
157
  }
109
158
  }
110
159
  ]`,
111
- description: "Array of tools/functions available to the model (OpenAI format)",
112
- hint: "JSON array of tool definitions in OpenAI format",
160
+ description: "Optional: Array of tools/functions available to the model (OpenAI format). Leave empty if not using function calling.",
161
+ hint: "JSON array of tool definitions in OpenAI format. Leave this field empty if you don't need function calling.",
113
162
  },
114
163
  {
115
164
  displayName: "Tool Choice",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.31.11",
3
+ "version": "3.31.13",
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.11",
3
+ "version": "3.31.13",
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",