@n8n/n8n-nodes-langchain 0.12.2 → 0.14.0
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/build.tsbuildinfo +1 -1
- package/dist/credentials/AzureOpenAiApi.credentials.d.ts +8 -0
- package/dist/credentials/AzureOpenAiApi.credentials.js +44 -0
- package/dist/credentials/AzureOpenAiApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +8 -0
- package/dist/known/nodes.json +12 -0
- package/dist/methods/defined.json +5 -1
- package/dist/methods/referenced.json +5 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +3 -3
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +2 -2
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.d.ts +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.d.ts +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.d.ts +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js.map +1 -1
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +1 -0
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +2 -2
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
- package/dist/nodes/code/Code.node.js +2 -4
- package/dist/nodes/code/Code.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +106 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.d.ts +5 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +141 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/azure.svg +1 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +14 -7
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +26 -9
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/OpenAi.node.d.ts +10 -0
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js +20 -0
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js +211 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js +30 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/index.d.ts +8 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/index.js +88 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js +68 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js +149 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js +148 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js +168 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/index.d.ts +6 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/index.js +82 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js +87 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js +77 -0
- package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/descriptions.d.ts +3 -0
- package/dist/nodes/vendors/OpenAi/actions/descriptions.js +53 -0
- package/dist/nodes/vendors/OpenAi/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js +59 -0
- package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/file/index.d.ts +6 -0
- package/dist/nodes/vendors/OpenAi/actions/file/index.js +70 -0
- package/dist/nodes/vendors/OpenAi/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/file/list.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js +58 -0
- package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js +91 -0
- package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js +194 -0
- package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js +227 -0
- package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/image/index.d.ts +5 -0
- package/dist/nodes/vendors/OpenAi/actions/image/index.js +61 -0
- package/dist/nodes/vendors/OpenAi/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/node.type.d.ts +10 -0
- package/dist/nodes/vendors/OpenAi/actions/node.type.js +3 -0
- package/dist/nodes/vendors/OpenAi/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/router.d.ts +2 -0
- package/dist/nodes/vendors/OpenAi/actions/router.js +81 -0
- package/dist/nodes/vendors/OpenAi/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js +79 -0
- package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/text/index.d.ts +5 -0
- package/dist/nodes/vendors/OpenAi/actions/text/index.js +61 -0
- package/dist/nodes/vendors/OpenAi/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/text/message.operation.d.ts +25 -0
- package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js +239 -0
- package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +137 -0
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.d.ts +55 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js +3 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.d.ts +5 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js +36 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/index.d.ts +2 -0
- package/dist/nodes/vendors/OpenAi/methods/index.js +29 -0
- package/dist/nodes/vendors/OpenAi/methods/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/listSearch.d.ts +4 -0
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js +101 -0
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/loadOptions.d.ts +2 -0
- package/dist/nodes/vendors/OpenAi/methods/loadOptions.js +17 -0
- package/dist/nodes/vendors/OpenAi/methods/loadOptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/openAi.svg +1 -0
- package/dist/nodes/vendors/OpenAi/transport/index.d.ts +10 -0
- package/dist/nodes/vendors/OpenAi/transport/index.js +20 -0
- package/dist/nodes/vendors/OpenAi/transport/index.js.map +1 -0
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +30 -27
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.js +7 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/logWrapper.js +30 -16
- package/dist/utils/logWrapper.js.map +1 -1
- package/dist/utils/sharedFields.js +3 -1
- package/dist/utils/sharedFields.js.map +1 -1
- package/package.json +14 -8
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.execute = exports.description = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
9
|
+
const transport_1 = require("../../transport");
|
|
10
|
+
const properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Input Data Field Name',
|
|
13
|
+
name: 'binaryPropertyName',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'data',
|
|
16
|
+
hint: 'The name of the input field containing the binary file data to be processed',
|
|
17
|
+
placeholder: 'e.g. data',
|
|
18
|
+
description: 'Name of the binary property which contains the audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Options',
|
|
22
|
+
name: 'options',
|
|
23
|
+
placeholder: 'Add Option',
|
|
24
|
+
type: 'collection',
|
|
25
|
+
default: {},
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Output Randomness (Temperature)',
|
|
29
|
+
name: 'temperature',
|
|
30
|
+
type: 'number',
|
|
31
|
+
default: 0,
|
|
32
|
+
typeOptions: {
|
|
33
|
+
minValue: 0,
|
|
34
|
+
maxValue: 1,
|
|
35
|
+
numberPrecision: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const displayOptions = {
|
|
42
|
+
show: {
|
|
43
|
+
operation: ['translate'],
|
|
44
|
+
resource: ['audio'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
48
|
+
async function execute(i) {
|
|
49
|
+
const model = 'whisper-1';
|
|
50
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
51
|
+
const options = this.getNodeParameter('options', i, {});
|
|
52
|
+
const formData = new form_data_1.default();
|
|
53
|
+
formData.append('model', model);
|
|
54
|
+
if (options.temperature) {
|
|
55
|
+
formData.append('temperature', options.temperature.toString());
|
|
56
|
+
}
|
|
57
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
58
|
+
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
59
|
+
formData.append('file', dataBuffer, {
|
|
60
|
+
filename: binaryData.fileName,
|
|
61
|
+
contentType: binaryData.mimeType,
|
|
62
|
+
});
|
|
63
|
+
const response = await transport_1.apiRequest.call(this, 'POST', '/audio/translations', {
|
|
64
|
+
option: { formData },
|
|
65
|
+
headers: {
|
|
66
|
+
'Content-Type': 'multipart/form-data',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
json: response,
|
|
72
|
+
pairedItem: { item: i },
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
exports.execute = execute;
|
|
77
|
+
//# sourceMappingURL=translate.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/audio/translate.operation.ts"],"names":[],"mappings":";;;;;;AACA,+CAAoD;AACpD,0DAAiC;AACjC,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,6EAA6E;QACnF,WAAW,EAAE,WAAW;QACxB,WAAW,EACV,uIAAuI;KACxI;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,iCAAiC;gBAC9C,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE;oBACZ,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,CAAC;oBACX,eAAe,EAAE,CAAC;iBAClB;aACD;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,WAAW,CAAC;QACxB,QAAQ,EAAE,CAAC,OAAO,CAAC;KACnB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,KAAK,GAAG,WA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ports.assistantRLC = exports.modelRLC = void 0;
|
|
4
|
+
exports.modelRLC = {
|
|
5
|
+
displayName: 'Model',
|
|
6
|
+
name: 'modelId',
|
|
7
|
+
type: 'resourceLocator',
|
|
8
|
+
default: { mode: 'list', value: '' },
|
|
9
|
+
required: true,
|
|
10
|
+
modes: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'From List',
|
|
13
|
+
name: 'list',
|
|
14
|
+
type: 'list',
|
|
15
|
+
typeOptions: {
|
|
16
|
+
searchListMethod: 'modelSearch',
|
|
17
|
+
searchable: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'ID',
|
|
22
|
+
name: 'id',
|
|
23
|
+
type: 'string',
|
|
24
|
+
placeholder: 'e.g. gpt-4',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
exports.assistantRLC = {
|
|
29
|
+
displayName: 'Assistant',
|
|
30
|
+
name: 'assistantId',
|
|
31
|
+
type: 'resourceLocator',
|
|
32
|
+
description: 'Assistant to respond to the message. You can add, modify or remove assistants in the <a href="https://platform.openai.com/playground?mode=assistant" target="_blank">playground</a>.',
|
|
33
|
+
default: { mode: 'list', value: '' },
|
|
34
|
+
required: true,
|
|
35
|
+
modes: [
|
|
36
|
+
{
|
|
37
|
+
displayName: 'From List',
|
|
38
|
+
name: 'list',
|
|
39
|
+
type: 'list',
|
|
40
|
+
typeOptions: {
|
|
41
|
+
searchListMethod: 'assistantSearch',
|
|
42
|
+
searchable: true,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'ID',
|
|
47
|
+
name: 'id',
|
|
48
|
+
type: 'string',
|
|
49
|
+
placeholder: 'e.g. asst_abc123',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=descriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../../../../nodes/vendors/OpenAi/actions/descriptions.ts"],"names":[],"mappings":";;;AAEa,QAAA,QAAQ,GAAoB;IACxC,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IACpC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN;YACC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE;gBACZ,gBAAgB,EAAE,aAAa;gBAC/B,UAAU,EAAE,IAAI;aAChB;SACD;QACD;YACC,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,YAAY;SACzB;KACD;CACD,CAAC;AAEW,QAAA,YAAY,GAAoB;IAC5C,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACV,sLAAsL;IACvL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IACpC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN;YACC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE;gBACZ,gBAAgB,EAAE,iBAAiB;gBACnC,UAAU,EAAE,IAAI;aAChB;SACD;QACD;YACC,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kBAAkB;SAC/B;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions | undefined;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
hint?: string | undefined;
|
|
11
|
+
options?: (INodeProperties | import("n8n-workflow").INodePropertyOptions | import("n8n-workflow").INodePropertyCollection)[] | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
isNodeSetting?: boolean | undefined;
|
|
14
|
+
noDataExpression?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
routing?: import("n8n-workflow").INodePropertyRouting | undefined;
|
|
17
|
+
credentialTypes?: ("extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth")[] | undefined;
|
|
18
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractorRegex | undefined;
|
|
19
|
+
modes?: import("n8n-workflow").INodePropertyMode[] | undefined;
|
|
20
|
+
requiresDataPath?: "single" | "multiple" | undefined;
|
|
21
|
+
doNotInherit?: boolean | undefined;
|
|
22
|
+
validateType?: import("n8n-workflow").FieldType | undefined;
|
|
23
|
+
ignoreValidationDuringExecution?: boolean | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = exports.description = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("../../transport");
|
|
6
|
+
const properties = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'File',
|
|
9
|
+
name: 'fileId',
|
|
10
|
+
type: 'resourceLocator',
|
|
11
|
+
default: { mode: 'list', value: '' },
|
|
12
|
+
required: true,
|
|
13
|
+
modes: [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'From List',
|
|
16
|
+
name: 'list',
|
|
17
|
+
type: 'list',
|
|
18
|
+
typeOptions: {
|
|
19
|
+
searchListMethod: 'fileSearch',
|
|
20
|
+
searchable: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'ID',
|
|
25
|
+
name: 'id',
|
|
26
|
+
type: 'string',
|
|
27
|
+
validation: [
|
|
28
|
+
{
|
|
29
|
+
type: 'regex',
|
|
30
|
+
properties: {
|
|
31
|
+
regex: 'file-[a-zA-Z0-9]',
|
|
32
|
+
errorMessage: 'Not a valid File ID',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
placeholder: 'e.g. file-1234567890',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const displayOptions = {
|
|
42
|
+
show: {
|
|
43
|
+
operation: ['deleteFile'],
|
|
44
|
+
resource: ['file'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
48
|
+
async function execute(i) {
|
|
49
|
+
const fileId = this.getNodeParameter('fileId', i, '', { extractValue: true });
|
|
50
|
+
const response = await transport_1.apiRequest.call(this, 'DELETE', `/files/${fileId}`);
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
json: response,
|
|
54
|
+
pairedItem: { item: i },
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
exports.execute = execute;
|
|
59
|
+
//# sourceMappingURL=deleteFile.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteFile.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/file/deleteFile.operation.ts"],"names":[],"mappings":";;;AACA,+CAAoD;AAEpD,+CAA6C;AA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ACvB;KACD,CAAC;AACH,CAAC;AAXD,0BAWC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as upload from './upload.operation';
|
|
3
|
+
import * as deleteFile from './deleteFile.operation';
|
|
4
|
+
import * as list from './list.operation';
|
|
5
|
+
export { upload, deleteFile, list };
|
|
6
|
+
export declare const description: INodeProperties[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.description = exports.list = exports.deleteFile = exports.upload = void 0;
|
|
27
|
+
const upload = __importStar(require("./upload.operation"));
|
|
28
|
+
exports.upload = upload;
|
|
29
|
+
const deleteFile = __importStar(require("./deleteFile.operation"));
|
|
30
|
+
exports.deleteFile = deleteFile;
|
|
31
|
+
const list = __importStar(require("./list.operation"));
|
|
32
|
+
exports.list = list;
|
|
33
|
+
exports.description = [
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Operation',
|
|
36
|
+
name: 'operation',
|
|
37
|
+
type: 'options',
|
|
38
|
+
noDataExpression: true,
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
name: 'Delete a File',
|
|
42
|
+
value: 'deleteFile',
|
|
43
|
+
action: 'Delete a file',
|
|
44
|
+
description: 'Delete a file from the server',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'List Files',
|
|
48
|
+
value: 'list',
|
|
49
|
+
action: 'List files',
|
|
50
|
+
description: "Returns a list of files that belong to the user's organization",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Upload a File',
|
|
54
|
+
value: 'upload',
|
|
55
|
+
action: 'Upload a file',
|
|
56
|
+
description: 'Upload a file that can be used across various endpoints',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
default: 'upload',
|
|
60
|
+
displayOptions: {
|
|
61
|
+
show: {
|
|
62
|
+
resource: ['file'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
...upload.description,
|
|
67
|
+
...deleteFile.description,
|
|
68
|
+
...list.description,
|
|
69
|
+
];
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/file/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAA6C;AAIpC,wBAAM;AAHf,mEAAqD;AAGpC,gCAAU;AAF3B,uDAAyC;AAEZ,oBAAI;AAEpB,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,eAAe;gBACvB,WAAW,EAAE,+BAA+B;aAC5C;YACD;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,YAAY;gBACpB,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,eAAe;gBACvB,WAAW,EAAE,yDAAyD;aACtE;SACD;QACD,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,MAAM,CAAC;aAClB;SACD;KACD;IAED,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,UAAU,CAAC,WAAW;IACzB,GAAG,IAAI,CAAC,WAAW;CACnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions | undefined;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
hint?: string | undefined;
|
|
11
|
+
options?: (INodeProperties | import("n8n-workflow").INodePropertyOptions | import("n8n-workflow").INodePropertyCollection)[] | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
isNodeSetting?: boolean | undefined;
|
|
14
|
+
noDataExpression?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
routing?: import("n8n-workflow").INodePropertyRouting | undefined;
|
|
17
|
+
credentialTypes?: ("extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth")[] | undefined;
|
|
18
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractorRegex | undefined;
|
|
19
|
+
modes?: import("n8n-workflow").INodePropertyMode[] | undefined;
|
|
20
|
+
requiresDataPath?: "single" | "multiple" | undefined;
|
|
21
|
+
doNotInherit?: boolean | undefined;
|
|
22
|
+
validateType?: import("n8n-workflow").FieldType | undefined;
|
|
23
|
+
ignoreValidationDuringExecution?: boolean | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = exports.description = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const transport_1 = require("../../transport");
|
|
6
|
+
const properties = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Options',
|
|
9
|
+
name: 'options',
|
|
10
|
+
placeholder: 'Add Option',
|
|
11
|
+
type: 'collection',
|
|
12
|
+
default: {},
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Purpose',
|
|
16
|
+
name: 'purpose',
|
|
17
|
+
type: 'options',
|
|
18
|
+
default: 'any',
|
|
19
|
+
description: 'Only return files with the given purpose',
|
|
20
|
+
options: [
|
|
21
|
+
{
|
|
22
|
+
name: 'Any [Default]',
|
|
23
|
+
value: 'any',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Assistants',
|
|
27
|
+
value: 'assistants',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Fine-Tune',
|
|
31
|
+
value: 'fine-tune',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
const displayOptions = {
|
|
39
|
+
show: {
|
|
40
|
+
operation: ['list'],
|
|
41
|
+
resource: ['file'],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
45
|
+
async function execute(i) {
|
|
46
|
+
const options = this.getNodeParameter('options', i, {});
|
|
47
|
+
const qs = {};
|
|
48
|
+
if (options.purpose && options.purpose !== 'any') {
|
|
49
|
+
qs.purpose = options.purpose;
|
|
50
|
+
}
|
|
51
|
+
const { data } = await transport_1.apiRequest.call(this, 'GET', '/files', { qs });
|
|
52
|
+
return (data || []).map((file) => ({
|
|
53
|
+
json: file,
|
|
54
|
+
pairedItem: { item: i },
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
exports.execute = execute;
|
|
58
|
+
//# sourceMappingURL=list.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/file/list.operation.ts"],"names":[],"mappings":";;;AAMA,+CAAoD;AAEpD,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,0CAA0C;gBACvD,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,eAAe;wBACrB,KAAK,EAAE,KAAK;qBACZ;oBACD;wBACC,IAAI,EAAE,YAAY;wBAClB,KAAK,EAAE,YAAY;qBACnB;oBACD;wBACC,IAAI,EAAE,WAAW;wBACjB,KAAK,EAAE,WAAW;qBAClB;iBACD;aACD;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,CAAC,MAAM,CAAC;KAClB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,EAAE,GAAgB,EAAE,CAAC;IAE3B,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAClD,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,OAAiB,CAAC;IACxC,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAiB,EAAE,EAAE,CAAC,CAAC;QAC/C,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;KACvB,CAAC,CAAC,CAAC;AACL,CAAC;AAdD,0BAcC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions | undefined;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
hint?: string | undefined;
|
|
11
|
+
options?: (INodeProperties | import("n8n-workflow").INodePropertyOptions | import("n8n-workflow").INodePropertyCollection)[] | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
isNodeSetting?: boolean | undefined;
|
|
14
|
+
noDataExpression?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
routing?: import("n8n-workflow").INodePropertyRouting | undefined;
|
|
17
|
+
credentialTypes?: ("extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth")[] | undefined;
|
|
18
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractorRegex | undefined;
|
|
19
|
+
modes?: import("n8n-workflow").INodePropertyMode[] | undefined;
|
|
20
|
+
requiresDataPath?: "single" | "multiple" | undefined;
|
|
21
|
+
doNotInherit?: boolean | undefined;
|
|
22
|
+
validateType?: import("n8n-workflow").FieldType | undefined;
|
|
23
|
+
ignoreValidationDuringExecution?: boolean | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.execute = exports.description = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const form_data_1 = __importDefault(require("form-data"));
|
|
9
|
+
const transport_1 = require("../../transport");
|
|
10
|
+
const properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Input Data Field Name',
|
|
13
|
+
name: 'binaryPropertyName',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'data',
|
|
16
|
+
hint: 'The name of the input field containing the binary file data to be processed',
|
|
17
|
+
placeholder: 'e.g. data',
|
|
18
|
+
description: 'Name of the binary property which contains the file. The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Options',
|
|
22
|
+
name: 'options',
|
|
23
|
+
placeholder: 'Add Option',
|
|
24
|
+
type: 'collection',
|
|
25
|
+
default: {},
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Purpose',
|
|
29
|
+
name: 'purpose',
|
|
30
|
+
type: 'options',
|
|
31
|
+
default: 'assistants',
|
|
32
|
+
description: "The intended purpose of the uploaded file, the 'Fine-tuning' only supports .jsonl files",
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Assistants',
|
|
36
|
+
value: 'assistants',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Fine-Tune',
|
|
40
|
+
value: 'fine-tune',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
const displayOptions = {
|
|
48
|
+
show: {
|
|
49
|
+
operation: ['upload'],
|
|
50
|
+
resource: ['file'],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
54
|
+
async function execute(i) {
|
|
55
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
56
|
+
const options = this.getNodeParameter('options', i, {});
|
|
57
|
+
const formData = new form_data_1.default();
|
|
58
|
+
formData.append('purpose', options.purpose || 'assistants');
|
|
59
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
60
|
+
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
61
|
+
formData.append('file', dataBuffer, {
|
|
62
|
+
filename: binaryData.fileName,
|
|
63
|
+
contentType: binaryData.mimeType,
|
|
64
|
+
});
|
|
65
|
+
try {
|
|
66
|
+
const response = await transport_1.apiRequest.call(this, 'POST', '/files', {
|
|
67
|
+
option: { formData },
|
|
68
|
+
headers: {
|
|
69
|
+
'Content-Type': 'multipart/form-data',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
json: response,
|
|
75
|
+
pairedItem: { item: i },
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (error.message.includes('Bad request') &&
|
|
81
|
+
error.description &&
|
|
82
|
+
error.description.includes('Expected file to have JSONL format')) {
|
|
83
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The file content is not in JSONL format', {
|
|
84
|
+
description: 'Fine-tuning accepts only files in JSONL format, where every line is a valid JSON dictionary',
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.execute = execute;
|
|
91
|
+
//# sourceMappingURL=upload.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/file/upload.operation.ts"],"names":[],"mappings":";;;;;;AACA,+CAAwE;AACxE,0DAAiC;AACjC,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,6EAA6E;QACnF,WAAW,EAAE,WAAW;QACxB,WAAW,EACV,kJAAkJ;KACnJ;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC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MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;YAC9D,MAAM,EAAE,EAAE,QAAQ,EAAE;YACpB,OAAO,EAAE;gBACR,cAAc,EAAE,qBAAqB;aACrC;SACD,CAAC,CAAC;QAEH,OAAO;YACN;gBACC,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;aACvB;SACD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IACC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;YACrC,KAAK,CAAC,WAAW;YACjB,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,oCAAoC,CAAC,EAC/D,CAAC;YACF,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,yCAAyC,EAAE;gBACvF,WAAW,EACV,6FAA6F;aAC9F,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AA3CD,0BA2CC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions | undefined;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
hint?: string | undefined;
|
|
11
|
+
options?: (INodeProperties | import("n8n-workflow").INodePropertyOptions | import("n8n-workflow").INodePropertyCollection)[] | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
isNodeSetting?: boolean | undefined;
|
|
14
|
+
noDataExpression?: boolean | undefined;
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
routing?: import("n8n-workflow").INodePropertyRouting | undefined;
|
|
17
|
+
credentialTypes?: ("extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth")[] | undefined;
|
|
18
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractorRegex | undefined;
|
|
19
|
+
modes?: import("n8n-workflow").INodePropertyMode[] | undefined;
|
|
20
|
+
requiresDataPath?: "single" | "multiple" | undefined;
|
|
21
|
+
doNotInherit?: boolean | undefined;
|
|
22
|
+
validateType?: import("n8n-workflow").FieldType | undefined;
|
|
23
|
+
ignoreValidationDuringExecution?: boolean | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|