@n8n/n8n-nodes-langchain 1.116.0 → 1.116.1

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../nodes/vendors/OpenAi/v2/actions/node.type.ts"],"sourcesContent":["import type { AllEntities } from 'n8n-workflow';\n\ntype NodeMap = {\n\taudio: 'generate' | 'transcribe' | 'translate';\n\tfile: 'upload' | 'deleteFile' | 'list';\n\timage: 'generate' | 'analyze' | 'edit';\n\ttext: 'message' | 'classify' | 'response';\n\tconversation: 'create' | 'get' | 'update' | 'remove';\n\tvideo: 'generate';\n};\n\nexport type OpenAiType = AllEntities<NodeMap>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../../../nodes/vendors/OpenAi/v2/actions/node.type.ts"],"sourcesContent":["import type { AllEntities } from 'n8n-workflow';\n\ntype NodeMap = {\n\taudio: 'generate' | 'transcribe' | 'translate';\n\tfile: 'upload' | 'deleteFile' | 'list';\n\timage: 'generate' | 'analyze' | 'edit';\n\ttext: 'classify' | 'response';\n\tconversation: 'create' | 'get' | 'update' | 'remove';\n\tvideo: 'generate';\n};\n\nexport type OpenAiType = AllEntities<NodeMap>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -30,12 +30,10 @@ var text_exports = {};
30
30
  __export(text_exports, {
31
31
  classify: () => classify,
32
32
  description: () => description,
33
- message: () => message,
34
33
  response: () => response
35
34
  });
36
35
  module.exports = __toCommonJS(text_exports);
37
36
  var classify = __toESM(require("./classify.operation"));
38
- var message = __toESM(require("./message.operation"));
39
37
  var response = __toESM(require("./response.operation"));
