@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,777 @@
|
|
|
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 response_operation_exports = {};
|
|
30
|
+
__export(response_operation_exports, {
|
|
31
|
+
description: () => description,
|
|
32
|
+
execute: () => execute
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(response_operation_exports);
|
|
35
|
+
var import_helpers = require("../../../../../../utils/helpers");
|
|
36
|
+
var import_get = __toESM(require("lodash/get"));
|
|
37
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
38
|
+
var import_constants = require("../../../helpers/constants");
|
|
39
|
+
var import_utils = require("../../../helpers/utils");
|
|
40
|
+
var import_polling = require("../../../helpers/polling");
|
|
41
|
+
var import_transport = require("../../../transport");
|
|
42
|
+
var import_descriptions = require("../descriptions");
|
|
43
|
+
var import_responses = require("./helpers/responses");
|
|
44
|
+
const properties = [
|
|
45
|
+
(0, import_descriptions.modelRLC)("modelSearch"),
|
|
46
|
+
{
|
|
47
|
+
displayName: "Messages",
|
|
48
|
+
name: "responses",
|
|
49
|
+
type: "fixedCollection",
|
|
50
|
+
typeOptions: {
|
|
51
|
+
sortable: true,
|
|
52
|
+
multipleValues: true
|
|
53
|
+
},
|
|
54
|
+
placeholder: "Add Message",
|
|
55
|
+
default: { values: [{ type: "text" }] },
|
|
56
|
+
options: import_descriptions.messageOptions
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: "Simplify Output",
|
|
60
|
+
name: "simplify",
|
|
61
|
+
type: "boolean",
|
|
62
|
+
default: true,
|
|
63
|
+
description: "Whether to return a simplified version of the response instead of the raw data"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: "Hide Tools",
|
|
67
|
+
name: "hideTools",
|
|
68
|
+
type: "hidden",
|
|
69
|
+
default: "hide",
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
modelId: import_constants.MODELS_NOT_SUPPORT_FUNCTION_CALLS
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: "Connect your own custom n8n tools to this node on the canvas",
|
|
78
|
+
name: "noticeTools",
|
|
79
|
+
type: "notice",
|
|
80
|
+
default: "",
|
|
81
|
+
displayOptions: {
|
|
82
|
+
hide: {
|
|
83
|
+
hideTools: ["hide"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
displayName: "Built-in Tools",
|
|
89
|
+
name: "builtInTools",
|
|
90
|
+
placeholder: "Add Built-in Tool",
|
|
91
|
+
type: "collection",
|
|
92
|
+
default: {},
|
|
93
|
+
options: [
|
|
94
|
+
{
|
|
95
|
+
displayName: "Web Search",
|
|
96
|
+
name: "webSearch",
|
|
97
|
+
type: "collection",
|
|
98
|
+
default: { searchContextSize: "medium" },
|
|
99
|
+
options: [
|
|
100
|
+
{
|
|
101
|
+
displayName: "Search Context Size",
|
|
102
|
+
name: "searchContextSize",
|
|
103
|
+
type: "options",
|
|
104
|
+
default: "medium",
|
|
105
|
+
options: [
|
|
106
|
+
{ name: "Low", value: "low" },
|
|
107
|
+
{ name: "Medium", value: "medium" },
|
|
108
|
+
{ name: "High", value: "high" }
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
displayName: "Web Search Allowed Domains",
|
|
113
|
+
name: "allowedDomains",
|
|
114
|
+
type: "string",
|
|
115
|
+
default: "",
|
|
116
|
+
description: "Comma-separated list of domains to search. Only domains in this list will be searched.",
|
|
117
|
+
placeholder: "e.g. google.com, wikipedia.org"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
displayName: "Country",
|
|
121
|
+
name: "country",
|
|
122
|
+
type: "string",
|
|
123
|
+
default: "",
|
|
124
|
+
placeholder: "e.g. US, GB"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: "City",
|
|
128
|
+
name: "city",
|
|
129
|
+
type: "string",
|
|
130
|
+
default: "",
|
|
131
|
+
placeholder: "e.g. New York, London"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
displayName: "Region",
|
|
135
|
+
name: "region",
|
|
136
|
+
type: "string",
|
|
137
|
+
default: "",
|
|
138
|
+
placeholder: "e.g. New York, London"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: "MCP Servers",
|
|
144
|
+
name: "mcpServers",
|
|
145
|
+
type: "fixedCollection",
|
|
146
|
+
placeholder: "Add MCP Server",
|
|
147
|
+
typeOptions: {
|
|
148
|
+
multipleValues: true,
|
|
149
|
+
sortable: true
|
|
150
|
+
},
|
|
151
|
+
default: { mcpServerOptions: [{ serverLabel: "" }] },
|
|
152
|
+
options: [
|
|
153
|
+
{
|
|
154
|
+
displayName: "MCP Server",
|
|
155
|
+
name: "mcpServerOptions",
|
|
156
|
+
values: [
|
|
157
|
+
{
|
|
158
|
+
displayName: "Server Label",
|
|
159
|
+
name: "serverLabel",
|
|
160
|
+
type: "string",
|
|
161
|
+
default: "",
|
|
162
|
+
description: "A label to identify this MCP server",
|
|
163
|
+
placeholder: "e.g. My Database Server"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: "Connection Type",
|
|
167
|
+
name: "connectionType",
|
|
168
|
+
type: "options",
|
|
169
|
+
default: "url",
|
|
170
|
+
options: [
|
|
171
|
+
{ name: "URL", value: "url" },
|
|
172
|
+
{ name: "Connector ID", value: "connector_id" }
|
|
173
|
+
],
|
|
174
|
+
description: "Choose how to connect to the MCP server"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
displayName: "Server URL",
|
|
178
|
+
name: "serverUrl",
|
|
179
|
+
type: "string",
|
|
180
|
+
default: "",
|
|
181
|
+
description: "The URL of the MCP server",
|
|
182
|
+
placeholder: "e.g. https://api.example.com/mcp",
|
|
183
|
+
displayOptions: {
|
|
184
|
+
show: {
|
|
185
|
+
connectionType: ["url"]
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
displayName: "Connector ID",
|
|
191
|
+
name: "connectorId",
|
|
192
|
+
type: "string",
|
|
193
|
+
default: "",
|
|
194
|
+
description: "The connector ID for the MCP server",
|
|
195
|
+
placeholder: "e.g. connector_gmail",
|
|
196
|
+
displayOptions: {
|
|
197
|
+
show: {
|
|
198
|
+
connectionType: ["connector_id"]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
displayName: "Authorization",
|
|
204
|
+
name: "authorization",
|
|
205
|
+
type: "string",
|
|
206
|
+
default: "",
|
|
207
|
+
description: "Authorization token or credentials for the MCP server"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: "Headers",
|
|
211
|
+
name: "headers",
|
|
212
|
+
type: "json",
|
|
213
|
+
default: "{}",
|
|
214
|
+
description: "Additional headers to send with requests to the MCP server",
|
|
215
|
+
placeholder: '{"X-Custom-Header": "value"}'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
displayName: "Server Description",
|
|
219
|
+
name: "serverDescription",
|
|
220
|
+
type: "string",
|
|
221
|
+
default: "",
|
|
222
|
+
description: "A description of what this MCP server provides",
|
|
223
|
+
placeholder: "e.g. Database access for user management",
|
|
224
|
+
typeOptions: {
|
|
225
|
+
rows: 2
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
displayName: "Allowed Tools",
|
|
230
|
+
name: "allowedTools",
|
|
231
|
+
type: "string",
|
|
232
|
+
default: "",
|
|
233
|
+
description: "Comma-separated list of tools to allow. If not provided, all tools will be allowed.",
|
|
234
|
+
placeholder: "e.g. tool1,tool2"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
displayName: "File Search",
|
|
242
|
+
name: "fileSearch",
|
|
243
|
+
type: "collection",
|
|
244
|
+
default: { vectorStoreIds: "[]" },
|
|
245
|
+
options: [
|
|
246
|
+
{
|
|
247
|
+
displayName: "Vector Store IDs",
|
|
248
|
+
name: "vectorStoreIds",
|
|
249
|
+
type: "json",
|
|
250
|
+
default: "[]",
|
|
251
|
+
required: true
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
displayName: "Filters",
|
|
255
|
+
name: "filters",
|
|
256
|
+
type: "json",
|
|
257
|
+
default: "{}"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
displayName: "Max Results",
|
|
261
|
+
name: "maxResults",
|
|
262
|
+
type: "number",
|
|
263
|
+
default: 1,
|
|
264
|
+
typeOptions: { minValue: 1, maxValue: 50 }
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
displayName: "Code Interpreter",
|
|
270
|
+
name: "codeInterpreter",
|
|
271
|
+
type: "boolean",
|
|
272
|
+
default: true,
|
|
273
|
+
description: "Whether to allow the model to execute code in a local environment"
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
displayName: "Options",
|
|
279
|
+
name: "options",
|
|
280
|
+
placeholder: "Add Option",
|
|
281
|
+
type: "collection",
|
|
282
|
+
default: {},
|
|
283
|
+
options: [
|
|
284
|
+
{
|
|
285
|
+
displayName: "Conversation ID",
|
|
286
|
+
name: "conversationId",
|
|
287
|
+
default: "",
|
|
288
|
+
description: "The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes.",
|
|
289
|
+
type: "string"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: "Include Additional Data",
|
|
293
|
+
name: "include",
|
|
294
|
+
default: [],
|
|
295
|
+
type: "multiOptions",
|
|
296
|
+
description: "Specify additional output data to include in the model response",
|
|
297
|
+
options: [
|
|
298
|
+
{
|
|
299
|
+
name: "Code Interpreter Call Outputs",
|
|
300
|
+
value: "code_interpreter_call.outputs"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "Computer Call Output Image URL",
|
|
304
|
+
value: "computer_call_output.output.image_url"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: "File Search Call Results",
|
|
308
|
+
value: "file_search_call.results"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "Message Input Image URL",
|
|
312
|
+
value: "message.input_image.image_url"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "Message Output Text Logprobs",
|
|
316
|
+
value: "message.output_text.logprobs"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: "Reasoning Encrypted Content",
|
|
320
|
+
value: "reasoning.encrypted_content"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: "Web Search Tool Call Sources",
|
|
324
|
+
value: "web_search_call.action.sources"
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
displayName: "Instructions",
|
|
330
|
+
name: "instructions",
|
|
331
|
+
type: "string",
|
|
332
|
+
default: "",
|
|
333
|
+
description: "Instructions for the model to follow",
|
|
334
|
+
typeOptions: {
|
|
335
|
+
rows: 2
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
displayName: "Maximum Number of Tokens",
|
|
340
|
+
name: "maxTokens",
|
|
341
|
+
default: 16,
|
|
342
|
+
description: "The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).",
|
|
343
|
+
type: "number",
|
|
344
|
+
typeOptions: {
|
|
345
|
+
maxValue: 32768
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
displayName: "Max Tool Calls Iterations",
|
|
350
|
+
name: "maxToolsIterations",
|
|
351
|
+
type: "number",
|
|
352
|
+
default: 15,
|
|
353
|
+
description: "The maximum number of tool iteration cycles the LLM will run before stopping. A single iteration can contain multiple tool calls. Set to 0 for no limit."
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
displayName: "Max Built-in Tool Calls",
|
|
357
|
+
name: "maxToolCalls",
|
|
358
|
+
type: "number",
|
|
359
|
+
default: 15,
|
|
360
|
+
description: "The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored."
|
|
361
|
+
},
|
|
362
|
+
import_descriptions.metadataProperty,
|
|
363
|
+
{
|
|
364
|
+
displayName: "Parallel Tool Calls",
|
|
365
|
+
name: "parallelToolCalls",
|
|
366
|
+
type: "boolean",
|
|
367
|
+
default: false,
|
|
368
|
+
description: "Whether to allow parallel tool calls. If true, the model can call multiple tools at once."
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
displayName: "Previous Response ID",
|
|
372
|
+
name: "previousResponseId",
|
|
373
|
+
type: "string",
|
|
374
|
+
default: "",
|
|
375
|
+
// TODO: add display options?
|
|
376
|
+
description: "The ID of the previous response to continue from. Cannot be used in conjunction with Conversation ID."
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: "Prompt",
|
|
380
|
+
name: "promptConfig",
|
|
381
|
+
type: "fixedCollection",
|
|
382
|
+
default: { promptOptions: [{ promptId: "" }] },
|
|
383
|
+
options: [
|
|
384
|
+
{
|
|
385
|
+
displayName: "Prompt",
|
|
386
|
+
name: "promptOptions",
|
|
387
|
+
values: [
|
|
388
|
+
{
|
|
389
|
+
displayName: "Prompt ID",
|
|
390
|
+
name: "promptId",
|
|
391
|
+
type: "string",
|
|
392
|
+
default: "",
|
|
393
|
+
description: "The unique identifier of the prompt template to use"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
displayName: "Version",
|
|
397
|
+
name: "version",
|
|
398
|
+
type: "string",
|
|
399
|
+
default: "",
|
|
400
|
+
description: "Optional version of the prompt template"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
displayName: "Variables",
|
|
404
|
+
name: "variables",
|
|
405
|
+
type: "json",
|
|
406
|
+
default: "{}",
|
|
407
|
+
description: "Variables to be substituted into the prompt template"
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
displayName: "Prompt Cache Key",
|
|
415
|
+
name: "promptCacheKey",
|
|
416
|
+
type: "string",
|
|
417
|
+
default: "",
|
|
418
|
+
description: "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
displayName: "Reasoning",
|
|
422
|
+
name: "reasoning",
|
|
423
|
+
type: "fixedCollection",
|
|
424
|
+
default: { reasoningOptions: [{ effort: "medium", summary: "none" }] },
|
|
425
|
+
options: [
|
|
426
|
+
{
|
|
427
|
+
displayName: "Reasoning",
|
|
428
|
+
name: "reasoningOptions",
|
|
429
|
+
values: [
|
|
430
|
+
{
|
|
431
|
+
displayName: "Effort",
|
|
432
|
+
name: "effort",
|
|
433
|
+
type: "options",
|
|
434
|
+
default: "medium",
|
|
435
|
+
// TODO: allow only high for gpt-5-pro
|
|
436
|
+
options: [
|
|
437
|
+
{ name: "Low", value: "low" },
|
|
438
|
+
{ name: "Medium", value: "medium" },
|
|
439
|
+
{ name: "High", value: "high" }
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
displayName: "Summary",
|
|
444
|
+
name: "summary",
|
|
445
|
+
type: "options",
|
|
446
|
+
default: "auto",
|
|
447
|
+
description: "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process.",
|
|
448
|
+
options: [
|
|
449
|
+
{ name: "None", value: "none" },
|
|
450
|
+
{ name: "Auto", value: "auto" },
|
|
451
|
+
{ name: "Concise", value: "concise" },
|
|
452
|
+
{ name: "Detailed", value: "detailed" }
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
displayName: "Safety Identifier",
|
|
461
|
+
name: "safetyIdentifier",
|
|
462
|
+
type: "string",
|
|
463
|
+
default: "",
|
|
464
|
+
description: "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user."
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
displayName: "Service Tier",
|
|
468
|
+
name: "serviceTier",
|
|
469
|
+
type: "options",
|
|
470
|
+
default: "auto",
|
|
471
|
+
description: "The service tier to use for the request",
|
|
472
|
+
options: [
|
|
473
|
+
{ name: "Auto", value: "auto" },
|
|
474
|
+
{ name: "Flex", value: "flex" },
|
|
475
|
+
{ name: "Default", value: "default" },
|
|
476
|
+
{ name: "Priority", value: "priority" }
|
|
477
|
+
]
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
displayName: "Store",
|
|
481
|
+
name: "store",
|
|
482
|
+
type: "boolean",
|
|
483
|
+
default: true,
|
|
484
|
+
description: "Whether to store the generated model response for later retrieval via API"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
displayName: "Output Format",
|
|
488
|
+
name: "textFormat",
|
|
489
|
+
type: "fixedCollection",
|
|
490
|
+
default: { textOptions: [{ type: "text" }] },
|
|
491
|
+
options: [
|
|
492
|
+
{
|
|
493
|
+
displayName: "Text",
|
|
494
|
+
name: "textOptions",
|
|
495
|
+
values: [
|
|
496
|
+
{
|
|
497
|
+
displayName: "Type",
|
|
498
|
+
name: "type",
|
|
499
|
+
type: "options",
|
|
500
|
+
default: "text",
|
|
501
|
+
options: [
|
|
502
|
+
{ name: "Text", value: "text" },
|
|
503
|
+
{ name: "JSON Schema(recommended)", value: "json_schema" },
|
|
504
|
+
{ name: "JSON Object", value: "json_object" }
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
displayName: "Verbosity",
|
|
509
|
+
name: "verbosity",
|
|
510
|
+
type: "options",
|
|
511
|
+
default: "medium",
|
|
512
|
+
options: [
|
|
513
|
+
{ name: "Low", value: "low" },
|
|
514
|
+
{ name: "Medium", value: "medium" },
|
|
515
|
+
{ name: "High", value: "high" }
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
displayName: "Name",
|
|
520
|
+
name: "name",
|
|
521
|
+
type: "string",
|
|
522
|
+
default: "",
|
|
523
|
+
description: "The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.",
|
|
524
|
+
displayOptions: {
|
|
525
|
+
show: {
|
|
526
|
+
type: ["json_schema"]
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
displayName: "Schema",
|
|
532
|
+
name: "schema",
|
|
533
|
+
type: "json",
|
|
534
|
+
default: "",
|
|
535
|
+
description: "The schema of the response format",
|
|
536
|
+
displayOptions: {
|
|
537
|
+
show: {
|
|
538
|
+
type: ["json_schema"]
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
displayName: "Description",
|
|
544
|
+
name: "description",
|
|
545
|
+
type: "string",
|
|
546
|
+
default: "",
|
|
547
|
+
description: "The description of the response format",
|
|
548
|
+
displayOptions: {
|
|
549
|
+
show: {
|
|
550
|
+
type: ["json_schema"]
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
displayName: "Strict",
|
|
556
|
+
name: "strict",
|
|
557
|
+
type: "boolean",
|
|
558
|
+
default: false,
|
|
559
|
+
description: "Whether to enforce the response format strictly",
|
|
560
|
+
displayOptions: {
|
|
561
|
+
show: {
|
|
562
|
+
type: ["json_schema"]
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
]
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
displayName: "Top Logprobs",
|
|
572
|
+
name: "topLogprobs",
|
|
573
|
+
type: "number",
|
|
574
|
+
default: 0,
|
|
575
|
+
description: "An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability",
|
|
576
|
+
typeOptions: {
|
|
577
|
+
minValue: 0,
|
|
578
|
+
maxValue: 20
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
displayName: "Output Randomness (Temperature)",
|
|
583
|
+
name: "temperature",
|
|
584
|
+
type: "number",
|
|
585
|
+
default: 1,
|
|
586
|
+
description: "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both",
|
|
587
|
+
typeOptions: {
|
|
588
|
+
minValue: 0,
|
|
589
|
+
maxValue: 2,
|
|
590
|
+
numberPrecision: 1
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
displayName: "Output Randomness (Top P)",
|
|
595
|
+
name: "topP",
|
|
596
|
+
default: 1,
|
|
597
|
+
typeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },
|
|
598
|
+
description: "An alternative to sampling with temperature, controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.",
|
|
599
|
+
type: "number"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
displayName: "Truncation",
|
|
603
|
+
name: "truncation",
|
|
604
|
+
type: "boolean",
|
|
605
|
+
default: false,
|
|
606
|
+
description: "Whether to truncate the input to the model's context window size. When disabled will throw a 400 error instead."
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
displayName: "Background Mode",
|
|
610
|
+
name: "backgroundMode",
|
|
611
|
+
type: "fixedCollection",
|
|
612
|
+
default: { values: [{ backgroundMode: true }] },
|
|
613
|
+
options: [
|
|
614
|
+
{
|
|
615
|
+
displayName: "Bakground",
|
|
616
|
+
name: "values",
|
|
617
|
+
values: [
|
|
618
|
+
{
|
|
619
|
+
displayName: "Background Mode",
|
|
620
|
+
name: "enabled",
|
|
621
|
+
type: "boolean",
|
|
622
|
+
default: false,
|
|
623
|
+
description: "Whether to run the model in background mode. If true, the model will run in background mode."
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
displayName: "Timeout",
|
|
627
|
+
name: "timeout",
|
|
628
|
+
type: "number",
|
|
629
|
+
default: 300,
|
|
630
|
+
description: "The timeout for the background mode in seconds. If 0, the timeout is infinite.",
|
|
631
|
+
typeOptions: {
|
|
632
|
+
minValue: 0,
|
|
633
|
+
maxValue: 3600
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
];
|
|
643
|
+
const displayOptions = {
|
|
644
|
+
show: {
|
|
645
|
+
operation: ["response"],
|
|
646
|
+
resource: ["text"]
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
|
|
650
|
+
async function execute(i) {
|
|
651
|
+
const model = this.getNodeParameter("modelId", i, "", { extractValue: true });
|
|
652
|
+
const messages = this.getNodeParameter("responses.values", i, []);
|
|
653
|
+
const options = this.getNodeParameter("options", i, {});
|
|
654
|
+
const maxToolsIterations = this.getNodeParameter("options.maxToolsIterations", i, 15);
|
|
655
|
+
const builtInTools = this.getNodeParameter("builtInTools", i, {});
|
|
656
|
+
const abortSignal = this.getExecutionCancelSignal();
|
|
657
|
+
const hideTools = this.getNodeParameter("hideTools", i, "");
|
|
658
|
+
let tools;
|
|
659
|
+
let externalTools = [];
|
|
660
|
+
if (hideTools !== "hide") {
|
|
661
|
+
const enforceUniqueNames = true;
|
|
662
|
+
externalTools = await (0, import_helpers.getConnectedTools)(this, enforceUniqueNames, false);
|
|
663
|
+
}
|
|
664
|
+
if (externalTools.length) {
|
|
665
|
+
tools = externalTools.length ? externalTools?.map(import_utils.formatToOpenAIResponsesTool) : void 0;
|
|
666
|
+
}
|
|
667
|
+
const body = await import_responses.createRequest.call(this, i, {
|
|
668
|
+
model,
|
|
669
|
+
messages,
|
|
670
|
+
options,
|
|
671
|
+
tools,
|
|
672
|
+
builtInTools
|
|
673
|
+
});
|
|
674
|
+
let response = await import_transport.apiRequest.call(this, "POST", "/responses", {
|
|
675
|
+
body
|
|
676
|
+
});
|
|
677
|
+
if (body.background) {
|
|
678
|
+
const timeoutSeconds = (0, import_get.default)(options, "backgroundMode.values.timeout", 300);
|
|
679
|
+
response = await (0, import_polling.pollUntilAvailable)(
|
|
680
|
+
this,
|
|
681
|
+
async () => {
|
|
682
|
+
return await import_transport.apiRequest.call(this, "GET", `/responses/${response.id}`);
|
|
683
|
+
},
|
|
684
|
+
(response2) => {
|
|
685
|
+
if (response2.error) {
|
|
686
|
+
throw new import_n8n_workflow.NodeOperationError(this.getNode(), "Background mode error", {
|
|
687
|
+
description: response2.error.message
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
return response2.status === "completed";
|
|
691
|
+
},
|
|
692
|
+
timeoutSeconds,
|
|
693
|
+
10
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
if (!response) return [];
|
|
697
|
+
const isToolRelatedCall = (item) => item.type === "function_call" || item.type === "reasoning";
|
|
698
|
+
let toolCalls = response.output.filter(isToolRelatedCall);
|
|
699
|
+
const hasFunctionCall = () => toolCalls.some((item) => item.type === "function_call");
|
|
700
|
+
const answeredToolCalls = /* @__PURE__ */ new Set();
|
|
701
|
+
let currentIteration = 1;
|
|
702
|
+
while (toolCalls.length && hasFunctionCall()) {
|
|
703
|
+
if (abortSignal?.aborted || maxToolsIterations > 0 && currentIteration > maxToolsIterations) {
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
for (const item of toolCalls) {
|
|
707
|
+
if (item.type === "function_call" && answeredToolCalls.has(item.call_id)) {
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
body.input.push(item);
|
|
711
|
+
if (item.type === "function_call") {
|
|
712
|
+
const functionName = item.name;
|
|
713
|
+
const functionArgs = item.arguments;
|
|
714
|
+
const callId = item.call_id;
|
|
715
|
+
let functionResponse;
|
|
716
|
+
for (const tool of externalTools ?? []) {
|
|
717
|
+
if (tool.name === functionName) {
|
|
718
|
+
const parsedArgs = (0, import_n8n_workflow.jsonParse)(functionArgs);
|
|
719
|
+
const functionInput = parsedArgs.input ?? parsedArgs ?? functionArgs;
|
|
720
|
+
functionResponse = await tool.invoke(functionInput);
|
|
721
|
+
}
|
|
722
|
+
if (typeof functionResponse === "object") {
|
|
723
|
+
functionResponse = JSON.stringify(functionResponse);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
body.input.push({
|
|
727
|
+
type: "function_call_output",
|
|
728
|
+
call_id: callId,
|
|
729
|
+
output: functionResponse
|
|
730
|
+
});
|
|
731
|
+
answeredToolCalls.add(callId);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
response = await import_transport.apiRequest.call(this, "POST", "/responses", {
|
|
735
|
+
body
|
|
736
|
+
});
|
|
737
|
+
toolCalls = response.output.filter(isToolRelatedCall);
|
|
738
|
+
currentIteration++;
|
|
739
|
+
}
|
|
740
|
+
const formatType = (0, import_get.default)(body, "text.format.type");
|
|
741
|
+
if (formatType === "json_object" || formatType === "json_schema") {
|
|
742
|
+
try {
|
|
743
|
+
response.output = response.output.map((item) => {
|
|
744
|
+
if (item.type === "message") {
|
|
745
|
+
item.content = item.content.map((content) => {
|
|
746
|
+
if (content.type === "output_text") {
|
|
747
|
+
content.text = JSON.parse(content.text);
|
|
748
|
+
}
|
|
749
|
+
return content;
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
return item;
|
|
753
|
+
});
|
|
754
|
+
} catch (error) {
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
const simplify = this.getNodeParameter("simplify", i);
|
|
758
|
+
const returnData = [];
|
|
759
|
+
if (simplify) {
|
|
760
|
+
const messages2 = response.output.filter((item) => item.type === "message");
|
|
761
|
+
returnData.push({
|
|
762
|
+
json: {
|
|
763
|
+
output: messages2
|
|
764
|
+
},
|
|
765
|
+
pairedItem: { item: i }
|
|
766
|
+
});
|
|
767
|
+
} else {
|
|
768
|
+
returnData.push({ json: response, pairedItem: { item: i } });
|
|
769
|
+
}
|
|
770
|
+
return returnData;
|
|
771
|
+
}
|
|
772
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
773
|
+
0 && (module.exports = {
|
|
774
|
+
description,
|
|
775
|
+
execute
|
|
776
|
+
});
|
|
777
|
+
//# sourceMappingURL=response.operation.js.map
|