@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,211 @@
|
|
|
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 descriptions_1 = require("../descriptions");
|
|
7
|
+
const properties = [
|
|
8
|
+
descriptions_1.modelRLC,
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Name',
|
|
11
|
+
name: 'name',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
description: 'The name of the assistant. The maximum length is 256 characters.',
|
|
15
|
+
placeholder: 'e.g. My Assistant',
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Description',
|
|
20
|
+
name: 'description',
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: '',
|
|
23
|
+
description: 'The description of the assistant. The maximum length is 512 characters.',
|
|
24
|
+
placeholder: 'e.g. My personal assistant',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Instructions',
|
|
28
|
+
name: 'instructions',
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'The system instructions that the assistant uses. The maximum length is 32768 characters.',
|
|
31
|
+
default: '',
|
|
32
|
+
typeOptions: {
|
|
33
|
+
rows: 2,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Code Interpreter',
|
|
38
|
+
name: 'codeInterpreter',
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
default: false,
|
|
41
|
+
description: 'Whether to enable the code interpreter that allows the assistants to write and run Python code in a sandboxed execution environment, find more <a href="https://platform.openai.com/docs/assistants/tools/code-interpreter" target="_blank">here</a>',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Knowledge Retrieval',
|
|
45
|
+
name: 'knowledgeRetrieval',
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
default: false,
|
|
48
|
+
description: 'Whether to augments the assistant with knowledge from outside its model, such as proprietary product information or documents, find more <a href="https://platform.openai.com/docs/assistants/tools/knowledge-retrieval" target="_blank">here</a>',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Files',
|
|
52
|
+
name: 'file_ids',
|
|
53
|
+
type: 'multiOptions',
|
|
54
|
+
description: 'The files to be used by the assistant, there can be a maximum of 20 files attached to the assistant',
|
|
55
|
+
typeOptions: {
|
|
56
|
+
loadOptionsMethod: 'getFiles',
|
|
57
|
+
},
|
|
58
|
+
default: [],
|
|
59
|
+
hint: "Add more files by using the 'Upload a File' operation",
|
|
60
|
+
displayOptions: {
|
|
61
|
+
show: {
|
|
62
|
+
codeInterpreter: [true],
|
|
63
|
+
},
|
|
64
|
+
hide: {
|
|
65
|
+
knowledgeRetrieval: [true],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Files',
|
|
71
|
+
name: 'file_ids',
|
|
72
|
+
type: 'multiOptions',
|
|
73
|
+
description: 'The files to be used by the assistant, there can be a maximum of 20 files attached to the assistant',
|
|
74
|
+
typeOptions: {
|
|
75
|
+
loadOptionsMethod: 'getFiles',
|
|
76
|
+
},
|
|
77
|
+
default: [],
|
|
78
|
+
hint: "Add more files by using the 'Upload a File' operation",
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
knowledgeRetrieval: [true],
|
|
82
|
+
},
|
|
83
|
+
hide: {
|
|
84
|
+
codeInterpreter: [true],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Files',
|
|
90
|
+
name: 'file_ids',
|
|
91
|
+
type: 'multiOptions',
|
|
92
|
+
description: 'The files to be used by the assistant, there can be a maximum of 20 files attached to the assistant',
|
|
93
|
+
typeOptions: {
|
|
94
|
+
loadOptionsMethod: 'getFiles',
|
|
95
|
+
},
|
|
96
|
+
default: [],
|
|
97
|
+
hint: "Add more files by using the 'Upload a File' operation",
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
knowledgeRetrieval: [true],
|
|
101
|
+
codeInterpreter: [true],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: "Add custom n8n tools when using the 'Message Assistant' operation",
|
|
107
|
+
name: 'noticeTools',
|
|
108
|
+
type: 'notice',
|
|
109
|
+
default: '',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
displayName: 'Options',
|
|
113
|
+
name: 'options',
|
|
114
|
+
placeholder: 'Add Option',
|
|
115
|
+
type: 'collection',
|
|
116
|
+
default: {},
|
|
117
|
+
options: [
|
|
118
|
+
{
|
|
119
|
+
displayName: 'Fail if Assistant Already Exists',
|
|
120
|
+
name: 'failIfExists',
|
|
121
|
+
type: 'boolean',
|
|
122
|
+
default: false,
|
|
123
|
+
description: 'Whether to fail an operation if the assistant with the same name already exists',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
const displayOptions = {
|
|
129
|
+
show: {
|
|
130
|
+
operation: ['create'],
|
|
131
|
+
resource: ['assistant'],
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
135
|
+
async function execute(i) {
|
|
136
|
+
const model = this.getNodeParameter('modelId', i, '', { extractValue: true });
|
|
137
|
+
const name = this.getNodeParameter('name', i);
|
|
138
|
+
const assistantDescription = this.getNodeParameter('description', i);
|
|
139
|
+
const instructions = this.getNodeParameter('instructions', i);
|
|
140
|
+
const codeInterpreter = this.getNodeParameter('codeInterpreter', i);
|
|
141
|
+
const knowledgeRetrieval = this.getNodeParameter('knowledgeRetrieval', i);
|
|
142
|
+
const file_ids = this.getNodeParameter('file_ids', i, []);
|
|
143
|
+
const options = this.getNodeParameter('options', i, {});
|
|
144
|
+
if (options.failIfExists) {
|
|
145
|
+
const assistants = [];
|
|
146
|
+
let has_more = true;
|
|
147
|
+
let after;
|
|
148
|
+
do {
|
|
149
|
+
const response = await transport_1.apiRequest.call(this, 'GET', '/assistants', {
|
|
150
|
+
headers: {
|
|
151
|
+
'OpenAI-Beta': 'assistants=v1',
|
|
152
|
+
},
|
|
153
|
+
qs: {
|
|
154
|
+
limit: 100,
|
|
155
|
+
after,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
for (const assistant of response.data || []) {
|
|
159
|
+
assistants.push(assistant.name);
|
|
160
|
+
}
|
|
161
|
+
has_more = response.has_more;
|
|
162
|
+
if (has_more) {
|
|
163
|
+
after = response.last_id;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
} while (has_more);
|
|
169
|
+
if (assistants.includes(name)) {
|
|
170
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `An assistant with the same name '${name}' already exists`, { itemIndex: i });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (file_ids.length > 20) {
|
|
174
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The maximum number of files that can be attached to the assistant is 20', { itemIndex: i });
|
|
175
|
+
}
|
|
176
|
+
const body = {
|
|
177
|
+
model,
|
|
178
|
+
name,
|
|
179
|
+
description: assistantDescription,
|
|
180
|
+
instructions,
|
|
181
|
+
file_ids,
|
|
182
|
+
};
|
|
183
|
+
const tools = [];
|
|
184
|
+
if (codeInterpreter) {
|
|
185
|
+
tools.push({
|
|
186
|
+
type: 'code_interpreter',
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (knowledgeRetrieval) {
|
|
190
|
+
tools.push({
|
|
191
|
+
type: 'retrieval',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (tools.length) {
|
|
195
|
+
body.tools = tools;
|
|
196
|
+
}
|
|
197
|
+
const response = await transport_1.apiRequest.call(this, 'POST', '/assistants', {
|
|
198
|
+
body,
|
|
199
|
+
headers: {
|
|
200
|
+
'OpenAI-Beta': 'assistants=v1',
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
return [
|
|
204
|
+
{
|
|
205
|
+
json: response,
|
|
206
|
+
pairedItem: { item: i },
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
exports.execute = execute;
|
|
211
|
+
//# sourceMappingURL=create.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/assistant/create.operation.ts"],"names":[],"mappings":";;;AAMA,+CAAwE;AACxE,+CAA6C;AAC7C,kDAA2C;AAE3C,MAAM,UAAU,GAAsB;IACrC,uBAAQ;IACR;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,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,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACvB;KACD,CAAC;AACH,CAAC;AAhGD,0BAgGC"}
|
|
@@ -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,30 @@
|
|
|
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 descriptions_1 = require("../descriptions");
|
|
7
|
+
const properties = [descriptions_1.assistantRLC];
|
|
8
|
+
const displayOptions = {
|
|
9
|
+
show: {
|
|
10
|
+
operation: ['deleteAssistant'],
|
|
11
|
+
resource: ['assistant'],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
15
|
+
async function execute(i) {
|
|
16
|
+
const assistantId = this.getNodeParameter('assistantId', i, '', { extractValue: true });
|
|
17
|
+
const response = await transport_1.apiRequest.call(this, 'DELETE', `/assistants/${assistantId}`, {
|
|
18
|
+
headers: {
|
|
19
|
+
'OpenAI-Beta': 'assistants=v1',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
json: response,
|
|
25
|
+
pairedItem: { item: i },
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
exports.execute = execute;
|
|
30
|
+
//# sourceMappingURL=deleteAssistant.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteAssistant.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.ts"],"names":[],"mappings":";;;AACA,+CAAoD;AACpD,+CAA6C;AAC7C,kDAA+C;AAE/C,MAAM,UAAU,GAAsB,CAAC,2BAAY,CAAC,CAAC;AAErD,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,CAAC,WAAW,CAAC;KACvB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAW,CAAC;IAElG,MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,WAAW,EAAE,EAAE;QACpF,OAAO,EAAE;YACR,aAAa,EAAE,eAAe;SAC9B;KACD,CAAC,CAAC;IAEH,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACvB;KACD,CAAC;AACH,CAAC;AAfD,0BAeC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as create from './create.operation';
|
|
3
|
+
import * as deleteAssistant from './deleteAssistant.operation';
|
|
4
|
+
import * as message from './message.operation';
|
|
5
|
+
import * as list from './list.operation';
|
|
6
|
+
import * as update from './update.operation';
|
|
7
|
+
export { create, deleteAssistant, message, list, update };
|
|
8
|
+
export declare const description: INodeProperties[];
|
|
@@ -0,0 +1,88 @@
|
|
|
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.update = exports.list = exports.message = exports.deleteAssistant = exports.create = void 0;
|
|
27
|
+
const create = __importStar(require("./create.operation"));
|
|
28
|
+
exports.create = create;
|
|
29
|
+
const deleteAssistant = __importStar(require("./deleteAssistant.operation"));
|
|
30
|
+
exports.deleteAssistant = deleteAssistant;
|
|
31
|
+
const message = __importStar(require("./message.operation"));
|
|
32
|
+
exports.message = message;
|
|
33
|
+
const list = __importStar(require("./list.operation"));
|
|
34
|
+
exports.list = list;
|
|
35
|
+
const update = __importStar(require("./update.operation"));
|
|
36
|
+
exports.update = update;
|
|
37
|
+
exports.description = [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Operation',
|
|
40
|
+
name: 'operation',
|
|
41
|
+
type: 'options',
|
|
42
|
+
noDataExpression: true,
|
|
43
|
+
options: [
|
|
44
|
+
{
|
|
45
|
+
name: 'Create an Assistant',
|
|
46
|
+
value: 'create',
|
|
47
|
+
action: 'Create an assistant',
|
|
48
|
+
description: 'Create a new assistant',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Delete an Assistant',
|
|
52
|
+
value: 'deleteAssistant',
|
|
53
|
+
action: 'Delete an assistant',
|
|
54
|
+
description: 'Delete an assistant from the account',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'List Assistants',
|
|
58
|
+
value: 'list',
|
|
59
|
+
action: 'List assistants',
|
|
60
|
+
description: 'List assistants in the organization',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Message an Assistant',
|
|
64
|
+
value: 'message',
|
|
65
|
+
action: 'Message an assistant',
|
|
66
|
+
description: 'Send messages to an assistant',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Update an Assistant',
|
|
70
|
+
value: 'update',
|
|
71
|
+
action: 'Update an assistant',
|
|
72
|
+
description: 'Update an existing assistant',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
default: 'message',
|
|
76
|
+
displayOptions: {
|
|
77
|
+
show: {
|
|
78
|
+
resource: ['assistant'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
...create.description,
|
|
83
|
+
...deleteAssistant.description,
|
|
84
|
+
...message.description,
|
|
85
|
+
...list.description,
|
|
86
|
+
...update.description,
|
|
87
|
+
];
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/assistant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAA6C;AAMpC,wBAAM;AALf,6EAA+D;AAK9C,0CAAe;AAJhC,6DAA+C;AAIb,0BAAO;AAHzC,uDAAyC;AAGE,oBAAI;AAF/C,2DAA6C;AAEI,wBAAM;AAE1C,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,qBAAqB;gBAC3B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,qBAAqB;gBAC7B,WAAW,EAAE,wBAAwB;aACrC;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,iBAAiB;gBACxB,MAAM,EAAE,qBAAqB;gBAC7B,WAAW,EAAE,sCAAsC;aACnD;YACD;gBACC,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,iBAAiB;gBACzB,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,sBAAsB;gBAC9B,WAAW,EAAE,+BAA+B;aAC5C;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,qBAAqB;gBAC7B,WAAW,EAAE,8BAA8B;aAC3C;SACD;QACD,OAAO,EAAE,SAAS;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,WAAW,CAAC;aACvB;SACD;KACD;IAED,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,eAAe,CAAC,WAAW;IAC9B,GAAG,OAAO,CAAC,WAAW;IACtB,GAAG,IAAI,CAAC,WAAW;IACnB,GAAG,MAAM,CAAC,WAAW;CACrB,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,68 @@
|
|
|
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: 'Simplify Output',
|
|
9
|
+
name: 'simplify',
|
|
10
|
+
type: 'boolean',
|
|
11
|
+
default: true,
|
|
12
|
+
description: 'Whether to return a simplified version of the response instead of the raw data',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
const displayOptions = {
|
|
16
|
+
show: {
|
|
17
|
+
operation: ['list'],
|
|
18
|
+
resource: ['assistant'],
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
22
|
+
async function execute(i) {
|
|
23
|
+
const returnData = [];
|
|
24
|
+
let has_more = true;
|
|
25
|
+
let after;
|
|
26
|
+
do {
|
|
27
|
+
const response = await transport_1.apiRequest.call(this, 'GET', '/assistants', {
|
|
28
|
+
headers: {
|
|
29
|
+
'OpenAI-Beta': 'assistants=v1',
|
|
30
|
+
},
|
|
31
|
+
qs: {
|
|
32
|
+
limit: 100,
|
|
33
|
+
after,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
for (const assistant of response.data || []) {
|
|
37
|
+
try {
|
|
38
|
+
assistant.created_at = new Date(assistant.created_at * 1000).toISOString();
|
|
39
|
+
}
|
|
40
|
+
catch (error) { }
|
|
41
|
+
returnData.push({ json: assistant, pairedItem: { item: i } });
|
|
42
|
+
}
|
|
43
|
+
has_more = response.has_more;
|
|
44
|
+
if (has_more) {
|
|
45
|
+
after = response.last_id;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
} while (has_more);
|
|
51
|
+
const simplify = this.getNodeParameter('simplify', i);
|
|
52
|
+
if (simplify) {
|
|
53
|
+
return returnData.map((item) => {
|
|
54
|
+
const { id, name, model } = item.json;
|
|
55
|
+
return {
|
|
56
|
+
json: {
|
|
57
|
+
id,
|
|
58
|
+
name,
|
|
59
|
+
model,
|
|
60
|
+
},
|
|
61
|
+
pairedItem: { item: i },
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return returnData;
|
|
66
|
+
}
|
|
67
|
+
exports.execute = execute;
|
|
68
|
+
//# sourceMappingURL=list.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/OpenAi/actions/assistant/list.operation.ts"],"names":[],"mappings":";;;AACA,+CAAoD;AACpD,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,gFAAgF;KAC7F;CACD,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,EAAE,CAAC,CAAY,CAAC;IAEjE,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;YACtC,OAAO;gBACN,IAAI,EAAE;oBACL,EAAE;oBACF,IAAI;oBACJ,KAAK;iBACL;gBACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;aACvB,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAnDD,0BAmDC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } 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,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = exports.description = void 0;
|
|
4
|
+
const agents_1 = require("langchain/agents");
|
|
5
|
+
const openai_assistant_1 = require("langchain/experimental/openai_assistant");
|
|
6
|
+
const openai_1 = require("openai");
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const utils_1 = require("../../helpers/utils");
|
|
9
|
+
const descriptions_1 = require("../descriptions");
|
|
10
|
+
const properties = [
|
|
11
|
+
descriptions_1.assistantRLC,
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Prompt',
|
|
14
|
+
name: 'prompt',
|
|
15
|
+
type: 'options',
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Take from previous node automatically',
|
|
19
|
+
value: 'auto',
|
|
20
|
+
description: 'Looks for an input field called chatInput',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Define below',
|
|
24
|
+
value: 'define',
|
|
25
|
+
description: 'Use an expression to reference data in previous nodes or enter static text',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
default: 'auto',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Text',
|
|
32
|
+
name: 'text',
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: true,
|
|
35
|
+
default: '',
|
|
36
|
+
placeholder: 'e.g. Hello, how can you help me?',
|
|
37
|
+
typeOptions: {
|
|
38
|
+
rows: 2,
|
|
39
|
+
},
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
prompt: ['define'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: 'Connect your own custom n8n tools to this node on the canvas',
|
|
48
|
+
name: 'noticeTools',
|
|
49
|
+
type: 'notice',
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Options',
|
|
54
|
+
name: 'options',
|
|
55
|
+
placeholder: 'Add Option',
|
|
56
|
+
description: 'Additional options to add',
|
|
57
|
+
type: 'collection',
|
|
58
|
+
default: {},
|
|
59
|
+
options: [
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Base URL',
|
|
62
|
+
name: 'baseURL',
|
|
63
|
+
default: 'https://api.openai.com/v1',
|
|
64
|
+
description: 'Override the default base URL for the API',
|
|
65
|
+
type: 'string',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
displayName: 'Max Retries',
|
|
69
|
+
name: 'maxRetries',
|
|
70
|
+
default: 2,
|
|
71
|
+
description: 'Maximum number of retries to attempt',
|
|
72
|
+
type: 'number',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Timeout',
|
|
76
|
+
name: 'timeout',
|
|
77
|
+
default: 10000,
|
|
78
|
+
description: 'Maximum amount of time a request is allowed to take in milliseconds',
|
|
79
|
+
type: 'number',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
const displayOptions = {
|
|
85
|
+
show: {
|
|
86
|
+
operation: ['message'],
|
|
87
|
+
resource: ['assistant'],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
91
|
+
async function execute(i) {
|
|
92
|
+
var _a, _b, _c, _d;
|
|
93
|
+
const credentials = await this.getCredentials('openAiApi');
|
|
94
|
+
const prompt = this.getNodeParameter('prompt', i);
|
|
95
|
+
let input;
|
|
96
|
+
if (prompt === 'auto') {
|
|
97
|
+
input = this.evaluateExpression('{{ $json["chatInput"] }}', i);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
input = this.getNodeParameter('text', i);
|
|
101
|
+
}
|
|
102
|
+
if (input === undefined) {
|
|
103
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No prompt specified', {
|
|
104
|
+
description: "Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
const assistantId = this.getNodeParameter('assistantId', i, '', { extractValue: true });
|
|
108
|
+
const options = this.getNodeParameter('options', i, {});
|
|
109
|
+
const client = new openai_1.OpenAI({
|
|
110
|
+
apiKey: credentials.apiKey,
|
|
111
|
+
maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : 2,
|
|
112
|
+
timeout: (_b = options.timeout) !== null && _b !== void 0 ? _b : 10000,
|
|
113
|
+
baseURL: options.baseURL,
|
|
114
|
+
});
|
|
115
|
+
const agent = new openai_assistant_1.OpenAIAssistantRunnable({ assistantId, client, asAgent: true });
|
|
116
|
+
const tools = (await this.getInputConnectionData("ai_tool", 0)) || [];
|
|
117
|
+
if (tools.length) {
|
|
118
|
+
const transformedConnectedTools = (_c = tools === null || tools === void 0 ? void 0 : tools.map(utils_1.formatToOpenAIAssistantTool)) !== null && _c !== void 0 ? _c : [];
|
|
119
|
+
const nativeToolsParsed = [];
|
|
120
|
+
const assistant = await client.beta.assistants.retrieve(assistantId);
|
|
121
|
+
const useCodeInterpreter = assistant.tools.some((tool) => tool.type === 'code_interpreter');
|
|
122
|
+
if (useCodeInterpreter) {
|
|
123
|
+
nativeToolsParsed.push({
|
|
124
|
+
type: 'code_interpreter',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const useRetrieval = assistant.tools.some((tool) => tool.type === 'retrieval');
|
|
128
|
+
if (useRetrieval) {
|
|
129
|
+
nativeToolsParsed.push({
|
|
130
|
+
type: 'retrieval',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
await client.beta.assistants.update(assistantId, {
|
|
134
|
+
tools: [...nativeToolsParsed, ...transformedConnectedTools],
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const agentExecutor = agents_1.AgentExecutor.fromAgentAndTools({
|
|
138
|
+
agent,
|
|
139
|
+
tools: tools !== null && tools !== void 0 ? tools : [],
|
|
140
|
+
});
|
|
141
|
+
const response = await agentExecutor.call({
|
|
142
|
+
content: input,
|
|
143
|
+
signal: this.getExecutionCancelSignal(),
|
|
144
|
+
timeout: (_d = options.timeout) !== null && _d !== void 0 ? _d : 10000,
|
|
145
|
+
});
|
|
146
|
+
return [{ json: response, pairedItem: { item: i } }];
|
|
147
|
+
}
|
|
148
|
+
exports.execute = execute;
|
|
149
|
+
//# sourceMappingURL=message.operation.js.map
|