40
38
  const description = [
41
39
  {
@@ -45,19 +43,12 @@ const description = [
45
43
  noDataExpression: true,
46
44
  options: [
47
45
  {
48
- name: "Generate a Model Response",
46
+ name: "Message a Model",
49
47
  value: "response",
50
- action: "Generate a model response",
48
+ action: "Message a model",
51
49
  // eslint-disable-next-line n8n-nodes-base/node-param-description-excess-final-period, n8n-nodes-base/node-param-description-missing-final-period
52
50
  description: "Generate a model response with GPT 3, 4, 5, etc. using Responses API"
53
51
  },
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
52
  {
62
53
  name: "Classify Text for Violations",
63
54
  value: "classify",
@@ -73,14 +64,12 @@ const description = [
73
64
  }
74
65
  },
75
66
  ...classify.description,
76
- ...message.description,
77
67
  ...response.description
78
68
  ];
79
69
  // Annotate the CommonJS export names for ESM import in node:
80
70
  0 && (module.exports = {
81
71
  classify,
82
72
  description,
83
- message,
84
73
  response
85
74
  });
86
75
  //# sourceMappingURL=index.js.map
@@ -1 +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":[]}
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 response from './response.operation';\n\nexport { classify, 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: 'Message a Model',\n\t\t\t\tvalue: 'response',\n\t\t\t\taction: 'Message a model',\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: '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...response.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAA0B;AAC1B,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,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,SAAS;AACb;","names":[]}
@@ -697,17 +697,15 @@ async function execute(i) {
697
697
  const isToolRelatedCall = (item) => item.type === "function_call" || item.type === "reasoning";
698
698
  let toolCalls = response.output.filter(isToolRelatedCall);
699
699
  const hasFunctionCall = () => toolCalls.some((item) => item.type === "function_call");
700
- const answeredToolCalls = /* @__PURE__ */ new Set();
701
700
  let currentIteration = 1;
702
701
  while (toolCalls.length && hasFunctionCall()) {
703
702
  if (abortSignal?.aborted || maxToolsIterations > 0 && currentIteration > maxToolsIterations) {
704
703
  break;
705
704
  }
705
+ if (!body.conversation) {
706
+ body.input.push.apply(body.input, toolCalls);
707
+ }
706
708
  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
709
  if (item.type === "function_call") {
712
710
  const functionName = item.name;
713
711
  const functionArgs = item.arguments;
@@ -728,7 +726,6 @@ async function execute(i) {
728
726
  call_id: callId,
729
727
  output: functionResponse
730
728
  });
731
- answeredToolCalls.add(callId);
732
729
  }
733
730
  }
734
731
  response = await import_transport.apiRequest.call(this, "POST", "/responses", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/text/response.operation.ts"],"sourcesContent":["import type { Tool } from '@langchain/core/tools';\nimport { getConnectedTools } from '@utils/helpers';\nimport get from 'lodash/get';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { jsonParse, NodeOperationError, updateDisplayOptions } from 'n8n-workflow';\nimport { MODELS_NOT_SUPPORT_FUNCTION_CALLS } from '../../../helpers/constants';\nimport type { ChatResponse } from '../../../helpers/interfaces';\nimport { formatToOpenAIResponsesTool } from '../../../helpers/utils';\nimport { pollUntilAvailable } from '../../../helpers/polling';\nimport { apiRequest } from '../../../transport';\nimport { messageOptions, metadataProperty, modelRLC } from '../descriptions';\nimport { createRequest } from './helpers/responses';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('modelSearch'),\n\t{\n\t\tdisplayName: 'Messages',\n\t\tname: 'responses',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tsortable: true,\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tplaceholder: 'Add Message',\n\t\tdefault: { values: [{ type: 'text' }] },\n\t\toptions: messageOptions,\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription: 'Whether to return a simplified version of the response instead of the raw data',\n\t},\n\t{\n\t\tdisplayName: 'Hide Tools',\n\t\tname: 'hideTools',\n\t\ttype: 'hidden',\n\t\tdefault: 'hide',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tmodelId: MODELS_NOT_SUPPORT_FUNCTION_CALLS,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Connect your own custom n8n tools to this node on the canvas',\n\t\tname: 'noticeTools',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\thideTools: ['hide'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Built-in Tools',\n\t\tname: 'builtInTools',\n\t\tplaceholder: 'Add Built-in Tool',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Web Search',\n\t\t\t\tname: 'webSearch',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: { searchContextSize: 'medium' },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Search Context Size',\n\t\t\t\t\t\tname: 'searchContextSize',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Web Search Allowed Domains',\n\t\t\t\t\t\tname: 'allowedDomains',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Comma-separated list of domains to search. Only domains in this list will be searched.',\n\t\t\t\t\t\tplaceholder: 'e.g. google.com, wikipedia.org',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Country',\n\t\t\t\t\t\tname: 'country',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. US, GB',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'City',\n\t\t\t\t\t\tname: 'city',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. New York, London',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Region',\n\t\t\t\t\t\tname: 'region',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. New York, London',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'MCP Servers',\n\t\t\t\tname: 'mcpServers',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tplaceholder: 'Add MCP Server',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdefault: { mcpServerOptions: [{ serverLabel: '' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'MCP Server',\n\t\t\t\t\t\tname: 'mcpServerOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server Label',\n\t\t\t\t\t\t\t\tname: 'serverLabel',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'A label to identify this MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. My Database Server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Connection Type',\n\t\t\t\t\t\t\t\tname: 'connectionType',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'url',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'URL', value: 'url' },\n\t\t\t\t\t\t\t\t\t{ name: 'Connector ID', value: 'connector_id' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdescription: 'Choose how to connect to the MCP server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server URL',\n\t\t\t\t\t\t\t\tname: 'serverUrl',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The URL of the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. https://api.example.com/mcp',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\tconnectionType: ['url'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Connector ID',\n\t\t\t\t\t\t\t\tname: 'connectorId',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The connector ID for the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. connector_gmail',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\tconnectionType: ['connector_id'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Authorization',\n\t\t\t\t\t\t\t\tname: 'authorization',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Authorization token or credentials for the MCP server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Headers',\n\t\t\t\t\t\t\t\tname: 'headers',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t\t\t\tdescription: 'Additional headers to send with requests to the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: '{\"X-Custom-Header\": \"value\"}',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server Description',\n\t\t\t\t\t\t\t\tname: 'serverDescription',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'A description of what this MCP server provides',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. Database access for user management',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Allowed Tools',\n\t\t\t\t\t\t\t\tname: 'allowedTools',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Comma-separated list of tools to allow. If not provided, all tools will be allowed.',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. tool1,tool2',\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'File Search',\n\t\t\t\tname: 'fileSearch',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: { vectorStoreIds: '[]' },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Vector Store IDs',\n\t\t\t\t\t\tname: 'vectorStoreIds',\n\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\tdefault: '[]',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Filters',\n\t\t\t\t\t\tname: 'filters',\n\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Max Results',\n\t\t\t\t\t\tname: 'maxResults',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { minValue: 1, maxValue: 50 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Code Interpreter',\n\t\t\t\tname: 'codeInterpreter',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to allow the model to execute code in a local environment',\n\t\t\t},\n\t\t],\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: 'Conversation ID',\n\t\t\t\tname: 'conversationId',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Additional Data',\n\t\t\t\tname: 'include',\n\t\t\t\tdefault: [],\n\t\t\t\ttype: 'multiOptions',\n\t\t\t\tdescription: 'Specify additional output data to include in the model response',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Code Interpreter Call Outputs',\n\t\t\t\t\t\tvalue: 'code_interpreter_call.outputs',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Computer Call Output Image URL',\n\t\t\t\t\t\tvalue: 'computer_call_output.output.image_url',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Search Call Results',\n\t\t\t\t\t\tvalue: 'file_search_call.results',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Message Input Image URL',\n\t\t\t\t\t\tvalue: 'message.input_image.image_url',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Message Output Text Logprobs',\n\t\t\t\t\t\tvalue: 'message.output_text.logprobs',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Reasoning Encrypted Content',\n\t\t\t\t\t\tvalue: 'reasoning.encrypted_content',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Web Search Tool Call Sources',\n\t\t\t\t\t\tvalue: 'web_search_call.action.sources',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Instructions',\n\t\t\t\tname: 'instructions',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Instructions for the model to follow',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\t\tname: 'maxTokens',\n\t\t\t\tdefault: 16,\n\t\t\t\tdescription:\n\t\t\t\t\t'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).',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmaxValue: 32768,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Tool Calls Iterations',\n\t\t\t\tname: 'maxToolsIterations',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Built-in Tool Calls',\n\t\t\t\tname: 'maxToolCalls',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t},\n\t\t\tmetadataProperty,\n\t\t\t{\n\t\t\t\tdisplayName: 'Parallel Tool Calls',\n\t\t\t\tname: 'parallelToolCalls',\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 allow parallel tool calls. If true, the model can call multiple tools at once.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Previous Response ID',\n\t\t\t\tname: 'previousResponseId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\t// TODO: add display options?\n\t\t\t\tdescription:\n\t\t\t\t\t'The ID of the previous response to continue from. Cannot be used in conjunction with Conversation ID.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tname: 'promptConfig',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { promptOptions: [{ promptId: '' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\t\tname: 'promptOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Prompt ID',\n\t\t\t\t\t\t\t\tname: 'promptId',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The unique identifier of the prompt template to use',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Version',\n\t\t\t\t\t\t\t\tname: 'version',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Optional version of the prompt template',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Variables',\n\t\t\t\t\t\t\t\tname: 'variables',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t\t\t\tdescription: 'Variables to be substituted into the prompt template',\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Prompt Cache Key',\n\t\t\t\tname: 'promptCacheKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Reasoning',\n\t\t\t\tname: 'reasoning',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { reasoningOptions: [{ effort: 'medium', summary: 'none' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Reasoning',\n\t\t\t\t\t\tname: 'reasoningOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Effort',\n\t\t\t\t\t\t\t\tname: 'effort',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\t\t\t// TODO: allow only high for gpt-5-pro\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Summary',\n\t\t\t\t\t\t\t\tname: 'summary',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process.\",\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'None', value: 'none' },\n\t\t\t\t\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t\t\t\t\t{ name: 'Concise', value: 'concise' },\n\t\t\t\t\t\t\t\t\t{ name: 'Detailed', value: 'detailed' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Safety Identifier',\n\t\t\t\tname: 'safetyIdentifier',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t\"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.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Service Tier',\n\t\t\t\tname: 'serviceTier',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The service tier to use for the request',\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t{ name: 'Flex', value: 'flex' },\n\t\t\t\t\t{ name: 'Default', value: 'default' },\n\t\t\t\t\t{ name: 'Priority', value: 'priority' },\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Store',\n\t\t\t\tname: 'store',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to store the generated model response for later retrieval via API',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Format',\n\t\t\t\tname: 'textFormat',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { textOptions: [{ type: 'text' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Text',\n\t\t\t\t\t\tname: 'textOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Text', value: 'text' },\n\t\t\t\t\t\t\t\t\t{ name: 'JSON Schema(recommended)', value: 'json_schema' },\n\t\t\t\t\t\t\t\t\t{ name: 'JSON Object', value: 'json_object' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Verbosity',\n\t\t\t\t\t\t\t\tname: 'verbosity',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'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.',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Schema',\n\t\t\t\t\t\t\t\tname: 'schema',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The schema of the response format',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\t\t\t\tname: 'description',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The description of the response format',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Strict',\n\t\t\t\t\t\t\t\tname: 'strict',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription: 'Whether to enforce the response format strictly',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Top Logprobs',\n\t\t\t\tname: 'topLogprobs',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\tdescription:\n\t\t\t\t\t'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',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 20,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Temperature)',\n\t\t\t\tname: 'temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t'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',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top P)',\n\t\t\t\tname: 'topP',\n\t\t\t\tdefault: 1,\n\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Truncation',\n\t\t\t\tname: 'truncation',\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 truncate the input to the model's context window size. When disabled will throw a 400 error instead.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Background Mode',\n\t\t\t\tname: 'backgroundMode',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { values: [{ backgroundMode: true }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Bakground',\n\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Background Mode',\n\t\t\t\t\t\t\t\tname: 'enabled',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Whether to run the model in background mode. If true, the model will run in background mode.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Timeout',\n\t\t\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\t\t\tdefault: 300,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The timeout for the background mode in seconds. If 0, the timeout is infinite.',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\tminValue: 0,\n\t\t\t\t\t\t\t\t\tmaxValue: 3600,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\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],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['response'],\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 model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst messages = this.getNodeParameter('responses.values', i, []) as IDataObject[];\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst maxToolsIterations = this.getNodeParameter('options.maxToolsIterations', i, 15) as number;\n\tconst builtInTools = this.getNodeParameter('builtInTools', i, {}) as IDataObject;\n\tconst abortSignal = this.getExecutionCancelSignal();\n\n\tconst hideTools = this.getNodeParameter('hideTools', i, '') as string;\n\n\tlet tools;\n\tlet externalTools: Tool[] = [];\n\n\tif (hideTools !== 'hide') {\n\t\tconst enforceUniqueNames = true;\n\t\texternalTools = await getConnectedTools(this, enforceUniqueNames, false);\n\t}\n\n\tif (externalTools.length) {\n\t\ttools = externalTools.length ? externalTools?.map(formatToOpenAIResponsesTool) : undefined;\n\t}\n\n\tconst body = await createRequest.call(this, i, {\n\t\tmodel,\n\t\tmessages,\n\t\toptions,\n\t\ttools,\n\t\tbuiltInTools,\n\t});\n\tlet response = (await apiRequest.call(this, 'POST', '/responses', {\n\t\tbody,\n\t})) as ChatResponse;\n\n\tif (body.background) {\n\t\tconst timeoutSeconds = get(options, 'backgroundMode.values.timeout', 300) as number;\n\t\tresponse = await pollUntilAvailable(\n\t\t\tthis,\n\t\t\tasync () => {\n\t\t\t\treturn (await apiRequest.call(this, 'GET', `/responses/${response.id}`)) as ChatResponse;\n\t\t\t},\n\t\t\t(response) => {\n\t\t\t\tif (response.error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Background mode error', {\n\t\t\t\t\t\tdescription: response.error.message,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn response.status === 'completed';\n\t\t\t},\n\t\t\ttimeoutSeconds,\n\t\t\t10,\n\t\t);\n\t}\n\n\tif (!response) return [];\n\n\t// reasoning models such as gpt5 include reasoning items that must be included in the request\n\tconst isToolRelatedCall: (item: { type: string }) => boolean = (item) =>\n\t\titem.type === 'function_call' || item.type === 'reasoning';\n\n\tlet toolCalls = response.output.filter(isToolRelatedCall);\n\n\tconst hasFunctionCall = () => toolCalls.some((item) => item.type === 'function_call');\n\n\tconst answeredToolCalls = new Set<string>();\n\tlet currentIteration = 1;\n\t// make sure there's actually a function call to answer\n\twhile (toolCalls.length && hasFunctionCall()) {\n\t\tif (abortSignal?.aborted || (maxToolsIterations > 0 && currentIteration > maxToolsIterations)) {\n\t\t\tbreak;\n\t\t}\n\n\t\tfor (const item of toolCalls) {\n\t\t\tif (item.type === 'function_call' && answeredToolCalls.has(item.call_id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// include function_call or reasoning items in the request\n\t\t\tbody.input.push(item);\n\n\t\t\tif (item.type === 'function_call') {\n\t\t\t\tconst functionName = item.name;\n\t\t\t\tconst functionArgs = item.arguments;\n\t\t\t\tconst callId = item.call_id;\n\n\t\t\t\tlet functionResponse;\n\t\t\t\tfor (const tool of externalTools ?? []) {\n\t\t\t\t\tif (tool.name === functionName) {\n\t\t\t\t\t\tconst parsedArgs: { input: string } = jsonParse(functionArgs);\n\t\t\t\t\t\tconst functionInput = parsedArgs.input ?? parsedArgs ?? functionArgs;\n\t\t\t\t\t\tfunctionResponse = await tool.invoke(functionInput);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof functionResponse === 'object') {\n\t\t\t\t\t\tfunctionResponse = JSON.stringify(functionResponse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbody.input.push({\n\t\t\t\t\ttype: 'function_call_output',\n\t\t\t\t\tcall_id: callId,\n\t\t\t\t\toutput: functionResponse,\n\t\t\t\t});\n\n\t\t\t\tansweredToolCalls.add(callId);\n\t\t\t}\n\t\t}\n\n\t\tresponse = (await apiRequest.call(this, 'POST', '/responses', {\n\t\t\tbody,\n\t\t})) as ChatResponse;\n\t\ttoolCalls = response.output.filter(isToolRelatedCall);\n\n\t\tcurrentIteration++;\n\t}\n\n\tconst formatType = get(body, 'text.format.type');\n\tif (formatType === 'json_object' || formatType === 'json_schema') {\n\t\ttry {\n\t\t\tresponse.output = response.output.map((item) => {\n\t\t\t\tif (item.type === 'message') {\n\t\t\t\t\titem.content = item.content.map((content) => {\n\t\t\t\t\t\tif (content.type === 'output_text') {\n\t\t\t\t\t\t\tcontent.text = JSON.parse(content.text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn content;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn item;\n\t\t\t});\n\t\t} catch (error) {}\n\t}\n\n\tconst simplify = this.getNodeParameter('simplify', i) as boolean;\n\n\tconst returnData: INodeExecutionData[] = [];\n\n\tif (simplify) {\n\t\tconst messages = response.output.filter((item) => item.type === 'message');\n\t\treturnData.push({\n\t\t\tjson: {\n\t\t\t\toutput: messages as unknown as IDataObject,\n\t\t\t},\n\t\t\tpairedItem: { item: i },\n\t\t});\n\t} else {\n\t\treturnData.push({ json: response as unknown as IDataObject, pairedItem: { item: i } });\n\t}\n\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAkC;AAClC,iBAAgB;AAOhB,0BAAoE;AACpE,uBAAkD;AAElD,mBAA4C;AAC5C,qBAAmC;AACnC,uBAA2B;AAC3B,0BAA2D;AAC3D,uBAA8B;AAE9B,MAAM,aAAgC;AAAA,MACrC,8BAAS,aAAa;AAAA,EACtB;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,UAAU;AAAA,MAC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EACF,OAAO;AACN,eAAW,KAAK,EAAE,MAAM,UAAoC,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;AAAA,EACtF;AAEA,SAAO;AACR;","names":["get","response","messages"]}
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/text/response.operation.ts"],"sourcesContent":["import type { Tool } from '@langchain/core/tools';\nimport { getConnectedTools } from '@utils/helpers';\nimport get from 'lodash/get';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { jsonParse, NodeOperationError, updateDisplayOptions } from 'n8n-workflow';\nimport { MODELS_NOT_SUPPORT_FUNCTION_CALLS } from '../../../helpers/constants';\nimport type { ChatResponse } from '../../../helpers/interfaces';\nimport { formatToOpenAIResponsesTool } from '../../../helpers/utils';\nimport { pollUntilAvailable } from '../../../helpers/polling';\nimport { apiRequest } from '../../../transport';\nimport { messageOptions, metadataProperty, modelRLC } from '../descriptions';\nimport { createRequest } from './helpers/responses';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('modelSearch'),\n\t{\n\t\tdisplayName: 'Messages',\n\t\tname: 'responses',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tsortable: true,\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tplaceholder: 'Add Message',\n\t\tdefault: { values: [{ type: 'text' }] },\n\t\toptions: messageOptions,\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription: 'Whether to return a simplified version of the response instead of the raw data',\n\t},\n\t{\n\t\tdisplayName: 'Hide Tools',\n\t\tname: 'hideTools',\n\t\ttype: 'hidden',\n\t\tdefault: 'hide',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tmodelId: MODELS_NOT_SUPPORT_FUNCTION_CALLS,\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Connect your own custom n8n tools to this node on the canvas',\n\t\tname: 'noticeTools',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\thideTools: ['hide'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Built-in Tools',\n\t\tname: 'builtInTools',\n\t\tplaceholder: 'Add Built-in Tool',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Web Search',\n\t\t\t\tname: 'webSearch',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: { searchContextSize: 'medium' },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Search Context Size',\n\t\t\t\t\t\tname: 'searchContextSize',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Web Search Allowed Domains',\n\t\t\t\t\t\tname: 'allowedDomains',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Comma-separated list of domains to search. Only domains in this list will be searched.',\n\t\t\t\t\t\tplaceholder: 'e.g. google.com, wikipedia.org',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Country',\n\t\t\t\t\t\tname: 'country',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. US, GB',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'City',\n\t\t\t\t\t\tname: 'city',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. New York, London',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Region',\n\t\t\t\t\t\tname: 'region',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. New York, London',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'MCP Servers',\n\t\t\t\tname: 'mcpServers',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tplaceholder: 'Add MCP Server',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdefault: { mcpServerOptions: [{ serverLabel: '' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'MCP Server',\n\t\t\t\t\t\tname: 'mcpServerOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server Label',\n\t\t\t\t\t\t\t\tname: 'serverLabel',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'A label to identify this MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. My Database Server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Connection Type',\n\t\t\t\t\t\t\t\tname: 'connectionType',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'url',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'URL', value: 'url' },\n\t\t\t\t\t\t\t\t\t{ name: 'Connector ID', value: 'connector_id' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdescription: 'Choose how to connect to the MCP server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server URL',\n\t\t\t\t\t\t\t\tname: 'serverUrl',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The URL of the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. https://api.example.com/mcp',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\tconnectionType: ['url'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Connector ID',\n\t\t\t\t\t\t\t\tname: 'connectorId',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The connector ID for the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. connector_gmail',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\tconnectionType: ['connector_id'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Authorization',\n\t\t\t\t\t\t\t\tname: 'authorization',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Authorization token or credentials for the MCP server',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Headers',\n\t\t\t\t\t\t\t\tname: 'headers',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t\t\t\tdescription: 'Additional headers to send with requests to the MCP server',\n\t\t\t\t\t\t\t\tplaceholder: '{\"X-Custom-Header\": \"value\"}',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Server Description',\n\t\t\t\t\t\t\t\tname: 'serverDescription',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'A description of what this MCP server provides',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. Database access for user management',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Allowed Tools',\n\t\t\t\t\t\t\t\tname: 'allowedTools',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Comma-separated list of tools to allow. If not provided, all tools will be allowed.',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. tool1,tool2',\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'File Search',\n\t\t\t\tname: 'fileSearch',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: { vectorStoreIds: '[]' },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Vector Store IDs',\n\t\t\t\t\t\tname: 'vectorStoreIds',\n\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\tdefault: '[]',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Filters',\n\t\t\t\t\t\tname: 'filters',\n\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Max Results',\n\t\t\t\t\t\tname: 'maxResults',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { minValue: 1, maxValue: 50 },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Code Interpreter',\n\t\t\t\tname: 'codeInterpreter',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to allow the model to execute code in a local environment',\n\t\t\t},\n\t\t],\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: 'Conversation ID',\n\t\t\t\tname: 'conversationId',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Include Additional Data',\n\t\t\t\tname: 'include',\n\t\t\t\tdefault: [],\n\t\t\t\ttype: 'multiOptions',\n\t\t\t\tdescription: 'Specify additional output data to include in the model response',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Code Interpreter Call Outputs',\n\t\t\t\t\t\tvalue: 'code_interpreter_call.outputs',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Computer Call Output Image URL',\n\t\t\t\t\t\tvalue: 'computer_call_output.output.image_url',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'File Search Call Results',\n\t\t\t\t\t\tvalue: 'file_search_call.results',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Message Input Image URL',\n\t\t\t\t\t\tvalue: 'message.input_image.image_url',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Message Output Text Logprobs',\n\t\t\t\t\t\tvalue: 'message.output_text.logprobs',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Reasoning Encrypted Content',\n\t\t\t\t\t\tvalue: 'reasoning.encrypted_content',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Web Search Tool Call Sources',\n\t\t\t\t\t\tvalue: 'web_search_call.action.sources',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Instructions',\n\t\t\t\tname: 'instructions',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Instructions for the model to follow',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\t\tname: 'maxTokens',\n\t\t\t\tdefault: 16,\n\t\t\t\tdescription:\n\t\t\t\t\t'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).',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmaxValue: 32768,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Tool Calls Iterations',\n\t\t\t\tname: 'maxToolsIterations',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Built-in Tool Calls',\n\t\t\t\tname: 'maxToolCalls',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t},\n\t\t\tmetadataProperty,\n\t\t\t{\n\t\t\t\tdisplayName: 'Parallel Tool Calls',\n\t\t\t\tname: 'parallelToolCalls',\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 allow parallel tool calls. If true, the model can call multiple tools at once.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Previous Response ID',\n\t\t\t\tname: 'previousResponseId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\t// TODO: add display options?\n\t\t\t\tdescription:\n\t\t\t\t\t'The ID of the previous response to continue from. Cannot be used in conjunction with Conversation ID.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tname: 'promptConfig',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { promptOptions: [{ promptId: '' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\t\tname: 'promptOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Prompt ID',\n\t\t\t\t\t\t\t\tname: 'promptId',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The unique identifier of the prompt template to use',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Version',\n\t\t\t\t\t\t\t\tname: 'version',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Optional version of the prompt template',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Variables',\n\t\t\t\t\t\t\t\tname: 'variables',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '{}',\n\t\t\t\t\t\t\t\tdescription: 'Variables to be substituted into the prompt template',\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Prompt Cache Key',\n\t\t\t\tname: 'promptCacheKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Reasoning',\n\t\t\t\tname: 'reasoning',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { reasoningOptions: [{ effort: 'medium', summary: 'none' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Reasoning',\n\t\t\t\t\t\tname: 'reasoningOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Effort',\n\t\t\t\t\t\t\t\tname: 'effort',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\t\t\t// TODO: allow only high for gpt-5-pro\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Summary',\n\t\t\t\t\t\t\t\tname: 'summary',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process.\",\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'None', value: 'none' },\n\t\t\t\t\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t\t\t\t\t{ name: 'Concise', value: 'concise' },\n\t\t\t\t\t\t\t\t\t{ name: 'Detailed', value: 'detailed' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Safety Identifier',\n\t\t\t\tname: 'safetyIdentifier',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription:\n\t\t\t\t\t\"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.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Service Tier',\n\t\t\t\tname: 'serviceTier',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\tdescription: 'The service tier to use for the request',\n\t\t\t\toptions: [\n\t\t\t\t\t{ name: 'Auto', value: 'auto' },\n\t\t\t\t\t{ name: 'Flex', value: 'flex' },\n\t\t\t\t\t{ name: 'Default', value: 'default' },\n\t\t\t\t\t{ name: 'Priority', value: 'priority' },\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Store',\n\t\t\t\tname: 'store',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdescription: 'Whether to store the generated model response for later retrieval via API',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Format',\n\t\t\t\tname: 'textFormat',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { textOptions: [{ type: 'text' }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Text',\n\t\t\t\t\t\tname: 'textOptions',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Text', value: 'text' },\n\t\t\t\t\t\t\t\t\t{ name: 'JSON Schema(recommended)', value: 'json_schema' },\n\t\t\t\t\t\t\t\t\t{ name: 'JSON Object', value: 'json_object' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Verbosity',\n\t\t\t\t\t\t\t\tname: 'verbosity',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'medium',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{ name: 'Low', value: 'low' },\n\t\t\t\t\t\t\t\t\t{ name: 'Medium', value: 'medium' },\n\t\t\t\t\t\t\t\t\t{ name: 'High', value: 'high' },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'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.',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Schema',\n\t\t\t\t\t\t\t\tname: 'schema',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The schema of the response format',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\t\t\t\tname: 'description',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'The description of the response format',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Strict',\n\t\t\t\t\t\t\t\tname: 'strict',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription: 'Whether to enforce the response format strictly',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['json_schema'],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\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\t{\n\t\t\t\tdisplayName: 'Top Logprobs',\n\t\t\t\tname: 'topLogprobs',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\tdescription:\n\t\t\t\t\t'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',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 20,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Temperature)',\n\t\t\t\tname: 'temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t'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',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 2,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top P)',\n\t\t\t\tname: 'topP',\n\t\t\t\tdefault: 1,\n\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t'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.',\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Truncation',\n\t\t\t\tname: 'truncation',\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 truncate the input to the model's context window size. When disabled will throw a 400 error instead.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Background Mode',\n\t\t\t\tname: 'backgroundMode',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: { values: [{ backgroundMode: true }] },\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Bakground',\n\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Background Mode',\n\t\t\t\t\t\t\t\tname: 'enabled',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Whether to run the model in background mode. If true, the model will run in background mode.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Timeout',\n\t\t\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\t\t\tdefault: 300,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The timeout for the background mode in seconds. If 0, the timeout is infinite.',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\tminValue: 0,\n\t\t\t\t\t\t\t\t\tmaxValue: 3600,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\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],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['response'],\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 model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst messages = this.getNodeParameter('responses.values', i, []) as IDataObject[];\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst maxToolsIterations = this.getNodeParameter('options.maxToolsIterations', i, 15) as number;\n\tconst builtInTools = this.getNodeParameter('builtInTools', i, {}) as IDataObject;\n\tconst abortSignal = this.getExecutionCancelSignal();\n\n\tconst hideTools = this.getNodeParameter('hideTools', i, '') as string;\n\n\tlet tools;\n\tlet externalTools: Tool[] = [];\n\n\tif (hideTools !== 'hide') {\n\t\tconst enforceUniqueNames = true;\n\t\texternalTools = await getConnectedTools(this, enforceUniqueNames, false);\n\t}\n\n\tif (externalTools.length) {\n\t\ttools = externalTools.length ? externalTools?.map(formatToOpenAIResponsesTool) : undefined;\n\t}\n\n\tconst body = await createRequest.call(this, i, {\n\t\tmodel,\n\t\tmessages,\n\t\toptions,\n\t\ttools,\n\t\tbuiltInTools,\n\t});\n\tlet response = (await apiRequest.call(this, 'POST', '/responses', {\n\t\tbody,\n\t})) as ChatResponse;\n\n\tif (body.background) {\n\t\tconst timeoutSeconds = get(options, 'backgroundMode.values.timeout', 300) as number;\n\t\tresponse = await pollUntilAvailable(\n\t\t\tthis,\n\t\t\tasync () => {\n\t\t\t\treturn (await apiRequest.call(this, 'GET', `/responses/${response.id}`)) as ChatResponse;\n\t\t\t},\n\t\t\t(response) => {\n\t\t\t\tif (response.error) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'Background mode error', {\n\t\t\t\t\t\tdescription: response.error.message,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn response.status === 'completed';\n\t\t\t},\n\t\t\ttimeoutSeconds,\n\t\t\t10,\n\t\t);\n\t}\n\n\tif (!response) return [];\n\n\t// reasoning models such as gpt5 include reasoning items that must be included in the request\n\tconst isToolRelatedCall: (item: { type: string }) => boolean = (item) =>\n\t\titem.type === 'function_call' || item.type === 'reasoning';\n\n\tlet toolCalls = response.output.filter(isToolRelatedCall);\n\n\tconst hasFunctionCall = () => toolCalls.some((item) => item.type === 'function_call');\n\n\tlet currentIteration = 1;\n\t// make sure there's actually a function call to answer\n\twhile (toolCalls.length && hasFunctionCall()) {\n\t\tif (abortSignal?.aborted || (maxToolsIterations > 0 && currentIteration > maxToolsIterations)) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// if there's conversation, we don't need to include function_call or reasoning items in the request\n\t\t// if we include them, OpenAI will throw \"Duplicate item with id\" error\n\t\tif (!body.conversation) {\n\t\t\tbody.input.push.apply(body.input, toolCalls);\n\t\t}\n\n\t\tfor (const item of toolCalls) {\n\t\t\tif (item.type === 'function_call') {\n\t\t\t\tconst functionName = item.name;\n\t\t\t\tconst functionArgs = item.arguments;\n\t\t\t\tconst callId = item.call_id;\n\n\t\t\t\tlet functionResponse;\n\t\t\t\tfor (const tool of externalTools ?? []) {\n\t\t\t\t\tif (tool.name === functionName) {\n\t\t\t\t\t\tconst parsedArgs: { input: string } = jsonParse(functionArgs);\n\t\t\t\t\t\tconst functionInput = parsedArgs.input ?? parsedArgs ?? functionArgs;\n\t\t\t\t\t\tfunctionResponse = await tool.invoke(functionInput);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof functionResponse === 'object') {\n\t\t\t\t\t\tfunctionResponse = JSON.stringify(functionResponse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbody.input.push({\n\t\t\t\t\ttype: 'function_call_output',\n\t\t\t\t\tcall_id: callId,\n\t\t\t\t\toutput: functionResponse,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tresponse = (await apiRequest.call(this, 'POST', '/responses', {\n\t\t\tbody,\n\t\t})) as ChatResponse;\n\t\ttoolCalls = response.output.filter(isToolRelatedCall);\n\n\t\tcurrentIteration++;\n\t}\n\n\tconst formatType = get(body, 'text.format.type');\n\tif (formatType === 'json_object' || formatType === 'json_schema') {\n\t\ttry {\n\t\t\tresponse.output = response.output.map((item) => {\n\t\t\t\tif (item.type === 'message') {\n\t\t\t\t\titem.content = item.content.map((content) => {\n\t\t\t\t\t\tif (content.type === 'output_text') {\n\t\t\t\t\t\t\tcontent.text = JSON.parse(content.text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn content;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn item;\n\t\t\t});\n\t\t} catch (error) {}\n\t}\n\n\tconst simplify = this.getNodeParameter('simplify', i) as boolean;\n\n\tconst returnData: INodeExecutionData[] = [];\n\n\tif (simplify) {\n\t\tconst messages = response.output.filter((item) => item.type === 'message');\n\t\treturnData.push({\n\t\t\tjson: {\n\t\t\t\toutput: messages as unknown as IDataObject,\n\t\t\t},\n\t\t\tpairedItem: { item: i },\n\t\t});\n\t} else {\n\t\treturnData.push({ json: response as unknown as IDataObject, pairedItem: { item: i } });\n\t}\n\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAkC;AAClC,iBAAgB;AAOhB,0BAAoE;AACpE,uBAAkD;AAElD,mBAA4C;AAC5C,qBAAmC;AACnC,uBAA2B;AAC3B,0BAA2D;AAC3D,uBAA8B;AAE9B,MAAM,aAAgC;AAAA,MACrC,8BAAS,aAAa;AAAA,EACtB;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,IACb,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,EAAE;AAAA,IACtC,SAAS;AAAA,EACV;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,SAAS;AAAA,MACV;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,WAAW,CAAC,MAAM;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,I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