@n8n/n8n-nodes-langchain 1.115.1 → 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.
Files changed (192) hide show
  1. package/dist/credentials/AnthropicApi.credentials.js +39 -8
  2. package/dist/credentials/AnthropicApi.credentials.js.map +1 -1
  3. package/dist/credentials/LemonadeApi.credentials.js +70 -0
  4. package/dist/credentials/LemonadeApi.credentials.js.map +1 -0
  5. package/dist/known/credentials.json +9 -0
  6. package/dist/known/nodes.json +12 -0
  7. package/dist/nodes/agents/Agent/Agent.node.js +1 -2
  8. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  9. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +2 -0
  10. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
  11. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js +13 -1
  12. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js.map +1 -1
  13. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +49 -30
  14. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -1
  15. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +3 -0
  16. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -1
  17. package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js +87 -0
  18. package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js.map +1 -0
  19. package/dist/nodes/embeddings/EmbeddingsLemonade/lemonade.svg +53 -0
  20. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +17 -0
  21. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
  22. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +12 -8
  23. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
  24. package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js +106 -0
  25. package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js.map +1 -0
  26. package/dist/nodes/llms/LMChatLemonade/lemonade.svg +53 -0
  27. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +6 -5
  28. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
  29. package/dist/nodes/llms/LMLemonade/LmLemonade.node.js +107 -0
  30. package/dist/nodes/llms/LMLemonade/LmLemonade.node.js.map +1 -0
  31. package/dist/nodes/llms/LMLemonade/description.js +147 -0
  32. package/dist/nodes/llms/LMLemonade/description.js.map +1 -0
  33. package/dist/nodes/llms/LMLemonade/lemonade.svg +53 -0
  34. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +3 -0
  35. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
  36. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +14 -1
  37. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
  38. package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js +107 -47
  39. package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -1
  40. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +2 -1
  41. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
  42. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +43 -4
  43. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
  44. package/dist/nodes/vendors/Anthropic/transport/index.js +9 -5
  45. package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -1
  46. package/dist/nodes/vendors/OpenAi/OpenAi.node.js +50 -11
  47. package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -1
  48. package/dist/nodes/vendors/OpenAi/helpers/binary-data.js +3 -3
  49. package/dist/nodes/vendors/OpenAi/helpers/binary-data.js.map +1 -1
  50. package/dist/nodes/vendors/OpenAi/helpers/description.js +75 -0
  51. package/dist/nodes/vendors/OpenAi/helpers/description.js.map +1 -0
  52. package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -1
  53. package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js +34 -0
  54. package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js.map +1 -0
  55. package/dist/nodes/vendors/OpenAi/helpers/polling.js +52 -0
  56. package/dist/nodes/vendors/OpenAi/helpers/polling.js.map +1 -0
  57. package/dist/nodes/vendors/OpenAi/helpers/utils.js +27 -0
  58. package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -1
  59. package/dist/nodes/vendors/OpenAi/methods/listSearch.js +10 -6
  60. package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -1
  61. package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js +110 -0
  62. package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js.map +1 -0
  63. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/create.operation.js +1 -1
  64. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js.map +1 -0
  65. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/deleteAssistant.operation.js +1 -1
  66. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js.map +1 -0
  67. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js.map +1 -0
  68. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/list.operation.js +1 -1
  69. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js.map +1 -0
  70. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/message.operation.js +5 -5
  71. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -0
  72. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/update.operation.js +1 -1
  73. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js.map +1 -0
  74. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/generate.operation.js +1 -1
  75. package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js.map +1 -0
  76. package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js.map +1 -0
  77. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/transcribe.operation.js +2 -2
  78. package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js.map +1 -0
  79. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/translate.operation.js +2 -2
  80. package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js.map +1 -0
  81. package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js.map +1 -0
  82. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/deleteFile.operation.js +1 -1
  83. package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js.map +1 -0
  84. package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js.map +1 -0
  85. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/list.operation.js +1 -1
  86. package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js.map +1 -0
  87. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/upload.operation.js +2 -2
  88. package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js.map +1 -0
  89. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/analyze.operation.js +1 -1
  90. package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js.map +1 -0
  91. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/generate.operation.js +1 -1
  92. package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js.map +1 -0
  93. package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js.map +1 -0
  94. package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js.map +1 -0
  95. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/router.js +1 -1
  96. package/dist/nodes/vendors/OpenAi/v1/actions/router.js.map +1 -0
  97. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/classify.operation.js +1 -1
  98. package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js.map +1 -0
  99. package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js.map +1 -0
  100. package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/message.operation.js +4 -4
  101. package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js.map +1 -0
  102. package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js +116 -0
  103. package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js.map +1 -0
  104. package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js +197 -0
  105. package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js.map +1 -0
  106. package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js +96 -0
  107. package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js.map +1 -0
  108. package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js +121 -0
  109. package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js.map +1 -0
  110. package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js +111 -0
  111. package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js.map +1 -0
  112. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js +120 -0
  113. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js.map +1 -0
  114. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js +60 -0
  115. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js.map +1 -0
  116. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js +94 -0
  117. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js.map +1 -0
  118. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js +60 -0
  119. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js.map +1 -0
  120. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js +75 -0
  121. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js.map +1 -0
  122. package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js +279 -0
  123. package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js.map +1 -0
  124. package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js +84 -0
  125. package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js.map +1 -0
  126. package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js +84 -0
  127. package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js.map +1 -0
  128. package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js +92 -0
  129. package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js.map +1 -0
  130. package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js +130 -0
  131. package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js.map +1 -0
  132. package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js +211 -0
  133. package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js.map +1 -0
  134. package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js +464 -0
  135. package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js.map +1 -0
  136. package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js +319 -0
  137. package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js.map +1 -0
  138. package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js +84 -0
  139. package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js.map +1 -0
  140. package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js +17 -0
  141. package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js.map +1 -0
  142. package/dist/nodes/vendors/OpenAi/v2/actions/router.js +111 -0
  143. package/dist/nodes/vendors/OpenAi/v2/actions/router.js.map +1 -0
  144. package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js +102 -0
  145. package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js.map +1 -0
  146. package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js +277 -0
  147. package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js.map +1 -0
  148. package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js +75 -0
  149. package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js.map +1 -0
  150. package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js +774 -0
  151. package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js.map +1 -0
  152. package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js +199 -0
  153. package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js.map +1 -0
  154. package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js +64 -0
  155. package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js.map +1 -0
  156. package/dist/types/credentials.json +2 -1
  157. package/dist/types/nodes.json +10 -6
  158. package/dist/utils/helpers.js +22 -2
  159. package/dist/utils/helpers.js.map +1 -1
  160. package/package.json +14 -10
  161. package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js.map +0 -1
  162. package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js.map +0 -1
  163. package/dist/nodes/vendors/OpenAi/actions/assistant/index.js.map +0 -1
  164. package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js.map +0 -1
  165. package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +0 -1
  166. package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js.map +0 -1
  167. package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js.map +0 -1
  168. package/dist/nodes/vendors/OpenAi/actions/audio/index.js.map +0 -1
  169. package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js.map +0 -1
  170. package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js.map +0 -1
  171. package/dist/nodes/vendors/OpenAi/actions/descriptions.js.map +0 -1
  172. package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js.map +0 -1
  173. package/dist/nodes/vendors/OpenAi/actions/file/index.js.map +0 -1
  174. package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js.map +0 -1
  175. package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js.map +0 -1
  176. package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js.map +0 -1
  177. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +0 -1
  178. package/dist/nodes/vendors/OpenAi/actions/image/index.js.map +0 -1
  179. package/dist/nodes/vendors/OpenAi/actions/node.type.js.map +0 -1
  180. package/dist/nodes/vendors/OpenAi/actions/router.js.map +0 -1
  181. package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js.map +0 -1
  182. package/dist/nodes/vendors/OpenAi/actions/text/index.js.map +0 -1
  183. package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js.map +0 -1
  184. package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +0 -160
  185. package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +0 -1
  186. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/index.js +0 -0
  187. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/index.js +0 -0
  188. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/descriptions.js +0 -0
  189. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/index.js +0 -0
  190. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/index.js +0 -0
  191. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/node.type.js +0 -0
  192. /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/index.js +0 -0
