n8n-nodes-github-copilot 3.38.24 → 3.38.26
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/GitHubCopilotApi.credentials.d.ts +1 -1
- package/dist/credentials/GitHubCopilotApi.credentials.js +25 -25
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +166 -166
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.js +539 -539
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +46 -44
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +82 -82
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +26 -26
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +12 -12
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +4 -4
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +19 -19
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +23 -23
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +163 -110
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.js +114 -114
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +74 -69
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.d.ts +1 -1
- package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +181 -181
- package/dist/nodes/GitHubCopilotOpenAI/utils/index.d.ts +2 -2
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.d.ts +10 -10
- package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.js +53 -53
- package/dist/nodes/GitHubCopilotOpenAI/utils/types.d.ts +12 -12
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.d.ts +1 -1
- package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.js +120 -116
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ async function processMediaFile(context, itemIndex, source, mediaFile, mediaUrl,
|
|
|
14
14
|
throw new Error(suggestImageConversion(imageResult.mimeType));
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
type:
|
|
17
|
+
type: 'image',
|
|
18
18
|
dataUrl: `data:${imageResult.mimeType};base64,${imageResult.data}`,
|
|
19
19
|
description: `Image file: ${imageResult.filename} (${Math.round(imageResult.size / 1024)}KB, ${imageResult.mimeType})`,
|
|
20
20
|
mimeType: imageResult.mimeType,
|
|
@@ -22,43 +22,43 @@ async function processMediaFile(context, itemIndex, source, mediaFile, mediaUrl,
|
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
24
|
return {
|
|
25
|
-
type:
|
|
26
|
-
description: `Error processing image file: ${error instanceof Error ? error.message :
|
|
27
|
-
mimeType:
|
|
25
|
+
type: 'unknown',
|
|
26
|
+
description: `Error processing image file: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
27
|
+
mimeType: 'unknown',
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function isImageMimeType(mimeType) {
|
|
32
|
-
const supportedFormats = [
|
|
32
|
+
const supportedFormats = ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/webp'];
|
|
33
33
|
return supportedFormats.includes(mimeType.toLowerCase());
|
|
34
34
|
}
|
|
35
35
|
function validateImageFormat(mimeType) {
|
|
36
36
|
if (!isImageMimeType(mimeType)) {
|
|
37
|
-
const supportedFormats = [
|
|
37
|
+
const supportedFormats = ['PNG', 'JPEG', 'GIF', 'WebP'];
|
|
38
38
|
return {
|
|
39
39
|
isValid: false,
|
|
40
|
-
error: `Unsupported image format: ${mimeType}. GitHub Copilot API only supports: ${supportedFormats.join(
|
|
40
|
+
error: `Unsupported image format: ${mimeType}. GitHub Copilot API only supports: ${supportedFormats.join(', ')}`,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
return { isValid: true };
|
|
44
44
|
}
|
|
45
45
|
function getFileExtensionFromMimeType(mimeType) {
|
|
46
46
|
const mimeToExt = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
'image/png': 'png',
|
|
48
|
+
'image/jpeg': 'jpg',
|
|
49
|
+
'image/jpg': 'jpg',
|
|
50
|
+
'image/gif': 'gif',
|
|
51
|
+
'image/webp': 'webp',
|
|
52
|
+
'image/bmp': 'bmp',
|
|
53
|
+
'image/tiff': 'tiff',
|
|
54
|
+
'image/svg+xml': 'svg',
|
|
55
55
|
};
|
|
56
|
-
return mimeToExt[mimeType.toLowerCase()] ||
|
|
56
|
+
return mimeToExt[mimeType.toLowerCase()] || 'unknown';
|
|
57
57
|
}
|
|
58
58
|
function suggestImageConversion(mimeType) {
|
|
59
59
|
const ext = getFileExtensionFromMimeType(mimeType);
|
|
60
|
-
const supportedFormats = [
|
|
60
|
+
const supportedFormats = ['PNG', 'JPEG', 'GIF', 'WebP'];
|
|
61
61
|
return (`Image format ${ext.toUpperCase()} is not supported by GitHub Copilot API. ` +
|
|
62
|
-
`Please convert your image to one of these formats: ${supportedFormats.join(
|
|
63
|
-
|
|
62
|
+
`Please convert your image to one of these formats: ${supportedFormats.join(', ')}. ` +
|
|
63
|
+
'Recommended: Convert to PNG or WebP for best compatibility.');
|
|
64
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelCapabilities, ModelValidationResult } from
|
|
1
|
+
import { ModelCapabilities, ModelValidationResult } from './types';
|
|
2
2
|
export declare const MODEL_CAPABILITIES: Record<string, ModelCapabilities>;
|
|
3
3
|
export declare function validateModelCapabilities(model: string, includeImage: boolean, includeAudio: boolean): ModelValidationResult;
|
|
4
4
|
export declare function getSupportedModels(requireImages?: boolean, requireAudio?: boolean): string[];
|
|
@@ -5,65 +5,65 @@ exports.validateModelCapabilities = validateModelCapabilities;
|
|
|
5
5
|
exports.getSupportedModels = getSupportedModels;
|
|
6
6
|
exports.getModelInfo = getModelInfo;
|
|
7
7
|
exports.MODEL_CAPABILITIES = {
|
|
8
|
-
|
|
8
|
+
'gpt-5': {
|
|
9
9
|
supportsImages: true,
|
|
10
10
|
supportsAudio: false,
|
|
11
11
|
maxContextTokens: 200000,
|
|
12
|
-
description:
|
|
12
|
+
description: 'OpenAI GPT-5 with image support via GitHub Copilot API',
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
'gpt-5-mini': {
|
|
15
15
|
supportsImages: true,
|
|
16
16
|
supportsAudio: false,
|
|
17
17
|
maxContextTokens: 128000,
|
|
18
|
-
description:
|
|
18
|
+
description: 'OpenAI GPT-5 Mini with image support via GitHub Copilot API',
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
'gpt-4.1-copilot': {
|
|
21
21
|
supportsImages: true,
|
|
22
22
|
supportsAudio: false,
|
|
23
23
|
maxContextTokens: 128000,
|
|
24
|
-
description:
|
|
24
|
+
description: 'OpenAI GPT-4.1 with image support via GitHub Copilot API',
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
'claude-opus-4.1': {
|
|
27
27
|
supportsImages: false,
|
|
28
28
|
supportsAudio: false,
|
|
29
29
|
maxContextTokens: 200000,
|
|
30
|
-
description:
|
|
30
|
+
description: 'Anthropic Claude Opus 4.1 - Text only via GitHub Copilot API',
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
'claude-3.5-sonnet': {
|
|
33
33
|
supportsImages: false,
|
|
34
34
|
supportsAudio: false,
|
|
35
35
|
maxContextTokens: 200000,
|
|
36
|
-
description:
|
|
36
|
+
description: 'Anthropic Claude 3.5 Sonnet - Text only via GitHub Copilot API',
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
'gemini-2.5-pro': {
|
|
39
39
|
supportsImages: true,
|
|
40
40
|
supportsAudio: false,
|
|
41
41
|
maxContextTokens: 1000000,
|
|
42
|
-
description:
|
|
42
|
+
description: 'Google Gemini 2.5 Pro with image support via GitHub Copilot API',
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
'gemini-2.0-flash': {
|
|
45
45
|
supportsImages: true,
|
|
46
46
|
supportsAudio: true,
|
|
47
47
|
maxContextTokens: 1000000,
|
|
48
|
-
description:
|
|
48
|
+
description: 'Google Gemini 2.0 Flash with multimodal support via GitHub Copilot API',
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
'grok-code-fast-1': {
|
|
51
51
|
supportsImages: false,
|
|
52
52
|
supportsAudio: false,
|
|
53
53
|
maxContextTokens: 128000,
|
|
54
|
-
description:
|
|
54
|
+
description: 'xAI Grok Code Fast 1 - Text only via GitHub Copilot API',
|
|
55
55
|
},
|
|
56
56
|
o3: {
|
|
57
57
|
supportsImages: false,
|
|
58
58
|
supportsAudio: false,
|
|
59
59
|
maxContextTokens: 200000,
|
|
60
|
-
description:
|
|
60
|
+
description: 'OpenAI o3 - Text only via GitHub Copilot API',
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
'o3-mini': {
|
|
63
63
|
supportsImages: false,
|
|
64
64
|
supportsAudio: false,
|
|
65
65
|
maxContextTokens: 128000,
|
|
66
|
-
description:
|
|
66
|
+
description: 'OpenAI o3-mini - Text only via GitHub Copilot API',
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
69
|
function validateModelCapabilities(model, includeImage, includeAudio) {
|
|
@@ -85,11 +85,11 @@ function validateModelCapabilities(model, includeImage, includeAudio) {
|
|
|
85
85
|
isValid = false;
|
|
86
86
|
errorMessage = `Model ${model} does not support audio input. Please disable audio upload or choose a different model (e.g., GPT-5, Gemini 2.5 Pro).`;
|
|
87
87
|
}
|
|
88
|
-
if (model.includes(
|
|
89
|
-
warnings.push(
|
|
88
|
+
if (model.includes('claude') && (includeImage || includeAudio)) {
|
|
89
|
+
warnings.push('Claude models typically work best with text-only input via GitHub Copilot API.');
|
|
90
90
|
}
|
|
91
|
-
if (model.includes(
|
|
92
|
-
warnings.push(
|
|
91
|
+
if (model.includes('grok') && (includeImage || includeAudio)) {
|
|
92
|
+
warnings.push('Grok models are optimized for coding tasks and work best with text input.');
|
|
93
93
|
}
|
|
94
94
|
return {
|
|
95
95
|
isValid,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IExecuteFunctions } from
|
|
2
|
-
import { CopilotResponse } from
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import { CopilotResponse } from '../../../shared/utils/GitHubCopilotApiUtils';
|
|
3
3
|
export { CopilotResponse };
|
|
4
4
|
export interface ChatMessage {
|
|
5
|
-
role:
|
|
5
|
+
role: 'system' | 'user' | 'assistant';
|
|
6
6
|
content: string | Array<ChatMessageContent>;
|
|
7
|
-
type?:
|
|
7
|
+
type?: 'file';
|
|
8
8
|
}
|
|
9
9
|
export interface ChatMessageContent {
|
|
10
10
|
type: string;
|
|
@@ -16,7 +16,7 @@ export interface ChatMessageContent {
|
|
|
16
16
|
export interface FileProcessOptions {
|
|
17
17
|
context: IExecuteFunctions;
|
|
18
18
|
itemIndex: number;
|
|
19
|
-
source:
|
|
19
|
+
source: 'manual' | 'url' | 'binary';
|
|
20
20
|
filePath?: string;
|
|
21
21
|
url?: string;
|
|
22
22
|
binaryProperty?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData, ILoadOptionsFunctions, INodePropertyOptions } from
|
|
1
|
+
import { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
2
|
export declare class GitHubCopilotChatModel implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
4
|
methods: {
|