n8n-nodes-github-copilot 3.4.0 → 3.5.1
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.
- package/dist/credentials/GitHubApi.credentials.d.ts +8 -8
- package/dist/credentials/GitHubApi.credentials.js +50 -50
- package/dist/credentials/GitHubApiManual.credentials.d.ts +7 -7
- package/dist/credentials/GitHubApiManual.credentials.js +33 -33
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +324 -324
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +141 -146
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +172 -202
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +19 -21
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +130 -131
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +8 -8
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +100 -101
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.js +19 -19
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +14 -14
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +70 -71
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +113 -113
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +57 -57
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.js +2 -2
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +141 -211
- package/dist/shared/models/GitHubCopilotModels.d.ts +43 -0
- package/dist/shared/models/GitHubCopilotModels.js +218 -0
- package/package.json +5 -4
- package/dist/credentials/N8nApi.credentials.d.ts +0 -7
- package/dist/credentials/N8nApi.credentials.js +0 -31
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.d.ts +0 -5
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.js +0 -651
- package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.d.ts +0 -11
- package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.js +0 -86
- package/dist/nodes/N8nAiAgent/N8nAiAgent.node.d.ts +0 -5
- package/dist/nodes/N8nAiAgent/N8nAiAgent.node.js +0 -152
|
@@ -1,211 +1,141 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitHubCopilotChatModel = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
name: '
|
|
69
|
-
|
|
70
|
-
description: '
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
name: '
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
],
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
async supplyData(itemIndex) {
|
|
146
|
-
const model = this.getNodeParameter('model', itemIndex);
|
|
147
|
-
const options = this.getNodeParameter('options', itemIndex, {});
|
|
148
|
-
const copilotModel = {
|
|
149
|
-
_call: async (messages) => {
|
|
150
|
-
var _a;
|
|
151
|
-
const requestBody = {
|
|
152
|
-
intent: true,
|
|
153
|
-
model: model,
|
|
154
|
-
messages: messages,
|
|
155
|
-
n: 1,
|
|
156
|
-
stream: false,
|
|
157
|
-
temperature: options.temperature || 0.7,
|
|
158
|
-
max_tokens: options.maxTokens || 1000,
|
|
159
|
-
top_p: options.topP || 1,
|
|
160
|
-
};
|
|
161
|
-
if (options.systemMessage) {
|
|
162
|
-
const systemMessage = {
|
|
163
|
-
role: 'system',
|
|
164
|
-
content: options.systemMessage,
|
|
165
|
-
};
|
|
166
|
-
requestBody.messages = [systemMessage, ...messages];
|
|
167
|
-
}
|
|
168
|
-
try {
|
|
169
|
-
const credentials = await this.getCredentials('gitHubApiManual');
|
|
170
|
-
const response = await fetch('https://api.githubcopilot.com/chat/completions', {
|
|
171
|
-
method: 'POST',
|
|
172
|
-
headers: {
|
|
173
|
-
'Authorization': `Bearer ${credentials.accessToken}`,
|
|
174
|
-
'Content-Type': 'application/json',
|
|
175
|
-
'User-Agent': 'n8n-github-copilot-chat-model',
|
|
176
|
-
...(options.enableVision && {
|
|
177
|
-
'Copilot-Vision-Request': 'true',
|
|
178
|
-
'Copilot-Media-Request': 'true'
|
|
179
|
-
}),
|
|
180
|
-
},
|
|
181
|
-
body: JSON.stringify(requestBody),
|
|
182
|
-
});
|
|
183
|
-
if (!response.ok) {
|
|
184
|
-
throw new Error(`GitHub Copilot API error: ${response.status} ${response.statusText}`);
|
|
185
|
-
}
|
|
186
|
-
const result = await response.json();
|
|
187
|
-
if (result.choices && result.choices.length > 0) {
|
|
188
|
-
const choice = result.choices[0];
|
|
189
|
-
return ((_a = choice.message) === null || _a === void 0 ? void 0 : _a.content) || 'No response from GitHub Copilot';
|
|
190
|
-
}
|
|
191
|
-
return 'No response from GitHub Copilot';
|
|
192
|
-
}
|
|
193
|
-
catch (error) {
|
|
194
|
-
throw new Error(`GitHub Copilot API error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
_modelType: 'chat_model',
|
|
198
|
-
_llmType: 'github-copilot',
|
|
199
|
-
modelName: model,
|
|
200
|
-
temperature: options.temperature || 0.7,
|
|
201
|
-
maxTokens: options.maxTokens || 1000,
|
|
202
|
-
topP: options.topP || 1,
|
|
203
|
-
enableVision: options.enableVision || true,
|
|
204
|
-
systemMessage: options.systemMessage || '',
|
|
205
|
-
};
|
|
206
|
-
return {
|
|
207
|
-
response: copilotModel,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
exports.GitHubCopilotChatModel = GitHubCopilotChatModel;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitHubCopilotChatModel = void 0;
|
|
4
|
+
const openai_1 = require("@langchain/openai");
|
|
5
|
+
const GitHubCopilotModels_1 = require("../../shared/models/GitHubCopilotModels");
|
|
6
|
+
class GitHubCopilotChatModel {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'GitHub Copilot Chat Model',
|
|
10
|
+
name: 'gitHubCopilotChatModel',
|
|
11
|
+
icon: 'file:copilot.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'GitHub Copilot chat model for AI workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'GitHub Copilot Chat Model',
|
|
17
|
+
},
|
|
18
|
+
codex: {
|
|
19
|
+
categories: ['AI'],
|
|
20
|
+
subcategories: {
|
|
21
|
+
AI: ['Language Models', 'Root Nodes'],
|
|
22
|
+
'Language Models': ['Chat Models (Recommended)'],
|
|
23
|
+
},
|
|
24
|
+
resources: {
|
|
25
|
+
primaryDocumentation: [
|
|
26
|
+
{
|
|
27
|
+
url: 'https://docs.github.com/copilot/using-github-copilot/using-github-copilot-chat',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
inputs: [],
|
|
33
|
+
outputs: ["ai_languageModel"],
|
|
34
|
+
outputNames: ['Model'],
|
|
35
|
+
credentials: [
|
|
36
|
+
{
|
|
37
|
+
name: 'gitHubApiManual',
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
properties: [
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Model',
|
|
44
|
+
name: 'model',
|
|
45
|
+
type: 'options',
|
|
46
|
+
default: GitHubCopilotModels_1.DEFAULT_MODELS.GENERAL,
|
|
47
|
+
description: 'The GitHub Copilot model to use',
|
|
48
|
+
options: GitHubCopilotModels_1.GitHubCopilotModelsManager.toN8nOptions(),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Options',
|
|
52
|
+
name: 'options',
|
|
53
|
+
placeholder: 'Add Option',
|
|
54
|
+
description: 'Additional options for the GitHub Copilot model',
|
|
55
|
+
type: 'collection',
|
|
56
|
+
default: {},
|
|
57
|
+
options: [
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Temperature',
|
|
60
|
+
name: 'temperature',
|
|
61
|
+
default: 0.7,
|
|
62
|
+
typeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },
|
|
63
|
+
description: 'Controls randomness in output. Lower values make responses more focused.',
|
|
64
|
+
type: 'number',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Maximum Number of Tokens',
|
|
68
|
+
name: 'maxTokens',
|
|
69
|
+
default: 1000,
|
|
70
|
+
description: 'The maximum number of tokens to generate',
|
|
71
|
+
type: 'number',
|
|
72
|
+
typeOptions: {
|
|
73
|
+
maxValue: 32768,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Top P',
|
|
78
|
+
name: 'topP',
|
|
79
|
+
default: 1,
|
|
80
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 2 },
|
|
81
|
+
description: 'Controls diversity of output by nucleus sampling',
|
|
82
|
+
type: 'number',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Enable Vision',
|
|
86
|
+
name: 'enableVision',
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
default: true,
|
|
89
|
+
description: 'Whether to enable image processing capabilities',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
displayName: 'System Message',
|
|
93
|
+
name: 'systemMessage',
|
|
94
|
+
type: 'string',
|
|
95
|
+
default: '',
|
|
96
|
+
description: 'System message to set the behavior of the assistant',
|
|
97
|
+
typeOptions: {
|
|
98
|
+
rows: 3,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
async supplyData(itemIndex) {
|
|
107
|
+
const model = this.getNodeParameter('model', itemIndex);
|
|
108
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
109
|
+
const modelInfo = GitHubCopilotModels_1.GitHubCopilotModelsManager.getModelByValue(model);
|
|
110
|
+
const credentials = await this.getCredentials('gitHubApiManual');
|
|
111
|
+
const modelConfig = {
|
|
112
|
+
apiKey: credentials.accessToken,
|
|
113
|
+
model: model,
|
|
114
|
+
temperature: options.temperature || 0.7,
|
|
115
|
+
maxTokens: Math.min(options.maxTokens || 1000, (modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities.maxOutputTokens) || 4096),
|
|
116
|
+
topP: options.topP || 1,
|
|
117
|
+
configuration: {
|
|
118
|
+
baseURL: 'https://api.githubcopilot.com/v1',
|
|
119
|
+
defaultHeaders: {
|
|
120
|
+
'User-Agent': 'n8n-github-copilot-chat-model',
|
|
121
|
+
'Content-Type': 'application/json',
|
|
122
|
+
'Authorization': `Bearer ${credentials.accessToken}`,
|
|
123
|
+
...(options.enableVision && (modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities.vision) && {
|
|
124
|
+
'Copilot-Vision-Request': 'true',
|
|
125
|
+
'Copilot-Media-Request': 'true'
|
|
126
|
+
}),
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
...((modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities.toolsCalling) && {
|
|
130
|
+
modelKwargs: {
|
|
131
|
+
tool_choice: 'auto'
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
};
|
|
135
|
+
const chatModel = new openai_1.ChatOpenAI(modelConfig);
|
|
136
|
+
return {
|
|
137
|
+
response: chatModel,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.GitHubCopilotChatModel = GitHubCopilotChatModel;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ModelCapability {
|
|
2
|
+
toolsCalling: boolean;
|
|
3
|
+
vision: boolean;
|
|
4
|
+
multimodal: boolean;
|
|
5
|
+
maxContextTokens: number;
|
|
6
|
+
maxOutputTokens: number;
|
|
7
|
+
streaming: boolean;
|
|
8
|
+
provider: 'OpenAI' | 'Anthropic' | 'Google' | 'Microsoft';
|
|
9
|
+
category: 'chat' | 'reasoning' | 'coding' | 'vision' | 'multimodal';
|
|
10
|
+
}
|
|
11
|
+
export interface GitHubCopilotModel {
|
|
12
|
+
value: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
capabilities: ModelCapability;
|
|
16
|
+
recommended: boolean;
|
|
17
|
+
status: 'stable' | 'preview' | 'experimental';
|
|
18
|
+
}
|
|
19
|
+
export declare const GITHUB_COPILOT_MODELS: GitHubCopilotModel[];
|
|
20
|
+
export declare class GitHubCopilotModelsManager {
|
|
21
|
+
static getAllModels(): GitHubCopilotModel[];
|
|
22
|
+
static getToolsCapableModels(): GitHubCopilotModel[];
|
|
23
|
+
static getVisionCapableModels(): GitHubCopilotModel[];
|
|
24
|
+
static getModelsByProvider(provider: 'OpenAI' | 'Anthropic' | 'Google' | 'Microsoft'): GitHubCopilotModel[];
|
|
25
|
+
static getModelsByCategory(category: 'chat' | 'reasoning' | 'coding' | 'vision' | 'multimodal'): GitHubCopilotModel[];
|
|
26
|
+
static getRecommendedModels(): GitHubCopilotModel[];
|
|
27
|
+
static getStableModels(): GitHubCopilotModel[];
|
|
28
|
+
static getModelByValue(value: string): GitHubCopilotModel | undefined;
|
|
29
|
+
static toN8nOptions(models?: GitHubCopilotModel[]): Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}>;
|
|
34
|
+
static getModelsForUseCase(useCase: 'general' | 'coding' | 'vision' | 'reasoning' | 'tools'): GitHubCopilotModel[];
|
|
35
|
+
}
|
|
36
|
+
export declare const DEFAULT_MODELS: {
|
|
37
|
+
readonly GENERAL: "gpt-4o-mini";
|
|
38
|
+
readonly CODING: "o1-mini";
|
|
39
|
+
readonly VISION: "gpt-4o";
|
|
40
|
+
readonly REASONING: "o1-preview";
|
|
41
|
+
readonly TOOLS: "gpt-4o-mini";
|
|
42
|
+
readonly MULTIMODAL: "gemini-1.5-pro-002";
|
|
43
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MODELS = exports.GitHubCopilotModelsManager = exports.GITHUB_COPILOT_MODELS = void 0;
|
|
4
|
+
exports.GITHUB_COPILOT_MODELS = [
|
|
5
|
+
{
|
|
6
|
+
value: 'gpt-4o',
|
|
7
|
+
name: 'GPT-4o',
|
|
8
|
+
description: 'Most capable GPT-4 model with vision, optimized for chat and complex reasoning',
|
|
9
|
+
capabilities: {
|
|
10
|
+
toolsCalling: true,
|
|
11
|
+
vision: true,
|
|
12
|
+
multimodal: true,
|
|
13
|
+
maxContextTokens: 128000,
|
|
14
|
+
maxOutputTokens: 4096,
|
|
15
|
+
streaming: true,
|
|
16
|
+
provider: 'OpenAI',
|
|
17
|
+
category: 'multimodal'
|
|
18
|
+
},
|
|
19
|
+
recommended: true,
|
|
20
|
+
status: 'stable'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: 'gpt-4o-mini',
|
|
24
|
+
name: 'GPT-4o Mini',
|
|
25
|
+
description: 'Faster and more cost-effective GPT-4o with excellent performance',
|
|
26
|
+
capabilities: {
|
|
27
|
+
toolsCalling: true,
|
|
28
|
+
vision: true,
|
|
29
|
+
multimodal: true,
|
|
30
|
+
maxContextTokens: 128000,
|
|
31
|
+
maxOutputTokens: 16384,
|
|
32
|
+
streaming: true,
|
|
33
|
+
provider: 'OpenAI',
|
|
34
|
+
category: 'chat'
|
|
35
|
+
},
|
|
36
|
+
recommended: true,
|
|
37
|
+
status: 'stable'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'gpt-5',
|
|
41
|
+
name: 'GPT-5',
|
|
42
|
+
description: 'Latest generation GPT model with enhanced reasoning and capabilities',
|
|
43
|
+
capabilities: {
|
|
44
|
+
toolsCalling: true,
|
|
45
|
+
vision: true,
|
|
46
|
+
multimodal: true,
|
|
47
|
+
maxContextTokens: 200000,
|
|
48
|
+
maxOutputTokens: 8192,
|
|
49
|
+
streaming: true,
|
|
50
|
+
provider: 'OpenAI',
|
|
51
|
+
category: 'reasoning'
|
|
52
|
+
},
|
|
53
|
+
recommended: true,
|
|
54
|
+
status: 'preview'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: 'o1-preview',
|
|
58
|
+
name: 'o1 Preview',
|
|
59
|
+
description: 'Advanced reasoning model optimized for complex problem-solving',
|
|
60
|
+
capabilities: {
|
|
61
|
+
toolsCalling: false,
|
|
62
|
+
vision: false,
|
|
63
|
+
multimodal: false,
|
|
64
|
+
maxContextTokens: 128000,
|
|
65
|
+
maxOutputTokens: 32768,
|
|
66
|
+
streaming: false,
|
|
67
|
+
provider: 'OpenAI',
|
|
68
|
+
category: 'reasoning'
|
|
69
|
+
},
|
|
70
|
+
recommended: false,
|
|
71
|
+
status: 'preview'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
value: 'o1-mini',
|
|
75
|
+
name: 'o1 Mini',
|
|
76
|
+
description: 'Faster reasoning model optimized for coding and STEM tasks',
|
|
77
|
+
capabilities: {
|
|
78
|
+
toolsCalling: false,
|
|
79
|
+
vision: false,
|
|
80
|
+
multimodal: false,
|
|
81
|
+
maxContextTokens: 128000,
|
|
82
|
+
maxOutputTokens: 65536,
|
|
83
|
+
streaming: false,
|
|
84
|
+
provider: 'OpenAI',
|
|
85
|
+
category: 'coding'
|
|
86
|
+
},
|
|
87
|
+
recommended: true,
|
|
88
|
+
status: 'preview'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: 'claude-3.5-sonnet',
|
|
92
|
+
name: 'Claude 3.5 Sonnet',
|
|
93
|
+
description: 'Anthropic\'s most capable model with excellent reasoning and creativity',
|
|
94
|
+
capabilities: {
|
|
95
|
+
toolsCalling: true,
|
|
96
|
+
vision: true,
|
|
97
|
+
multimodal: true,
|
|
98
|
+
maxContextTokens: 200000,
|
|
99
|
+
maxOutputTokens: 8192,
|
|
100
|
+
streaming: true,
|
|
101
|
+
provider: 'Anthropic',
|
|
102
|
+
category: 'chat'
|
|
103
|
+
},
|
|
104
|
+
recommended: true,
|
|
105
|
+
status: 'stable'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: 'claude-3.5-haiku',
|
|
109
|
+
name: 'Claude 3.5 Haiku',
|
|
110
|
+
description: 'Fast and efficient Claude model for quick tasks',
|
|
111
|
+
capabilities: {
|
|
112
|
+
toolsCalling: true,
|
|
113
|
+
vision: true,
|
|
114
|
+
multimodal: true,
|
|
115
|
+
maxContextTokens: 200000,
|
|
116
|
+
maxOutputTokens: 8192,
|
|
117
|
+
streaming: true,
|
|
118
|
+
provider: 'Anthropic',
|
|
119
|
+
category: 'chat'
|
|
120
|
+
},
|
|
121
|
+
recommended: true,
|
|
122
|
+
status: 'stable'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
value: 'gemini-1.5-pro-002',
|
|
126
|
+
name: 'Gemini 1.5 Pro',
|
|
127
|
+
description: 'Google\'s most advanced model with large context and multimodal capabilities',
|
|
128
|
+
capabilities: {
|
|
129
|
+
toolsCalling: true,
|
|
130
|
+
vision: true,
|
|
131
|
+
multimodal: true,
|
|
132
|
+
maxContextTokens: 2000000,
|
|
133
|
+
maxOutputTokens: 8192,
|
|
134
|
+
streaming: true,
|
|
135
|
+
provider: 'Google',
|
|
136
|
+
category: 'multimodal'
|
|
137
|
+
},
|
|
138
|
+
recommended: true,
|
|
139
|
+
status: 'stable'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
value: 'gemini-1.5-flash-002',
|
|
143
|
+
name: 'Gemini 1.5 Flash',
|
|
144
|
+
description: 'Fast and efficient Gemini model for quick responses',
|
|
145
|
+
capabilities: {
|
|
146
|
+
toolsCalling: true,
|
|
147
|
+
vision: true,
|
|
148
|
+
multimodal: true,
|
|
149
|
+
maxContextTokens: 1000000,
|
|
150
|
+
maxOutputTokens: 8192,
|
|
151
|
+
streaming: true,
|
|
152
|
+
provider: 'Google',
|
|
153
|
+
category: 'chat'
|
|
154
|
+
},
|
|
155
|
+
recommended: true,
|
|
156
|
+
status: 'stable'
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
class GitHubCopilotModelsManager {
|
|
160
|
+
static getAllModels() {
|
|
161
|
+
return exports.GITHUB_COPILOT_MODELS;
|
|
162
|
+
}
|
|
163
|
+
static getToolsCapableModels() {
|
|
164
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.toolsCalling);
|
|
165
|
+
}
|
|
166
|
+
static getVisionCapableModels() {
|
|
167
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.vision);
|
|
168
|
+
}
|
|
169
|
+
static getModelsByProvider(provider) {
|
|
170
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.provider === provider);
|
|
171
|
+
}
|
|
172
|
+
static getModelsByCategory(category) {
|
|
173
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.category === category);
|
|
174
|
+
}
|
|
175
|
+
static getRecommendedModels() {
|
|
176
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.recommended);
|
|
177
|
+
}
|
|
178
|
+
static getStableModels() {
|
|
179
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.status === 'stable');
|
|
180
|
+
}
|
|
181
|
+
static getModelByValue(value) {
|
|
182
|
+
return exports.GITHUB_COPILOT_MODELS.find(model => model.value === value);
|
|
183
|
+
}
|
|
184
|
+
static toN8nOptions(models) {
|
|
185
|
+
const modelsToUse = models || exports.GITHUB_COPILOT_MODELS;
|
|
186
|
+
return modelsToUse.map(model => ({
|
|
187
|
+
name: model.name,
|
|
188
|
+
value: model.value,
|
|
189
|
+
description: model.description
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
static getModelsForUseCase(useCase) {
|
|
193
|
+
switch (useCase) {
|
|
194
|
+
case 'general':
|
|
195
|
+
return this.getRecommendedModels();
|
|
196
|
+
case 'coding':
|
|
197
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.category === 'coding' ||
|
|
198
|
+
model.capabilities.toolsCalling);
|
|
199
|
+
case 'vision':
|
|
200
|
+
return this.getVisionCapableModels();
|
|
201
|
+
case 'reasoning':
|
|
202
|
+
return exports.GITHUB_COPILOT_MODELS.filter(model => model.capabilities.category === 'reasoning');
|
|
203
|
+
case 'tools':
|
|
204
|
+
return this.getToolsCapableModels();
|
|
205
|
+
default:
|
|
206
|
+
return this.getAllModels();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.GitHubCopilotModelsManager = GitHubCopilotModelsManager;
|
|
211
|
+
exports.DEFAULT_MODELS = {
|
|
212
|
+
GENERAL: 'gpt-4o-mini',
|
|
213
|
+
CODING: 'o1-mini',
|
|
214
|
+
VISION: 'gpt-4o',
|
|
215
|
+
REASONING: 'o1-preview',
|
|
216
|
+
TOOLS: 'gpt-4o-mini',
|
|
217
|
+
MULTIMODAL: 'gemini-1.5-pro-002'
|
|
218
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
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",
|
|
@@ -57,15 +57,16 @@
|
|
|
57
57
|
},
|
|
58
58
|
"packageManager": "pnpm@7.1.0",
|
|
59
59
|
"dependencies": {
|
|
60
|
+
"@langchain/openai": "^0.6.12",
|
|
60
61
|
"n8n-workflow": "*"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@types/node": "^18.16.16",
|
|
64
|
-
"@typescript-eslint/parser": "^5.45.0",
|
|
65
65
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
66
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
66
67
|
"eslint": "^8.28.0",
|
|
67
68
|
"gulp": "^4.0.2",
|
|
68
69
|
"prettier": "^2.7.1",
|
|
69
|
-
"typescript": "
|
|
70
|
+
"typescript": "^5.9.2"
|
|
70
71
|
}
|
|
71
|
-
}
|
|
72
|
+
}
|