@@ -0,0 +1,111 @@
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 translate_operation_exports = {};
30
+ __export(translate_operation_exports, {
31
+ description: () => description,
32
+ execute: () => execute
33
+ });
34
+ module.exports = __toCommonJS(translate_operation_exports);
35
+ var import_form_data = __toESM(require("form-data"));
36
+ var import_n8n_workflow = require("n8n-workflow");
37
+ var import_binary_data = require("../../../helpers/binary-data");
38
+ var import_transport = require("../../../transport");
39
+ const properties = [
40
+ {
41
+ displayName: "Input Data Field Name",
42
+ name: "binaryPropertyName",
43
+ type: "string",
44
+ default: "data",
45
+ hint: "The name of the input field containing the binary file data to be processed",
46
+ placeholder: "e.g. data",
47
+ description: "Name of the binary property which contains the audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm"
48
+ },
49
+ {
50
+ displayName: "Options",
51
+ name: "options",
52
+ placeholder: "Add Option",
53
+ type: "collection",
54
+ default: {},
55
+ options: [
56
+ {
57
+ displayName: "Output Randomness (Temperature)",
58
+ name: "temperature",
59
+ type: "number",
60
+ default: 0,
61
+ typeOptions: {
62
+ minValue: 0,
63
+ maxValue: 1,
64
+ numberPrecision: 1
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ ];
70
+ const displayOptions = {
71
+ show: {
72
+ operation: ["translate"],
73
+ resource: ["audio"]
74
+ }
75
+ };
76
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
77
+ async function execute(i) {
78
+ const model = "whisper-1";
79
+ const binaryPropertyName = this.getNodeParameter("binaryPropertyName", i);
80
+ const options = this.getNodeParameter("options", i, {});
81
+ const formData = new import_form_data.default();
82
+ formData.append("model", model);
83
+ if (options.temperature) {
84
+ formData.append("temperature", options.temperature.toString());
85
+ }
86
+ const { filename, contentType, fileContent } = await (0, import_binary_data.getBinaryDataFile)(
87
+ this,
88
+ i,
89
+ binaryPropertyName
90
+ );
91
+ formData.append("file", fileContent, {
92
+ filename,
93
+ contentType
94
+ });
95
+ const response = await import_transport.apiRequest.call(this, "POST", "/audio/translations", {
96
+ option: { formData },
97
+ headers: formData.getHeaders()
98
+ });
99
+ return [
100
+ {
101
+ json: response,
102
+ pairedItem: { item: i }
103
+ }
104
+ ];
105
+ }
106
+ // Annotate the CommonJS export names for ESM import in node:
107
+ 0 && (module.exports = {
108
+ description,
109
+ execute
110
+ });
111
+ //# sourceMappingURL=translate.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/audio/translate.operation.ts"],"sourcesContent":["import FormData from 'form-data';\nimport type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { getBinaryDataFile } from '../../../helpers/binary-data';\nimport { apiRequest } from '../../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Input Data Field Name',\n\t\tname: 'binaryPropertyName',\n\t\ttype: 'string',\n\t\tdefault: 'data',\n\t\thint: 'The name of the input field containing the binary file data to be processed',\n\t\tplaceholder: 'e.g. data',\n\t\tdescription:\n\t\t\t'Name of the binary property which contains the audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm',\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: 'Output Randomness (Temperature)',\n\t\t\t\tname: 'temperature',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 0,\n\t\t\t\t\tmaxValue: 1,\n\t\t\t\t\tnumberPrecision: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['translate'],\n\t\tresource: ['audio'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = 'whisper-1';\n\tconst binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);\n\tconst options = this.getNodeParameter('options', i, {});\n\n\tconst formData = new FormData();\n\n\tformData.append('model', model);\n\n\tif (options.temperature) {\n\t\tformData.append('temperature', options.temperature.toString());\n\t}\n\n\tconst { filename, contentType, fileContent } = await getBinaryDataFile(\n\t\tthis,\n\t\ti,\n\t\tbinaryPropertyName,\n\t);\n\tformData.append('file', fileContent, {\n\t\tfilename,\n\t\tcontentType,\n\t});\n\n\tconst response = await apiRequest.call(this, 'POST', '/audio/translations', {\n\t\toption: { formData },\n\t\theaders: formData.getHeaders(),\n\t});\n\n\treturn [\n\t\t{\n\t\t\tjson: response,\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB;AAErB,0BAAqC;AAErC,yBAAkC;AAClC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACC;AAAA,EACF;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,SAAS;AAAA,MACR;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,UACZ,UAAU;AAAA,UACV,UAAU;AAAA,UACV,iBAAiB;AAAA,QAClB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,WAAW,CAAC,WAAW;AAAA,IACvB,UAAU,CAAC,OAAO;AAAA,EACnB;AACD;AAEO,MAAM,kBAAc,0CAAqB,gBAAgB,UAAU;AAE1E,eAAsB,QAAiC,GAA0C;AAChG,QAAM,QAAQ;AACd,QAAM,qBAAqB,KAAK,iBAAiB,sBAAsB,CAAC;AACxE,QAAM,UAAU,KAAK,iBAAiB,WAAW,GAAG,CAAC,CAAC;AAEtD,QAAM,WAAW,IAAI,iBAAAA,QAAS;AAE9B,WAAS,OAAO,SAAS,KAAK;AAE9B,MAAI,QAAQ,aAAa;AACxB,aAAS,OAAO,eAAe,QAAQ,YAAY,SAAS,CAAC;AAAA,EAC9D;AAEA,QAAM,EAAE,UAAU,aAAa,YAAY,IAAI,UAAM;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,WAAS,OAAO,QAAQ,aAAa;AAAA,IACpC;AAAA,IACA;AAAA,EACD,CAAC;AAED,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,uBAAuB;AAAA,IAC3E,QAAQ,EAAE,SAAS;AAAA,IACnB,SAAS,SAAS,WAAW;AAAA,EAC9B,CAAC;AAED,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":["FormData"]}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var create_operation_exports = {};
20
+ __export(create_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(create_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_transport = require("../../../transport");
27
+ var import_descriptions = require("../descriptions");
28
+ var import_responses = require("../text/helpers/responses");
29
+ const properties = [
30
+ {
31
+ displayName: "Messages",
32
+ name: "messages",
33
+ type: "fixedCollection",
34
+ typeOptions: {
35
+ sortable: true,
36
+ multipleValues: true
37
+ },
38
+ placeholder: "Add Message",
39
+ default: { values: [{ type: "text" }] },
40
+ options: [
41
+ {
42
+ displayName: "Values",
43
+ name: "values",
44
+ values: [
45
+ {
46
+ displayName: "Role",
47
+ name: "role",
48
+ type: "options",
49
+ description: "Role in shaping the model's response, it tells the model how it should behave and interact with the user",
50
+ options: [
51
+ {
52
+ name: "User",
53
+ value: "user",
54
+ description: "Send a message as a user and get a response from the model"
55
+ },
56
+ {
57
+ name: "Assistant",
58
+ value: "assistant",
59
+ description: "Tell the model to adopt a specific tone or personality"
60
+ },
61
+ {
62
+ name: "System",
63
+ value: "system",
64
+ description: "Usually used to set the model's behavior or context for the next user message"
65
+ }
66
+ ],
67
+ default: "user"
68
+ },
69
+ {
70
+ ...import_descriptions.textMessageProperties[0],
71
+ displayOptions: {}
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ displayName: "Options",
79
+ name: "options",
80
+ placeholder: "Add Option",
81
+ type: "collection",
82
+ default: {},
83
+ options: [import_descriptions.metadataProperty]
84
+ }
85
+ ];
86
+ const displayOptions = {
87
+ show: {
88
+ operation: ["create"],
89
+ resource: ["conversation"]
90
+ }
91
+ };
92
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
93
+ async function execute(i) {
94
+ const options = this.getNodeParameter("options", i, {});
95
+ const messages = this.getNodeParameter("messages.values", i, []);
96
+ const body = {
97
+ items: await import_responses.formatInputMessages.call(this, i, messages)
98
+ };
99
+ if (options.metadata) {
100
+ const metadata = (0, import_n8n_workflow.jsonParse)(options.metadata, {
101
+ errorMessage: "Invalid JSON in metadata field"
102
+ });
103
+ if (!(0, import_n8n_workflow.isObjectEmpty)(metadata)) {
104
+ body.metadata = metadata;
105
+ }
106
+ }
107
+ const response = await import_transport.apiRequest.call(this, "POST", "/conversations", { body });
108
+ return [
109
+ {
110
+ json: response,
111
+ pairedItem: { item: i }
112
+ }
113
+ ];
114
+ }
115
+ // Annotate the CommonJS export names for ESM import in node:
116
+ 0 && (module.exports = {
117
+ description,
118
+ execute
119
+ });
120
+ //# sourceMappingURL=create.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/conversation/create.operation.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeProperties,\n} from 'n8n-workflow';\nimport { isObjectEmpty, jsonParse, updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../../transport';\nimport { metadataProperty, textMessageProperties } from '../descriptions';\nimport { formatInputMessages } from '../text/helpers/responses';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Messages',\n\t\tname: 'messages',\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: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Values',\n\t\t\t\tname: 'values',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Role',\n\t\t\t\t\t\tname: 'role',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Role in shaping the model's response, it tells the model how it should behave and interact with the user\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: 'user',\n\t\t\t\t\t\t\t\tdescription: 'Send a message as a user and get a response from the model',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Assistant',\n\t\t\t\t\t\t\t\tvalue: 'assistant',\n\t\t\t\t\t\t\t\tdescription: 'Tell the model to adopt a specific tone or personality',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'System',\n\t\t\t\t\t\t\t\tvalue: 'system',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Usually used to set the model's behavior or context for the next user message\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'user',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t...textMessageProperties[0],\n\t\t\t\t\t\tdisplayOptions: {},\n\t\t\t\t\t},\n\t\t\t\t],\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: [metadataProperty],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['create'],\n\t\tresource: ['conversation'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst options = this.getNodeParameter('options', i, {}) as IDataObject;\n\tconst messages = this.getNodeParameter('messages.values', i, []) as IDataObject[];\n\n\tconst body: IDataObject = {\n\t\titems: await formatInputMessages.call(this, i, messages),\n\t};\n\n\tif (options.metadata) {\n\t\tconst metadata = jsonParse(options.metadata as string, {\n\t\t\terrorMessage: 'Invalid JSON in metadata field',\n\t\t}) as IDataObject;\n\t\tif (!isObjectEmpty(metadata)) {\n\t\t\tbody.metadata = metadata;\n\t\t}\n\t}\n\n\tconst response = await apiRequest.call(this, 'POST', '/conversations', { body });\n\n\treturn [\n\t\t{\n\t\t\tjson: response,\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAA+D;AAE/D,uBAA2B;AAC3B,0BAAwD;AACxD,uBAAoC;AAEpC,MAAM,aAAgC;AAAA,EACrC;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,MACR;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,QAAQ;AAAA,UACP;AAAA,YACC,aAAa;AAAA,YACb,MAAM;AAAA,YACN,MAAM;AAAA,YACN,aACC;AAAA,YACD,SAAS;AAAA,cACR;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aAAa;AAAA,cACd;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aAAa;AAAA,cACd;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aACC;AAAA,cACF;AAAA,YACD;AAAA,YACA,SAAS;AAAA,UACV;AAAA,UACA;AAAA,YACC,GAAG,0CAAsB,CAAC;AAAA,YAC1B,gBAAgB,CAAC;AAAA,UAClB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,IACV,SAAS,CAAC,oCAAgB;AAAA,EAC3B;AACD;AAEA,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,WAAW,CAAC,QAAQ;AAAA,IACpB,UAAU,CAAC,cAAc;AAAA,EAC1B;AACD;AAEO,MAAM,kBAAc,0CAAqB,gBAAgB,UAAU;AAE1E,eAAsB,QAAiC,GAA0C;AAChG,QAAM,UAAU,KAAK,iBAAiB,WAAW,GAAG,CAAC,CAAC;AACtD,QAAM,WAAW,KAAK,iBAAiB,mBAAmB,GAAG,CAAC,CAAC;AAE/D,QAAM,OAAoB;AAAA,IACzB,OAAO,MAAM,qCAAoB,KAAK,MAAM,GAAG,QAAQ;AAAA,EACxD;AAEA,MAAI,QAAQ,UAAU;AACrB,UAAM,eAAW,+BAAU,QAAQ,UAAoB;AAAA,MACtD,cAAc;AAAA,IACf,CAAC;AACD,QAAI,KAAC,mCAAc,QAAQ,GAAG;AAC7B,WAAK,WAAW;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,kBAAkB,EAAE,KAAK,CAAC;AAE/E,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var get_operation_exports = {};
20
+ __export(get_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(get_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_transport = require("../../../transport");
27
+ const properties = [
28
+ {
29
+ displayName: "Conversation ID",
30
+ name: "conversationId",
31
+ type: "string",
32
+ default: "",
33
+ placeholder: "conv_1234567890",
34
+ description: "The ID of the conversation to retrieve",
35
+ required: true
36
+ }
37
+ ];
38
+ const displayOptions = {
39
+ show: {
40
+ operation: ["get"],
41
+ resource: ["conversation"]
42
+ }
43
+ };
44
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
45
+ async function execute(i) {
46
+ const conversationId = this.getNodeParameter("conversationId", i, "");
47
+ const response = await import_transport.apiRequest.call(this, "GET", `/conversations/${conversationId}`);
48
+ return [
49
+ {
50
+ json: response,
51
+ pairedItem: { item: i }
52
+ }
53
+ ];
54
+ }
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ description,
58
+ execute
59
+ });
60
+ //# sourceMappingURL=get.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/conversation/get.operation.ts"],"sourcesContent":["import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Conversation ID',\n\t\tname: 'conversationId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'conv_1234567890',\n\t\tdescription: 'The ID of the conversation to retrieve',\n\t\trequired: true,\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['get'],\n\t\tresource: ['conversation'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst conversationId = this.getNodeParameter('conversationId', i, '') as string;\n\n\tconst response = await apiRequest.call(this, 'GET', `/conversations/${conversationId}`);\n\n\treturn [\n\t\t{\n\t\t\tjson: response,\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqC;AAErC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AACD;AAEA,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,WAAW,CAAC,KAAK;AAAA,IACjB,UAAU,CAAC,cAAc;AAAA,EAC1B;AACD;AAEO,MAAM,kBAAc,0CAAqB,gBAAgB,UAAU;AAE1E,eAAsB,QAAiC,GAA0C;AAChG,QAAM,iBAAiB,KAAK,iBAAiB,kBAAkB,GAAG,EAAE;AAEpE,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,OAAO,kBAAkB,cAAc,EAAE;AAEtF,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,94 @@
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 conversation_exports = {};
30
+ __export(conversation_exports, {
31
+ create: () => create,
32
+ description: () => description,
33
+ get: () => get,
34
+ remove: () => remove,
35
+ update: () => update
36
+ });
37
+ module.exports = __toCommonJS(conversation_exports);
38
+ var create = __toESM(require("./create.operation"));
39
+ var get = __toESM(require("./get.operation"));
40
+ var remove = __toESM(require("./remove.operation"));
41
+ var update = __toESM(require("./update.operation"));
42
+ const description = [
43
+ {
44
+ displayName: "Operation",
45
+ name: "operation",
46
+ type: "options",
47
+ noDataExpression: true,
48
+ options: [
49
+ {
50
+ name: "Create",
51
+ value: "create",
52
+ action: "Create a conversation",
53
+ description: "Create a conversation"
54
+ },
55
+ {
56
+ name: "Get",
57
+ value: "get",
58
+ action: "Get a conversation",
59
+ description: "Get a conversation"
60
+ },
61
+ {
62
+ name: "Remove",
63
+ value: "remove",
64
+ action: "Remove a conversation",
65
+ description: "Remove a conversation"
66
+ },
67
+ {
68
+ name: "Update",
69
+ value: "update",
70
+ action: "Update a conversation",
71
+ description: "Update a conversation"
72
+ }
73
+ ],
74
+ default: "create",
75
+ displayOptions: {
76
+ show: {
77
+ resource: ["conversation"]
78
+ }
79
+ }
80
+ },
81
+ ...create.description,
82
+ ...remove.description,
83
+ ...update.description,
84
+ ...get.description
85
+ ];
86
+ // Annotate the CommonJS export names for ESM import in node:
87
+ 0 && (module.exports = {
88
+ create,
89
+ description,
90
+ get,
91
+ remove,
92
+ update
93
+ });
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/conversation/index.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nimport * as create from './create.operation';\nimport * as get from './get.operation';\nimport * as remove from './remove.operation';\nimport * as update from './update.operation';\n\nexport { create, get, remove, update };\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: 'Create',\n\t\t\t\tvalue: 'create',\n\t\t\t\taction: 'Create a conversation',\n\t\t\t\tdescription: 'Create a conversation',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get',\n\t\t\t\tvalue: 'get',\n\t\t\t\taction: 'Get a conversation',\n\t\t\t\tdescription: 'Get a conversation',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Remove',\n\t\t\t\tvalue: 'remove',\n\t\t\t\taction: 'Remove a conversation',\n\t\t\t\tdescription: 'Remove a conversation',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Update',\n\t\t\t\tvalue: 'update',\n\t\t\t\taction: 'Update a conversation',\n\t\t\t\tdescription: 'Update a conversation',\n\t\t\t},\n\t\t],\n\t\tdefault: 'create',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['conversation'],\n\t\t\t},\n\t\t},\n\t},\n\t...create.description,\n\t...remove.description,\n\t...update.description,\n\t...get.description,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,aAAwB;AACxB,UAAqB;AACrB,aAAwB;AACxB,aAAwB;AAIjB,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,QACR,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,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,cAAc;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAAA,EACA,GAAG,OAAO;AAAA,EACV,GAAG,OAAO;AAAA,EACV,GAAG,OAAO;AAAA,EACV,GAAG,IAAI;AACR;","names":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var remove_operation_exports = {};
20
+ __export(remove_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(remove_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_transport = require("../../../transport");
27
+ const properties = [
28
+ {
29
+ displayName: "Conversation ID",
30
+ name: "conversationId",
31
+ type: "string",
32
+ default: "",
33
+ placeholder: "conv_1234567890",
34
+ description: "The ID of the conversation to delete",
35
+ required: true
36
+ }
37
+ ];
38
+ const displayOptions = {
39
+ show: {
40
+ operation: ["remove"],
41
+ resource: ["conversation"]
42
+ }
43
+ };
44
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
45
+ async function execute(i) {
46
+ const conversationId = this.getNodeParameter("conversationId", i, "");
47
+ const response = await import_transport.apiRequest.call(this, "DELETE", `/conversations/${conversationId}`);
48
+ return [
49
+ {
50
+ json: response,
51
+ pairedItem: { item: i }
52
+ }
53
+ ];
54
+ }
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ description,
58
+ execute
59
+ });
60
+ //# sourceMappingURL=remove.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.ts"],"sourcesContent":["import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Conversation ID',\n\t\tname: 'conversationId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'conv_1234567890',\n\t\tdescription: 'The ID of the conversation to delete',\n\t\trequired: true,\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['remove'],\n\t\tresource: ['conversation'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst conversationId = this.getNodeParameter('conversationId', i, '') as string;\n\n\tconst response = await apiRequest.call(this, 'DELETE', `/conversations/${conversationId}`);\n\n\treturn [\n\t\t{\n\t\t\tjson: response,\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAAqC;AAErC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AACD;AAEA,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,WAAW,CAAC,QAAQ;AAAA,IACpB,UAAU,CAAC,cAAc;AAAA,EAC1B;AACD;AAEO,MAAM,kBAAc,0CAAqB,gBAAgB,UAAU;AAE1E,eAAsB,QAAiC,GAA0C;AAChG,QAAM,iBAAiB,KAAK,iBAAiB,kBAAkB,GAAG,EAAE;AAEpE,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,UAAU,kBAAkB,cAAc,EAAE;AAEzF,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var update_operation_exports = {};
20
+ __export(update_operation_exports, {
21
+ description: () => description,
22
+ execute: () => execute
23
+ });
24
+ module.exports = __toCommonJS(update_operation_exports);
25
+ var import_n8n_workflow = require("n8n-workflow");
26
+ var import_transport = require("../../../transport");
27
+ var import_descriptions = require("../descriptions");
28
+ const properties = [
29
+ {
30
+ displayName: "Conversation ID",
31
+ name: "conversationId",
32
+ type: "string",
33
+ default: "",
34
+ placeholder: "conv_1234567890",
35
+ description: "The ID of the conversation to update",
36
+ required: true
37
+ },
38
+ { ...import_descriptions.metadataProperty, required: true }
39
+ ];
40
+ const displayOptions = {
41
+ show: {
42
+ operation: ["update"],
43
+ resource: ["conversation"]
44
+ }
45
+ };
46
+ const description = (0, import_n8n_workflow.updateDisplayOptions)(displayOptions, properties);
47
+ async function execute(i) {
48
+ const conversationId = this.getNodeParameter("conversationId", i, "");
49
+ const metadata = this.getNodeParameter("metadata", i, "");
50
+ if (!conversationId) {
51
+ throw new Error("Conversation ID is required");
52
+ }
53
+ if (!metadata) {
54
+ throw new Error("Metadata is required");
55
+ }
56
+ const body = {};
57
+ body.metadata = (0, import_n8n_workflow.jsonParse)(metadata, {
58
+ errorMessage: "Invalid JSON in metadata field"
59
+ });
60
+ const response = await import_transport.apiRequest.call(this, "POST", `/conversations/${conversationId}`, {
61
+ body
62
+ });
63
+ return [
64
+ {
65
+ json: response,
66
+ pairedItem: { item: i }
67
+ }
68
+ ];
69
+ }
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ description,
73
+ execute
74
+ });
75
+ //# sourceMappingURL=update.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../nodes/vendors/OpenAi/v2/actions/conversation/update.operation.ts"],"sourcesContent":["import type {\n\tINodeProperties,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n} from 'n8n-workflow';\nimport { updateDisplayOptions, jsonParse } from 'n8n-workflow';\n\nimport { apiRequest } from '../../../transport';\nimport { metadataProperty } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Conversation ID',\n\t\tname: 'conversationId',\n\t\ttype: 'string',\n\t\tdefault: '',\n\t\tplaceholder: 'conv_1234567890',\n\t\tdescription: 'The ID of the conversation to update',\n\t\trequired: true,\n\t},\n\t{ ...metadataProperty, required: true },\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['update'],\n\t\tresource: ['conversation'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst conversationId = this.getNodeParameter('conversationId', i, '') as string;\n\tconst metadata = this.getNodeParameter('metadata', i, '') as string;\n\n\tif (!conversationId) {\n\t\tthrow new Error('Conversation ID is required');\n\t}\n\n\tif (!metadata) {\n\t\tthrow new Error('Metadata is required');\n\t}\n\n\tconst body: IDataObject = {};\n\n\tbody.metadata = jsonParse(metadata, {\n\t\terrorMessage: 'Invalid JSON in metadata field',\n\t});\n\n\tconst response = await apiRequest.call(this, 'POST', `/conversations/${conversationId}`, {\n\t\tbody,\n\t});\n\n\treturn [\n\t\t{\n\t\t\tjson: response,\n\t\t\tpairedItem: { item: i },\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAgD;AAEhD,uBAA2B;AAC3B,0BAAiC;AAEjC,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AAAA,EACA,EAAE,GAAG,sCAAkB,UAAU,KAAK;AACvC;AAEA,MAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,WAAW,CAAC,QAAQ;AAAA,IACpB,UAAU,CAAC,cAAc;AAAA,EAC1B;AACD;AAEO,MAAM,kBAAc,0CAAqB,gBAAgB,UAAU;AAE1E,eAAsB,QAAiC,GAA0C;AAChG,QAAM,iBAAiB,KAAK,iBAAiB,kBAAkB,GAAG,EAAE;AACpE,QAAM,WAAW,KAAK,iBAAiB,YAAY,GAAG,EAAE;AAExD,MAAI,CAAC,gBAAgB;AACpB,UAAM,IAAI,MAAM,6BAA6B;AAAA,EAC9C;AAEA,MAAI,CAAC,UAAU;AACd,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACvC;AAEA,QAAM,OAAoB,CAAC;AAE3B,OAAK,eAAW,+BAAU,UAAU;AAAA,IACnC,cAAc;AAAA,EACf,CAAC;AAED,QAAM,WAAW,MAAM,4BAAW,KAAK,MAAM,QAAQ,kBAAkB,cAAc,IAAI;AAAA,IACxF;AAAA,EACD,CAAC;AAED,SAAO;AAAA,IACN;AAAA,MACC,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB;AAAA,EACD;AACD;","names":[]}