@n8n/n8n-nodes-langchain 1.115.0 → 1.116.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/credentials/AnthropicApi.credentials.js +39 -8
- package/dist/credentials/AnthropicApi.credentials.js.map +1 -1
- package/dist/credentials/LemonadeApi.credentials.js +70 -0
- package/dist/credentials/LemonadeApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +9 -0
- package/dist/known/nodes.json +12 -0
- package/dist/nodes/agents/Agent/Agent.node.js +1 -2
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js +2 -0
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js +13 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +49 -30
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +3 -0
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js +87 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/lemonade.svg +53 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +17 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +12 -8
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js +106 -0
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMChatLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +6 -5
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js +107 -0
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/description.js +147 -0
- package/dist/nodes/llms/LMLemonade/description.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +3 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +14 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js +107 -47
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +2 -1
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +43 -4
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
- package/dist/nodes/vendors/Anthropic/transport/index.js +9 -5
- package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js +50 -11
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js +3 -3
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/description.js +75 -0
- package/dist/nodes/vendors/OpenAi/helpers/description.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js +34 -0
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js +52 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js +27 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js +10 -6
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js +110 -0
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/create.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/deleteAssistant.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/list.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/message.operation.js +5 -5
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/update.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/generate.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/transcribe.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/translate.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/deleteFile.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/list.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/upload.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/analyze.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/generate.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/router.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/classify.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/message.operation.js +4 -4
- package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js +116 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js +197 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js +96 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js +121 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js +120 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js +94 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js +75 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js +279 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js +92 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js +130 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js +211 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js +464 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js +319 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js +17 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js +102 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js +277 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js +86 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/message.operation.js +345 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js +777 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js +199 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js +64 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js.map +1 -0
- package/dist/types/credentials.json +2 -1
- package/dist/types/nodes.json +10 -6
- package/dist/utils/helpers.js +22 -2
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +17 -13
- package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/descriptions.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/node.type.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/router.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +0 -160
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +0 -1
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/descriptions.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/node.type.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/text/classify.operation.ts"],"sourcesContent":["import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Text Input',\n\t\tname: 'input',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. Sample text goes here',\n\t\tdescription: 'The input text to classify if it is violates the moderation policy',\n\t\tdefault: '',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to return a simplified version of the response instead of the raw data',\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\tplaceholder: 'Add Option',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Use Stable Model',\n\t\t\t\tname: 'useStableModel',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to use the stable version of the model instead of the latest version, accuracy may be slightly lower',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['classify'],\n\t\tresource: ['text'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst input = this.getNodeParameter('input', i) as string;\n\tconst options = this.getNodeParameter('options', i);\n\tconst model = options.useStableModel ? 'text-moderation-stable' : 'text-moderation-latest';\n\n\tconst body = {\n\t\tinput,\n\t\tmodel,\n\t};\n\n\tconst { results } = await apiRequest.call(this, 'POST', '/moderations', { body });\n\n\tif (!results) return [];\n\n\tconst simplify = this.getNodeParameter('simplify', i) as boolean;\n\n\tif (simplify && results) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: { flagged: results[0].flagged },\n\t\t\t\tpairedItem: { item: i },\n\t\t\t},\n\t\t];\n\t} else {\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: results[0],\n\t\t\t\tpairedItem: { item: i },\n\t\t\t},\n\t\t];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqC;AAErC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,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ACN,WAAO;AAAA,MACN;AAAA,QACC,MAAM,QAAQ,CAAC;AAAA,QACf,YAAY,EAAE,MAAM,EAAE;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var responses_exports = {};
|
|
30
|
+
__export(responses_exports, {
|
|
31
|
+
createRequest: () => createRequest,
|
|
32
|
+
formatInputMessages: () => formatInputMessages
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(responses_exports);
|
|
35
|
+
var import_get = __toESM(require("lodash/get"));
|
|
36
|
+
var import_isObject = __toESM(require("lodash/isObject"));
|
|
37
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
38
|
+
var import_binary_data = require("../../../../helpers/binary-data");
|
|
39
|
+
const toArray = (str) => str.split(",").map((e) => e.trim());
|
|
40
|
+
const removeEmptyProperties = (rest) => {
|
|
41
|
+
return Object.keys(rest).filter(
|
|
42
|
+
(k) => rest[k] !== "" && rest[k] !== void 0 && !((0, import_isObject.default)(rest[k]) && (0, import_n8n_workflow.isObjectEmpty)(rest[k]))
|
|
43
|
+
).reduce((a, k) => ({ ...a, [k]: rest[k] }), {});
|
|
44
|
+
};
|
|
45
|
+
async function formatInputMessages(i, messages) {
|
|
46
|
+
return await Promise.all(
|
|
47
|
+
messages.map(async (message) => {
|
|
48
|
+
const role = message.role;
|
|
49
|
+
let content = [];
|
|
50
|
+
if (message.type === "text" || !message.type) {
|
|
51
|
+
content = [{ type: "input_text", text: message.content }];
|
|
52
|
+
} else if (message.type === "image") {
|
|
53
|
+
const detail = message.imageDetail || "auto";
|
|
54
|
+
if (message.imageType === "base64") {
|
|
55
|
+
const { fileContent, contentType } = await (0, import_binary_data.getBinaryDataFile)(
|
|
56
|
+
this,
|
|
57
|
+
i,
|
|
58
|
+
message.binaryPropertyName
|
|
59
|
+
);
|
|
60
|
+
const buffer = await this.helpers.binaryToBuffer(fileContent);
|
|
61
|
+
content = [
|
|
62
|
+
{
|
|
63
|
+
type: "input_image",
|
|
64
|
+
detail,
|
|
65
|
+
image_url: `data:${contentType};base64,${buffer.toString("base64")}`
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
} else {
|
|
69
|
+
content = [
|
|
70
|
+
{
|
|
71
|
+
type: "input_image",
|
|
72
|
+
detail,
|
|
73
|
+
...message.imageType === "url" && { image_url: message.imageUrl },
|
|
74
|
+
...message.imageType === "fileId" && { file_id: message.fileId }
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
} else if (message.type === "file") {
|
|
79
|
+
if (message.fileType === "base64") {
|
|
80
|
+
const { fileContent, contentType } = await (0, import_binary_data.getBinaryDataFile)(
|
|
81
|
+
this,
|
|
82
|
+
i,
|
|
83
|
+
message.binaryPropertyName
|
|
84
|
+
);
|
|
85
|
+
const buffer = await this.helpers.binaryToBuffer(fileContent);
|
|
86
|
+
content = [
|
|
87
|
+
{
|
|
88
|
+
type: "input_file",
|
|
89
|
+
filename: message.fileName,
|
|
90
|
+
file_data: `data:${contentType};base64,${buffer.toString("base64")}`
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
} else {
|
|
94
|
+
content = [
|
|
95
|
+
{
|
|
96
|
+
type: "input_file",
|
|
97
|
+
...message.fileType === "url" && { file_url: message.fileUrl },
|
|
98
|
+
...message.fileType === "fileId" && { file_id: message.fileId }
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { role, content };
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
async function createRequest(i, { model, messages, options, builtInTools, tools }) {
|
|
108
|
+
const body = {
|
|
109
|
+
model,
|
|
110
|
+
input: await formatInputMessages.call(this, i, messages),
|
|
111
|
+
parallel_tool_calls: (0, import_get.default)(options, "parallelToolCalls", true),
|
|
112
|
+
store: (0, import_get.default)(options, "store", true),
|
|
113
|
+
instructions: options.instructions,
|
|
114
|
+
max_output_tokens: options.maxTokens,
|
|
115
|
+
previous_response_id: options.previousResponseId,
|
|
116
|
+
prompt_cache_key: options.promptCacheKey,
|
|
117
|
+
safety_identifier: options.safetyIdentifier,
|
|
118
|
+
service_tier: options.serviceTier,
|
|
119
|
+
temperature: options.temperature,
|
|
120
|
+
top_p: options.topP,
|
|
121
|
+
top_logprobs: options.topLogprobs,
|
|
122
|
+
tools,
|
|
123
|
+
max_tool_calls: options.maxToolCalls,
|
|
124
|
+
background: (0, import_get.default)(options, "backgroundMode.values.enabled", false)
|
|
125
|
+
};
|
|
126
|
+
if (options.truncation !== void 0) {
|
|
127
|
+
body.truncation = !!options.truncation ? "auto" : "disabled";
|
|
128
|
+
}
|
|
129
|
+
if (options.conversationId) {
|
|
130
|
+
body.conversation = options.conversationId;
|
|
131
|
+
}
|
|
132
|
+
if (Array.isArray(options.include) && options.include?.length) {
|
|
133
|
+
body.include = options.include;
|
|
134
|
+
}
|
|
135
|
+
if (options.metadata) {
|
|
136
|
+
body.metadata = (0, import_n8n_workflow.jsonParse)(options.metadata, {
|
|
137
|
+
errorMessage: "Failed to parse metadata"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (options.promptConfig) {
|
|
141
|
+
const prompt = (0, import_get.default)(options, "promptConfig.promptOptions");
|
|
142
|
+
body.prompt = removeEmptyProperties({
|
|
143
|
+
id: prompt.promptId,
|
|
144
|
+
version: prompt.version,
|
|
145
|
+
...prompt.variables && {
|
|
146
|
+
variables: (0, import_n8n_workflow.jsonParse)(prompt.variables, {
|
|
147
|
+
errorMessage: "Failed to parse prompt variables"
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (options.reasoning) {
|
|
153
|
+
const reasoning = (0, import_get.default)(options, "reasoning.reasoningOptions");
|
|
154
|
+
body.reasoning = removeEmptyProperties({
|
|
155
|
+
effort: reasoning.effort,
|
|
156
|
+
summary: reasoning.summary && reasoning.summary !== "none" ? reasoning.summary : void 0
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (options.textFormat) {
|
|
160
|
+
const textOptions = (0, import_get.default)(options, "textFormat.textOptions");
|
|
161
|
+
const textConfig = {
|
|
162
|
+
verbosity: textOptions.verbosity
|
|
163
|
+
};
|
|
164
|
+
if (textOptions.type === "json_schema") {
|
|
165
|
+
textConfig.format = {
|
|
166
|
+
type: textOptions.type,
|
|
167
|
+
name: textOptions.name,
|
|
168
|
+
schema: (0, import_n8n_workflow.jsonParse)(textOptions.schema, {
|
|
169
|
+
errorMessage: "Failed to parse schema"
|
|
170
|
+
})
|
|
171
|
+
};
|
|
172
|
+
} else if (textOptions.type === "json_object") {
|
|
173
|
+
textConfig.format = {
|
|
174
|
+
type: textOptions.type
|
|
175
|
+
};
|
|
176
|
+
body.input = [
|
|
177
|
+
{
|
|
178
|
+
role: "system",
|
|
179
|
+
content: [
|
|
180
|
+
{ type: "input_text", text: "You are a helpful assistant designed to output JSON." }
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
...body.input
|
|
184
|
+
];
|
|
185
|
+
} else if (textOptions.type === "text") {
|
|
186
|
+
textConfig.format = {
|
|
187
|
+
type: textOptions.type
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
if (textConfig.format) {
|
|
191
|
+
textConfig.format = removeEmptyProperties(textConfig.format);
|
|
192
|
+
}
|
|
193
|
+
body.text = textConfig;
|
|
194
|
+
}
|
|
195
|
+
if (builtInTools) {
|
|
196
|
+
const newTools = body.tools ?? [];
|
|
197
|
+
const webSearchOptions = (0, import_get.default)(builtInTools, "webSearch");
|
|
198
|
+
if (webSearchOptions) {
|
|
199
|
+
let allowedDomains;
|
|
200
|
+
const allowedDomainsRaw = (0, import_get.default)(webSearchOptions, "allowedDomains", "");
|
|
201
|
+
if (allowedDomainsRaw) {
|
|
202
|
+
allowedDomains = toArray(allowedDomainsRaw);
|
|
203
|
+
}
|
|
204
|
+
let userLocation;
|
|
205
|
+
if (webSearchOptions.country || webSearchOptions.city || webSearchOptions.region) {
|
|
206
|
+
userLocation = {
|
|
207
|
+
type: "approximate",
|
|
208
|
+
country: webSearchOptions.country,
|
|
209
|
+
city: webSearchOptions.city,
|
|
210
|
+
region: webSearchOptions.region
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
newTools.push(
|
|
214
|
+
removeEmptyProperties({
|
|
215
|
+
type: "web_search",
|
|
216
|
+
search_context_size: (0, import_get.default)(webSearchOptions, "searchContextSize", "medium"),
|
|
217
|
+
user_location: userLocation,
|
|
218
|
+
...allowedDomains && { filters: { allowed_domains: allowedDomains } }
|
|
219
|
+
})
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
const mcpServers = (0, import_get.default)(builtInTools.mcpServers, "mcpServerOptions");
|
|
223
|
+
if (Array.isArray(mcpServers) && mcpServers.length) {
|
|
224
|
+
for (const mcpServer of mcpServers) {
|
|
225
|
+
let allowedTools;
|
|
226
|
+
const allowedToolsRaw = (0, import_get.default)(mcpServer, "allowedTools", "");
|
|
227
|
+
if (allowedToolsRaw) {
|
|
228
|
+
allowedTools = toArray(allowedToolsRaw);
|
|
229
|
+
}
|
|
230
|
+
const headersRaw = (0, import_get.default)(mcpServer, "headers", "");
|
|
231
|
+
newTools.push(
|
|
232
|
+
removeEmptyProperties({
|
|
233
|
+
type: "mcp",
|
|
234
|
+
server_label: mcpServer.serverLabel,
|
|
235
|
+
server_url: mcpServer.serverUrl,
|
|
236
|
+
connector_id: mcpServer.connectorId,
|
|
237
|
+
authorization: mcpServer.authorization,
|
|
238
|
+
allowed_tools: allowedTools,
|
|
239
|
+
headers: headersRaw ? (0, import_n8n_workflow.jsonParse)(headersRaw, { errorMessage: "Failed to parse headers" }) : void 0,
|
|
240
|
+
require_approval: "never",
|
|
241
|
+
server_description: mcpServer.serverDescription
|
|
242
|
+
})
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (builtInTools.codeInterpreter) {
|
|
247
|
+
newTools.push({
|
|
248
|
+
type: "code_interpreter",
|
|
249
|
+
container: {
|
|
250
|
+
type: "auto"
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (builtInTools.fileSearch) {
|
|
255
|
+
const vectorStoreIds = (0, import_get.default)(builtInTools.fileSearch, "vectorStoreIds", "[]");
|
|
256
|
+
const filters = (0, import_get.default)(builtInTools.fileSearch, "filters", "{}");
|
|
257
|
+
newTools.push(
|
|
258
|
+
removeEmptyProperties({
|
|
259
|
+
type: "file_search",
|
|
260
|
+
vector_store_ids: (0, import_n8n_workflow.jsonParse)(vectorStoreIds, {
|
|
261
|
+
errorMessage: "Failed to parse vector store IDs"
|
|
262
|
+
}),
|
|
263
|
+
filters: filters ? (0, import_n8n_workflow.jsonParse)(filters, { errorMessage: "Failed to parse filters" }) : void 0,
|
|
264
|
+
max_num_results: (0, import_get.default)(builtInTools.fileSearch, "maxResults")
|
|
265
|
+
})
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
body.tools = newTools;
|
|
269
|
+
}
|
|
270
|
+
return await removeEmptyProperties(body);
|
|
271
|
+
}
|
|
272
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
273
|
+
0 && (module.exports = {
|
|
274
|
+
createRequest,
|
|
275
|
+
formatInputMessages
|
|
276
|
+
});
|
|
277
|
+
//# sourceMappingURL=responses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../nodes/vendors/OpenAi/v2/actions/text/helpers/responses.ts"],"sourcesContent":["import type { OpenAIClient } from '@langchain/openai';\nimport get from 'lodash/get';\nimport isObject from 'lodash/isObject';\nimport { isObjectEmpty, jsonParse, type IDataObject, type IExecuteFunctions } from 'n8n-workflow';\nimport type { ResponseInputImage } from 'openai/resources/responses/responses';\n\nimport { getBinaryDataFile } from '../../../../helpers/binary-data';\nimport type {\n\tChatContent,\n\tChatInputItem,\n\tChatResponseRequest,\n} from '../../../../helpers/interfaces';\n\nconst toArray = (str: string) => str.split(',').map((e) => e.trim());\n\nconst removeEmptyProperties = <T>(rest: { [key: string]: any }): T => {\n\treturn Object.keys(rest)\n\t\t.filter(\n\t\t\t(k) =>\n\t\t\t\trest[k] !== '' && rest[k] !== undefined && !(isObject(rest[k]) && isObjectEmpty(rest[k])),\n\t\t)\n\t\t.reduce((a, k) => ({ ...a, [k]: rest[k] }), {}) as unknown as T;\n};\n\nexport async function formatInputMessages(\n\tthis: IExecuteFunctions,\n\ti: number,\n\tmessages: IDataObject[],\n) {\n\treturn await Promise.all(\n\t\tmessages.map<Promise<ChatInputItem>>(async (message) => {\n\t\t\tconst role = message.role as ChatInputItem['role'];\n\t\t\tlet content: ChatContent = [];\n\t\t\tif (message.type === 'text' || !message.type) {\n\t\t\t\tcontent = [{ type: 'input_text', text: message.content as string }];\n\t\t\t} else if (message.type === 'image') {\n\t\t\t\tconst detail = (message.imageDetail as ResponseInputImage['detail']) || ('auto' as const);\n\n\t\t\t\tif (message.imageType === 'base64') {\n\t\t\t\t\tconst { fileContent, contentType } = await getBinaryDataFile(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\tmessage.binaryPropertyName as string,\n\t\t\t\t\t);\n\t\t\t\t\tconst buffer = await this.helpers.binaryToBuffer(fileContent);\n\t\t\t\t\tcontent = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'input_image',\n\t\t\t\t\t\t\tdetail,\n\t\t\t\t\t\t\timage_url: `data:${contentType};base64,${buffer.toString('base64')}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\tcontent = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'input_image',\n\t\t\t\t\t\t\tdetail,\n\t\t\t\t\t\t\t...(message.imageType === 'url' && { image_url: message.imageUrl as string }),\n\t\t\t\t\t\t\t...(message.imageType === 'fileId' && { file_id: message.fileId as string }),\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else if (message.type === 'file') {\n\t\t\t\tif (message.fileType === 'base64') {\n\t\t\t\t\tconst { fileContent, contentType } = await getBinaryDataFile(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\tmessage.binaryPropertyName as string,\n\t\t\t\t\t);\n\t\t\t\t\tconst buffer = await this.helpers.binaryToBuffer(fileContent);\n\t\t\t\t\tcontent = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'input_file',\n\t\t\t\t\t\t\tfilename: message.fileName as string,\n\t\t\t\t\t\t\tfile_data: `data:${contentType};base64,${buffer.toString('base64')}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\tcontent = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'input_file',\n\t\t\t\t\t\t\t...(message.fileType === 'url' && { file_url: message.fileUrl as string }),\n\t\t\t\t\t\t\t...(message.fileType === 'fileId' && { file_id: message.fileId as string }),\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn { role, content };\n\t\t}),\n\t);\n}\n\ninterface CreateRequestOptions {\n\tmodel: string;\n\tmessages: IDataObject[];\n\toptions: IDataObject;\n\tbuiltInTools?: IDataObject;\n\ttools?: OpenAIClient.Responses.FunctionTool[];\n}\n\nexport async function createRequest(\n\tthis: IExecuteFunctions,\n\ti: number,\n\t{ model, messages, options, builtInTools, tools }: CreateRequestOptions,\n): Promise<ChatResponseRequest> {\n\tconst body: ChatResponseRequest = {\n\t\tmodel,\n\t\tinput: await formatInputMessages.call(this, i, messages),\n\t\tparallel_tool_calls: get(options, 'parallelToolCalls', true) as boolean,\n\t\tstore: get(options, 'store', true) as boolean,\n\t\tinstructions: options.instructions as string,\n\t\tmax_output_tokens: options.maxTokens as number,\n\t\tprevious_response_id: options.previousResponseId as string,\n\t\tprompt_cache_key: options.promptCacheKey as string,\n\t\tsafety_identifier: options.safetyIdentifier as string,\n\t\tservice_tier: options.serviceTier as ChatResponseRequest['service_tier'],\n\t\ttemperature: options.temperature as number,\n\t\ttop_p: options.topP as number,\n\t\ttop_logprobs: options.topLogprobs as number,\n\t\ttools,\n\t\tmax_tool_calls: options.maxToolCalls as number,\n\t\tbackground: get(options, 'backgroundMode.values.enabled', false) as boolean,\n\t};\n\n\tif (options.truncation !== undefined) {\n\t\tbody.truncation = !!options.truncation ? 'auto' : 'disabled';\n\t}\n\n\tif (options.conversationId) {\n\t\tbody.conversation = options.conversationId as string;\n\t}\n\n\tif (Array.isArray(options.include) && options.include?.length) {\n\t\tbody.include = options.include as ChatResponseRequest['include'];\n\t}\n\n\tif (options.metadata) {\n\t\tbody.metadata = jsonParse(options.metadata as string, {\n\t\t\terrorMessage: 'Failed to parse metadata',\n\t\t});\n\t}\n\n\tif (options.promptConfig) {\n\t\tconst prompt = get(options, 'promptConfig.promptOptions') as IDataObject;\n\t\tbody.prompt = removeEmptyProperties({\n\t\t\tid: prompt.promptId,\n\t\t\tversion: prompt.version,\n\t\t\t...(prompt.variables && {\n\t\t\t\tvariables: jsonParse(prompt.variables as string, {\n\t\t\t\t\terrorMessage: 'Failed to parse prompt variables',\n\t\t\t\t}),\n\t\t\t}),\n\t\t});\n\t}\n\n\tif (options.reasoning) {\n\t\tconst reasoning = get(options, 'reasoning.reasoningOptions') as IDataObject;\n\t\tbody.reasoning = removeEmptyProperties({\n\t\t\teffort: reasoning.effort,\n\t\t\tsummary: reasoning.summary && reasoning.summary !== 'none' ? reasoning.summary : undefined,\n\t\t});\n\t}\n\n\tif (options.textFormat) {\n\t\tconst textOptions = get(options, 'textFormat.textOptions') as IDataObject;\n\t\tconst textConfig: OpenAIClient.Responses.ResponseTextConfig = {\n\t\t\tverbosity: textOptions.verbosity as OpenAIClient.Responses.ResponseTextConfig['verbosity'],\n\t\t};\n\t\tif (textOptions.type === 'json_schema') {\n\t\t\ttextConfig.format = {\n\t\t\t\ttype: textOptions.type,\n\t\t\t\tname: textOptions.name as string,\n\t\t\t\tschema: jsonParse(textOptions.schema as string, {\n\t\t\t\t\terrorMessage: 'Failed to parse schema',\n\t\t\t\t}),\n\t\t\t};\n\t\t} else if (textOptions.type === 'json_object') {\n\t\t\ttextConfig.format = {\n\t\t\t\ttype: textOptions.type,\n\t\t\t};\n\t\t\tbody.input = [\n\t\t\t\t{\n\t\t\t\t\trole: 'system',\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{ type: 'input_text', text: 'You are a helpful assistant designed to output JSON.' },\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t...body.input,\n\t\t\t];\n\t\t} else if (textOptions.type === 'text') {\n\t\t\ttextConfig.format = {\n\t\t\t\ttype: textOptions.type,\n\t\t\t};\n\t\t}\n\n\t\tif (textConfig.format) {\n\t\t\ttextConfig.format = removeEmptyProperties(textConfig.format);\n\t\t}\n\n\t\tbody.text = textConfig;\n\t}\n\n\tif (builtInTools) {\n\t\tconst newTools = body.tools ?? [];\n\n\t\tconst webSearchOptions = get(builtInTools, 'webSearch') as IDataObject | undefined;\n\t\tif (webSearchOptions) {\n\t\t\tlet allowedDomains: string[] | undefined;\n\t\t\tconst allowedDomainsRaw = get(webSearchOptions, 'allowedDomains', '') as string;\n\t\t\tif (allowedDomainsRaw) {\n\t\t\t\tallowedDomains = toArray(allowedDomainsRaw);\n\t\t\t}\n\n\t\t\tlet userLocation: OpenAIClient.Responses.WebSearchTool.UserLocation | undefined;\n\t\t\tif (webSearchOptions.country || webSearchOptions.city || webSearchOptions.region) {\n\t\t\t\tuserLocation = {\n\t\t\t\t\ttype: 'approximate',\n\t\t\t\t\tcountry: webSearchOptions.country as string,\n\t\t\t\t\tcity: webSearchOptions.city as string,\n\t\t\t\t\tregion: webSearchOptions.region as string,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tnewTools.push(\n\t\t\t\tremoveEmptyProperties({\n\t\t\t\t\ttype: 'web_search',\n\t\t\t\t\tsearch_context_size: get(webSearchOptions, 'searchContextSize', 'medium') as\n\t\t\t\t\t\t| 'low'\n\t\t\t\t\t\t| 'medium'\n\t\t\t\t\t\t| 'high',\n\t\t\t\t\tuser_location: userLocation,\n\t\t\t\t\t...(allowedDomains && { filters: { allowed_domains: allowedDomains } }),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tconst mcpServers = get(builtInTools.mcpServers, 'mcpServerOptions') as\n\t\t\t| IDataObject[]\n\t\t\t| undefined;\n\t\tif (Array.isArray(mcpServers) && mcpServers.length) {\n\t\t\tfor (const mcpServer of mcpServers) {\n\t\t\t\tlet allowedTools: string[] | undefined;\n\t\t\t\tconst allowedToolsRaw = get(mcpServer, 'allowedTools', '') as string;\n\t\t\t\tif (allowedToolsRaw) {\n\t\t\t\t\tallowedTools = toArray(allowedToolsRaw);\n\t\t\t\t}\n\n\t\t\t\tconst headersRaw = get(mcpServer, 'headers', '') as string;\n\n\t\t\t\tnewTools.push(\n\t\t\t\t\tremoveEmptyProperties({\n\t\t\t\t\t\ttype: 'mcp',\n\t\t\t\t\t\tserver_label: mcpServer.serverLabel as string,\n\t\t\t\t\t\tserver_url: mcpServer.serverUrl as string,\n\t\t\t\t\t\tconnector_id: mcpServer.connectorId as string,\n\t\t\t\t\t\tauthorization: mcpServer.authorization as string,\n\t\t\t\t\t\tallowed_tools: allowedTools,\n\t\t\t\t\t\theaders: headersRaw\n\t\t\t\t\t\t\t? jsonParse(headersRaw, { errorMessage: 'Failed to parse headers' })\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\trequire_approval: 'never',\n\t\t\t\t\t\tserver_description: mcpServer.serverDescription as string,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (builtInTools.codeInterpreter) {\n\t\t\tnewTools.push({\n\t\t\t\ttype: 'code_interpreter',\n\t\t\t\tcontainer: {\n\t\t\t\t\ttype: 'auto',\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tif (builtInTools.fileSearch) {\n\t\t\tconst vectorStoreIds = get(builtInTools.fileSearch, 'vectorStoreIds', '[]') as string;\n\t\t\tconst filters = get(builtInTools.fileSearch, 'filters', '{}') as string;\n\t\t\tnewTools.push(\n\t\t\t\tremoveEmptyProperties({\n\t\t\t\t\ttype: 'file_search',\n\t\t\t\t\tvector_store_ids: jsonParse(vectorStoreIds, {\n\t\t\t\t\t\terrorMessage: 'Failed to parse vector store IDs',\n\t\t\t\t\t}),\n\t\t\t\t\tfilters: filters\n\t\t\t\t\t\t? jsonParse(filters, { errorMessage: 'Failed to parse filters' })\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tmax_num_results: get(builtInTools.fileSearch, 'maxResults') as number,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tbody.tools = newTools;\n\t}\n\n\treturn await removeEmptyProperties(body);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAgB;AAChB,sBAAqB;AACrB,0BAAmF;AAGnF,yBAAkC;AAOlC,MAAM,UAAU,CAAC,QAAgB,IAAI,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAEnE,MAAM,wBAAwB,CAAI,SAAoC;AACrE,SAAO,OAAO,KAAK,IAAI,EACrB;AAAA,IACA,CAAC,MACA,KAAK,CAAC,MAAM,MAAM,KAAK,CAAC,MAAM,UAAa,MAAE,gBAAAA,SAAS,KAAK,CAAC,CAAC,SAAK,mCAAc,KAAK,CAAC,CAAC;AAAA,EACzF,EACC,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAChD;AAEA,eAAsB,oBAErB,GACA,UACC;AACD,SAAO,MAAM,QAAQ;AAAA,IACpB,SAAS,IAA4B,OAAO,YAAY;AACvD,YAAM,OAAO,QAAQ;AACrB,UAAI,UAAuB,CAAC;AAC5B,UAAI,QAAQ,SAAS,UAAU,CAAC,QAAQ,MAAM;AAC7C,kBAAU,CAAC,EAAE,MAAM,cAAc,MAAM,QAAQ,QAAkB,CAAC;AAAA,MACnE,WAAW,QAAQ,SAAS,SAAS;AACpC,cAAM,SAAU,QAAQ,eAAiD;AAEzE,YA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;AAC5B,YAAM,qBAAiB,WAAAA,SAAI,aAAa,YAAY,kBAAkB,IAAI;AAC1E,YAAM,cAAU,WAAAA,SAAI,aAAa,YAAY,WAAW,IAAI;AAC5D,eAAS;AAAA,QACR,sBAAsB;AAAA,UACrB,MAAM;AAAA,UACN,sBAAkB,+BAAU,gBAAgB;AAAA,YAC3C,cAAc;AAAA,UACf,CAAC;AAAA,UACD,SAAS,cACN,+BAAU,SAAS,EAAE,cAAc,0BAA0B,CAAC,IAC9D;AAAA,UACH,qBAAiB,WAAAA,SAAI,aAAa,YAAY,YAAY;AAAA,QAC3D,CAAC;AAAA,MACF;AAAA,IACD;AAEA,SAAK,QAAQ;AAAA,EACd;AAEA,SAAO,MAAM,sBAAsB,IAAI;AACxC;","names":["isObject","get"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var text_exports = {};
|
|
30
|
+
__export(text_exports, {
|
|
31
|
+
classify: () => classify,
|
|
32
|
+
description: () => description,
|
|
33
|
+
message: () => message,
|
|
34
|
+
response: () => response
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(text_exports);
|
|
37
|
+
var classify = __toESM(require("./classify.operation"));
|
|
38
|
+
var message = __toESM(require("./message.operation"));
|
|
39
|
+
var response = __toESM(require("./response.operation"));
|
|
40
|
+
const description = [
|
|
41
|
+
{
|
|
42
|
+
displayName: "Operation",
|
|
43
|
+
name: "operation",
|
|
44
|
+
type: "options",
|
|
45
|
+
noDataExpression: true,
|
|
46
|
+
options: [
|
|
47
|
+
{
|
|
48
|
+
name: "Generate a Model Response",
|
|
49
|
+
value: "response",
|
|
50
|
+
action: "Generate a model response",
|
|
51
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period, n8n-nodes-base/node-param-description-missing-final-period
|
|
52
|
+
description: "Generate a model response with GPT 3, 4, 5, etc. using Responses API"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "Generate a Chat Completion",
|
|
56
|
+
value: "message",
|
|
57
|
+
action: "Generate a chat completion",
|
|
58
|
+
// eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period, n8n-nodes-base/node-param-description-missing-final-period
|
|
59
|
+
description: "Create a completion with GPT 3, 4, 5, etc. using Completions API"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "Classify Text for Violations",
|
|
63
|
+
value: "classify",
|
|
64
|
+
action: "Classify text for violations",
|
|
65
|
+
description: "Check whether content complies with usage policies"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
default: "response",
|
|
69
|
+
displayOptions: {
|
|
70
|
+
show: {
|
|
71
|
+
resource: ["text"]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
...classify.description,
|
|
76
|
+
...message.description,
|
|
77
|
+
...response.description
|
|
78
|
+
];
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
classify,
|
|
82
|
+
description,
|
|
83
|
+
message,
|
|
84
|
+
response
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/text/index.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as classify from './classify.operation';\nimport * as message from './message.operation';\nimport * as response from './response.operation';\n\nexport { classify, message, response };\n\nexport const description: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Generate a Model Response',\n\t\t\t\tvalue: 'response',\n\t\t\t\taction: 'Generate a model response',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period, n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'Generate a model response with GPT 3, 4, 5, etc. using Responses API',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Generate a Chat Completion',\n\t\t\t\tvalue: 'message',\n\t\t\t\taction: 'Generate a chat completion',\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period, n8n-nodes-base/node-param-description-missing-final-period\n\t\t\t\tdescription: 'Create a completion with GPT 3, 4, 5, etc. using Completions API',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Classify Text for Violations',\n\t\t\t\tvalue: 'classify',\n\t\t\t\taction: 'Classify text for violations',\n\t\t\t\tdescription: 'Check whether content complies with usage policies',\n\t\t\t},\n\t\t],\n\t\tdefault: 'response',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['text'],\n\t\t\t},\n\t\t},\n\t},\n\n\t...classify.description,\n\t...message.description,\n\t...response.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAA0B;AAC1B,cAAyB;AACzB,eAA0B;AAInB,MAAM,cAAiC;AAAA,EAC7C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA;AAAA,QAER,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA;AAAA,QAER,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,aAAa;AAAA,MACd;AAAA,IACD;AAAA,IACA,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,MAAM;AAAA,MAClB;AAAA,IACD;AAAA,EACD;AAAA,EAEA,GAAG,SAAS;AAAA,EACZ,GAAG,QAAQ;AAAA,EACX,GAAG,SAAS;AACb;","names":[]}
|