@atom8n/n8n-nodes-langchain 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1000) hide show
  1. package/README.md +9 -0
  2. package/dist/credentials/AnthropicApi.credentials.js +106 -0
  3. package/dist/credentials/AnthropicApi.credentials.js.map +1 -0
  4. package/dist/credentials/AzureAiSearchApi.credentials.js +75 -0
  5. package/dist/credentials/AzureAiSearchApi.credentials.js.map +1 -0
  6. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js +133 -0
  7. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js.map +1 -0
  8. package/dist/credentials/AzureOpenAiApi.credentials.js +74 -0
  9. package/dist/credentials/AzureOpenAiApi.credentials.js.map +1 -0
  10. package/dist/credentials/CohereApi.credentials.js +65 -0
  11. package/dist/credentials/CohereApi.credentials.js.map +1 -0
  12. package/dist/credentials/DeepSeekApi.credentials.js +65 -0
  13. package/dist/credentials/DeepSeekApi.credentials.js.map +1 -0
  14. package/dist/credentials/GooglePalmApi.credentials.js +65 -0
  15. package/dist/credentials/GooglePalmApi.credentials.js.map +1 -0
  16. package/dist/credentials/GroqApi.credentials.js +59 -0
  17. package/dist/credentials/GroqApi.credentials.js.map +1 -0
  18. package/dist/credentials/HuggingFaceApi.credentials.js +59 -0
  19. package/dist/credentials/HuggingFaceApi.credentials.js.map +1 -0
  20. package/dist/credentials/LemonadeApi.credentials.js +70 -0
  21. package/dist/credentials/LemonadeApi.credentials.js.map +1 -0
  22. package/dist/credentials/McpOAuth2Api.credentials.js +44 -0
  23. package/dist/credentials/McpOAuth2Api.credentials.js.map +1 -0
  24. package/dist/credentials/MilvusApi.credentials.js +72 -0
  25. package/dist/credentials/MilvusApi.credentials.js.map +1 -0
  26. package/dist/credentials/MistralCloudApi.credentials.js +60 -0
  27. package/dist/credentials/MistralCloudApi.credentials.js.map +1 -0
  28. package/dist/credentials/MotorheadApi.credentials.js +72 -0
  29. package/dist/credentials/MotorheadApi.credentials.js.map +1 -0
  30. package/dist/credentials/OllamaApi.credentials.js +68 -0
  31. package/dist/credentials/OllamaApi.credentials.js.map +1 -0
  32. package/dist/credentials/OpenRouterApi.credentials.js +65 -0
  33. package/dist/credentials/OpenRouterApi.credentials.js.map +1 -0
  34. package/dist/credentials/PineconeApi.credentials.js +61 -0
  35. package/dist/credentials/PineconeApi.credentials.js.map +1 -0
  36. package/dist/credentials/QdrantApi.credentials.js +66 -0
  37. package/dist/credentials/QdrantApi.credentials.js.map +1 -0
  38. package/dist/credentials/SearXngApi.credentials.js +44 -0
  39. package/dist/credentials/SearXngApi.credentials.js.map +1 -0
  40. package/dist/credentials/SerpApi.credentials.js +59 -0
  41. package/dist/credentials/SerpApi.credentials.js.map +1 -0
  42. package/dist/credentials/VercelAiGatewayApi.credentials.js +81 -0
  43. package/dist/credentials/VercelAiGatewayApi.credentials.js.map +1 -0
  44. package/dist/credentials/WeaviateApi.credentials.js +164 -0
  45. package/dist/credentials/WeaviateApi.credentials.js.map +1 -0
  46. package/dist/credentials/WolframAlphaApi.credentials.js +63 -0
  47. package/dist/credentials/WolframAlphaApi.credentials.js.map +1 -0
  48. package/dist/credentials/XAiApi.credentials.js +65 -0
  49. package/dist/credentials/XAiApi.credentials.js.map +1 -0
  50. package/dist/credentials/XataApi.credentials.js +73 -0
  51. package/dist/credentials/XataApi.credentials.js.map +1 -0
  52. package/dist/credentials/ZepApi.credentials.js +84 -0
  53. package/dist/credentials/ZepApi.credentials.js.map +1 -0
  54. package/dist/known/credentials.json +210 -0
  55. package/dist/known/nodes.json +426 -0
  56. package/dist/methods/defined.json +11 -0
  57. package/dist/methods/referenced.json +11 -0
  58. package/dist/nodes/Guardrails/Guardrails.node.js +62 -0
  59. package/dist/nodes/Guardrails/Guardrails.node.js.map +1 -0
  60. package/dist/nodes/Guardrails/actions/checks/jailbreak.js +50 -0
  61. package/dist/nodes/Guardrails/actions/checks/jailbreak.js.map +1 -0
  62. package/dist/nodes/Guardrails/actions/checks/keywords.js +84 -0
  63. package/dist/nodes/Guardrails/actions/checks/keywords.js.map +1 -0
  64. package/dist/nodes/Guardrails/actions/checks/nsfw.js +53 -0
  65. package/dist/nodes/Guardrails/actions/checks/nsfw.js.map +1 -0
  66. package/dist/nodes/Guardrails/actions/checks/pii.js +232 -0
  67. package/dist/nodes/Guardrails/actions/checks/pii.js.map +1 -0
  68. package/dist/nodes/Guardrails/actions/checks/secretKeys.js +201 -0
  69. package/dist/nodes/Guardrails/actions/checks/secretKeys.js.map +1 -0
  70. package/dist/nodes/Guardrails/actions/checks/topicalAlignment.js +38 -0
  71. package/dist/nodes/Guardrails/actions/checks/topicalAlignment.js.map +1 -0
  72. package/dist/nodes/Guardrails/actions/checks/urls.js +245 -0
  73. package/dist/nodes/Guardrails/actions/checks/urls.js.map +1 -0
  74. package/dist/nodes/Guardrails/actions/execute.js +68 -0
  75. package/dist/nodes/Guardrails/actions/execute.js.map +1 -0
  76. package/dist/nodes/Guardrails/actions/process.js +223 -0
  77. package/dist/nodes/Guardrails/actions/process.js.map +1 -0
  78. package/dist/nodes/Guardrails/actions/types.js +35 -0
  79. package/dist/nodes/Guardrails/actions/types.js.map +1 -0
  80. package/dist/nodes/Guardrails/description.js +415 -0
  81. package/dist/nodes/Guardrails/description.js.map +1 -0
  82. package/dist/nodes/Guardrails/guardrails.svg +11 -0
  83. package/dist/nodes/Guardrails/helpers/base.js +67 -0
  84. package/dist/nodes/Guardrails/helpers/base.js.map +1 -0
  85. package/dist/nodes/Guardrails/helpers/common.js +45 -0
  86. package/dist/nodes/Guardrails/helpers/common.js.map +1 -0
  87. package/dist/nodes/Guardrails/helpers/configureNodeInputs.js +84 -0
  88. package/dist/nodes/Guardrails/helpers/configureNodeInputs.js.map +1 -0
  89. package/dist/nodes/Guardrails/helpers/mappers.js +100 -0
  90. package/dist/nodes/Guardrails/helpers/mappers.js.map +1 -0
  91. package/dist/nodes/Guardrails/helpers/model.js +144 -0
  92. package/dist/nodes/Guardrails/helpers/model.js.map +1 -0
  93. package/dist/nodes/Guardrails/helpers/preflight.js +61 -0
  94. package/dist/nodes/Guardrails/helpers/preflight.js.map +1 -0
  95. package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js +59 -0
  96. package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js.map +1 -0
  97. package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js +59 -0
  98. package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js.map +1 -0
  99. package/dist/nodes/ModelSelector/ModelSelector.node.js +188 -0
  100. package/dist/nodes/ModelSelector/ModelSelector.node.js.map +1 -0
  101. package/dist/nodes/ModelSelector/helpers.js +85 -0
  102. package/dist/nodes/ModelSelector/helpers.js.map +1 -0
  103. package/dist/nodes/ToolExecutor/ToolExecutor.node.js +105 -0
  104. package/dist/nodes/ToolExecutor/ToolExecutor.node.js.map +1 -0
  105. package/dist/nodes/ToolExecutor/ToolExecutor.node.json +17 -0
  106. package/dist/nodes/ToolExecutor/utils/convertToSchema.js +64 -0
  107. package/dist/nodes/ToolExecutor/utils/convertToSchema.js.map +1 -0
  108. package/dist/nodes/ToolExecutor/utils/executeTool.js +39 -0
  109. package/dist/nodes/ToolExecutor/utils/executeTool.js.map +1 -0
  110. package/dist/nodes/agents/Agent/Agent.node.js +79 -0
  111. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -0
  112. package/dist/nodes/agents/Agent/AgentTool.node.js +59 -0
  113. package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -0
  114. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +449 -0
  115. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -0
  116. package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js +104 -0
  117. package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js.map +1 -0
  118. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +153 -0
  119. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -0
  120. package/dist/nodes/agents/Agent/V2/utils.js +92 -0
  121. package/dist/nodes/agents/Agent/V2/utils.js.map +1 -0
  122. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js +99 -0
  123. package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js.map +1 -0
  124. package/dist/nodes/agents/Agent/V3/AgentV3.node.js +141 -0
  125. package/dist/nodes/agents/Agent/V3/AgentV3.node.js.map +1 -0
  126. package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +118 -0
  127. package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -0
  128. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +107 -0
  129. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -0
  130. package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js +50 -0
  131. package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js.map +1 -0
  132. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +108 -0
  133. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -0
  134. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +32 -0
  135. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -0
  136. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js +29 -0
  137. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js.map +1 -0
  138. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js +94 -0
  139. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js.map +1 -0
  140. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js +97 -0
  141. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js.map +1 -0
  142. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js +35 -0
  143. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js.map +1 -0
  144. package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +138 -0
  145. package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -0
  146. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +108 -0
  147. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -0
  148. package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js +41 -0
  149. package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js.map +1 -0
  150. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +227 -0
  151. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -0
  152. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +137 -0
  153. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -0
  154. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js +44 -0
  155. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js.map +1 -0
  156. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js +45 -0
  157. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js.map +1 -0
  158. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js +72 -0
  159. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js.map +1 -0
  160. package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js +49 -0
  161. package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js.map +1 -0
  162. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/description.js +44 -0
  163. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/description.js.map +1 -0
  164. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js +129 -0
  165. package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js.map +1 -0
  166. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +71 -0
  167. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -0
  168. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +295 -0
  169. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -0
  170. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js +57 -0
  171. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js.map +1 -0
  172. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +64 -0
  173. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -0
  174. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildExecutionContext.js +74 -0
  175. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildExecutionContext.js.map +1 -0
  176. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildResponseMetadata.js +37 -0
  177. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildResponseMetadata.js.map +1 -0
  178. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/checkMaxIterations.js +40 -0
  179. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/checkMaxIterations.js.map +1 -0
  180. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js +61 -0
  181. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js.map +1 -0
  182. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js +92 -0
  183. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js.map +1 -0
  184. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/finalizeResult.js +58 -0
  185. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/finalizeResult.js.map +1 -0
  186. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/index.js +50 -0
  187. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/index.js.map +1 -0
  188. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/prepareItemContext.js +66 -0
  189. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/prepareItemContext.js.map +1 -0
  190. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js +91 -0
  191. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js.map +1 -0
  192. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/types.js +17 -0
  193. package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/types.js.map +1 -0
  194. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js +265 -0
  195. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -0
  196. package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js +62 -0
  197. package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js.map +1 -0
  198. package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js +29 -0
  199. package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js.map +1 -0
  200. package/dist/nodes/agents/Agent/agents/utils.js +54 -0
  201. package/dist/nodes/agents/Agent/agents/utils.js.map +1 -0
  202. package/dist/nodes/agents/Agent/utils.js +92 -0
  203. package/dist/nodes/agents/Agent/utils.js.map +1 -0
  204. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +397 -0
  205. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -0
  206. package/dist/nodes/agents/OpenAiAssistant/utils.js +61 -0
  207. package/dist/nodes/agents/OpenAiAssistant/utils.js.map +1 -0
  208. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +152 -0
  209. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -0
  210. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +148 -0
  211. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -0
  212. package/dist/nodes/chains/ChainLLM/methods/config.js +328 -0
  213. package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -0
  214. package/dist/nodes/chains/ChainLLM/methods/imageUtils.js +100 -0
  215. package/dist/nodes/chains/ChainLLM/methods/imageUtils.js.map +1 -0
  216. package/dist/nodes/chains/ChainLLM/methods/index.js +37 -0
  217. package/dist/nodes/chains/ChainLLM/methods/index.js.map +1 -0
  218. package/dist/nodes/chains/ChainLLM/methods/processItem.js +98 -0
  219. package/dist/nodes/chains/ChainLLM/methods/processItem.js.map +1 -0
  220. package/dist/nodes/chains/ChainLLM/methods/promptUtils.js +142 -0
  221. package/dist/nodes/chains/ChainLLM/methods/promptUtils.js.map +1 -0
  222. package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js +53 -0
  223. package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js.map +1 -0
  224. package/dist/nodes/chains/ChainLLM/methods/types.js +17 -0
  225. package/dist/nodes/chains/ChainLLM/methods/types.js.map +1 -0
  226. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +264 -0
  227. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -0
  228. package/dist/nodes/chains/ChainRetrievalQA/constants.js +49 -0
  229. package/dist/nodes/chains/ChainRetrievalQA/constants.js.map +1 -0
  230. package/dist/nodes/chains/ChainRetrievalQA/processItem.js +91 -0
  231. package/dist/nodes/chains/ChainRetrievalQA/processItem.js.map +1 -0
  232. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +64 -0
  233. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -0
  234. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +242 -0
  235. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -0
  236. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +378 -0
  237. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -0
  238. package/dist/nodes/chains/ChainSummarization/V2/processItem.js +95 -0
  239. package/dist/nodes/chains/ChainSummarization/V2/processItem.js.map +1 -0
  240. package/dist/nodes/chains/ChainSummarization/helpers.js +74 -0
  241. package/dist/nodes/chains/ChainSummarization/helpers.js.map +1 -0
  242. package/dist/nodes/chains/ChainSummarization/prompt.js +49 -0
  243. package/dist/nodes/chains/ChainSummarization/prompt.js.map +1 -0
  244. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +315 -0
  245. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -0
  246. package/dist/nodes/chains/InformationExtractor/constants.js +31 -0
  247. package/dist/nodes/chains/InformationExtractor/constants.js.map +1 -0
  248. package/dist/nodes/chains/InformationExtractor/helpers.js +54 -0
  249. package/dist/nodes/chains/InformationExtractor/helpers.js.map +1 -0
  250. package/dist/nodes/chains/InformationExtractor/processItem.js +56 -0
  251. package/dist/nodes/chains/InformationExtractor/processItem.js.map +1 -0
  252. package/dist/nodes/chains/InformationExtractor/types.js +17 -0
  253. package/dist/nodes/chains/InformationExtractor/types.js.map +1 -0
  254. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +366 -0
  255. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -0
  256. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +303 -0
  257. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -0
  258. package/dist/nodes/chains/TextClassifier/constants.js +29 -0
  259. package/dist/nodes/chains/TextClassifier/constants.js.map +1 -0
  260. package/dist/nodes/chains/TextClassifier/processItem.js +65 -0
  261. package/dist/nodes/chains/TextClassifier/processItem.js.map +1 -0
  262. package/dist/nodes/code/Code.node.js +413 -0
  263. package/dist/nodes/code/Code.node.js.map +1 -0
  264. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +203 -0
  265. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -0
  266. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/binary.svg +1 -0
  267. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +348 -0
  268. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -0
  269. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/binary.svg +1 -0
  270. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +182 -0
  271. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -0
  272. package/dist/nodes/document_loaders/DocumentGithubLoader/github.svg +1 -0
  273. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +109 -0
  274. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -0
  275. package/dist/nodes/document_loaders/DocumentJSONInputLoader/json.svg +1 -0
  276. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +155 -0
  277. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -0
  278. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/bedrock.svg +1 -0
  279. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +171 -0
  280. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -0
  281. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg +1 -0
  282. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +131 -0
  283. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -0
  284. package/dist/nodes/embeddings/EmbeddingsCohere/cohere.dark.svg +5 -0
  285. package/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg +5 -0
  286. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +152 -0
  287. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -0
  288. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/google.svg +1 -0
  289. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js +164 -0
  290. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js.map +1 -0
  291. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/google.svg +1 -0
  292. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +134 -0
  293. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -0
  294. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg +1 -0
  295. package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js +87 -0
  296. package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js.map +1 -0
  297. package/dist/nodes/embeddings/EmbeddingsLemonade/lemonade.svg +53 -0
  298. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +170 -0
  299. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -0
  300. package/dist/nodes/embeddings/EmbeddingsMistralCloud/mistral.svg +262 -0
  301. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +82 -0
  302. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -0
  303. package/dist/nodes/embeddings/EmbeddingsOllama/ollama.svg +1 -0
  304. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +274 -0
  305. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -0
  306. package/dist/nodes/embeddings/EmbeddingsOpenAI/openAiLight.dark.svg +3 -0
  307. package/dist/nodes/embeddings/EmbeddingsOpenAI/openAiLight.svg +3 -0
  308. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +344 -0
  309. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -0
  310. package/dist/nodes/llms/LMChatAnthropic/anthropic.png +0 -0
  311. package/dist/nodes/llms/LMChatAnthropic/anthropic.svg +1 -0
  312. package/dist/nodes/llms/LMChatAnthropic/methods/searchModels.js +66 -0
  313. package/dist/nodes/llms/LMChatAnthropic/methods/searchModels.js.map +1 -0
  314. package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js +106 -0
  315. package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js.map +1 -0
  316. package/dist/nodes/llms/LMChatLemonade/lemonade.svg +53 -0
  317. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +92 -0
  318. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -0
  319. package/dist/nodes/llms/LMChatOllama/ollama.svg +1 -0
  320. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +800 -0
  321. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -0
  322. package/dist/nodes/llms/LMChatOpenAi/common.js +155 -0
  323. package/dist/nodes/llms/LMChatOpenAi/common.js.map +1 -0
  324. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +71 -0
  325. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -0
  326. package/dist/nodes/llms/LMChatOpenAi/openAiLight.dark.svg +3 -0
  327. package/dist/nodes/llms/LMChatOpenAi/openAiLight.svg +3 -0
  328. package/dist/nodes/llms/LMChatOpenAi/types.js +17 -0
  329. package/dist/nodes/llms/LMChatOpenAi/types.js.map +1 -0
  330. package/dist/nodes/llms/LMCohere/LmCohere.node.js +122 -0
  331. package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -0
  332. package/dist/nodes/llms/LMCohere/cohere.dark.svg +5 -0
  333. package/dist/nodes/llms/LMCohere/cohere.svg +5 -0
  334. package/dist/nodes/llms/LMLemonade/LmLemonade.node.js +107 -0
  335. package/dist/nodes/llms/LMLemonade/LmLemonade.node.js.map +1 -0
  336. package/dist/nodes/llms/LMLemonade/description.js +147 -0
  337. package/dist/nodes/llms/LMLemonade/description.js.map +1 -0
  338. package/dist/nodes/llms/LMLemonade/lemonade.svg +53 -0
  339. package/dist/nodes/llms/LMOllama/LmOllama.node.js +91 -0
  340. package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -0
  341. package/dist/nodes/llms/LMOllama/description.js +242 -0
  342. package/dist/nodes/llms/LMOllama/description.js.map +1 -0
  343. package/dist/nodes/llms/LMOllama/ollama.svg +1 -0
  344. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +255 -0
  345. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -0
  346. package/dist/nodes/llms/LMOpenAi/openAiLight.dark.svg +3 -0
  347. package/dist/nodes/llms/LMOpenAi/openAiLight.svg +3 -0
  348. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +162 -0
  349. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -0
  350. package/dist/nodes/llms/LMOpenHuggingFaceInference/huggingface.svg +1 -0
  351. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +272 -0
  352. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -0
  353. package/dist/nodes/llms/LmChatAwsBedrock/bedrock.svg +1 -0
  354. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +149 -0
  355. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -0
  356. package/dist/nodes/llms/LmChatAzureOpenAi/azure.svg +1 -0
  357. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js +75 -0
  358. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js.map +1 -0
  359. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/api-key.js +53 -0
  360. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/api-key.js.map +1 -0
  361. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/oauth2.js +54 -0
  362. package/dist/nodes/llms/LmChatAzureOpenAi/credentials/oauth2.js.map +1 -0
  363. package/dist/nodes/llms/LmChatAzureOpenAi/properties.js +155 -0
  364. package/dist/nodes/llms/LmChatAzureOpenAi/properties.js.map +1 -0
  365. package/dist/nodes/llms/LmChatAzureOpenAi/types.js +42 -0
  366. package/dist/nodes/llms/LmChatAzureOpenAi/types.js.map +1 -0
  367. package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js +181 -0
  368. package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js.map +1 -0
  369. package/dist/nodes/llms/LmChatCohere/cohere.dark.svg +5 -0
  370. package/dist/nodes/llms/LmChatCohere/cohere.svg +5 -0
  371. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +248 -0
  372. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -0
  373. package/dist/nodes/llms/LmChatDeepSeek/deepseek.svg +1 -0
  374. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +171 -0
  375. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -0
  376. package/dist/nodes/llms/LmChatGoogleGemini/google.svg +1 -0
  377. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +214 -0
  378. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -0
  379. package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js +40 -0
  380. package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js.map +1 -0
  381. package/dist/nodes/llms/LmChatGoogleVertex/google.svg +1 -0
  382. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +166 -0
  383. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -0
  384. package/dist/nodes/llms/LmChatGroq/groq.svg +20 -0
  385. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +222 -0
  386. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -0
  387. package/dist/nodes/llms/LmChatMistralCloud/mistral.svg +262 -0
  388. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +248 -0
  389. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -0
  390. package/dist/nodes/llms/LmChatOpenRouter/openrouter.dark.svg +1 -0
  391. package/dist/nodes/llms/LmChatOpenRouter/openrouter.svg +1 -0
  392. package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js +248 -0
  393. package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js.map +1 -0
  394. package/dist/nodes/llms/LmChatVercelAiGateway/vercel.dark.svg +1 -0
  395. package/dist/nodes/llms/LmChatVercelAiGateway/vercel.svg +6 -0
  396. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +251 -0
  397. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -0
  398. package/dist/nodes/llms/LmChatXAiGrok/logo.dark.svg +1 -0
  399. package/dist/nodes/llms/LmChatXAiGrok/logo.svg +1 -0
  400. package/dist/nodes/llms/N8nLlmTracing.js +202 -0
  401. package/dist/nodes/llms/N8nLlmTracing.js.map +1 -0
  402. package/dist/nodes/llms/N8nNonEstimatingTracing.js +167 -0
  403. package/dist/nodes/llms/N8nNonEstimatingTracing.js.map +1 -0
  404. package/dist/nodes/llms/gemini-common/additional-options.js +126 -0
  405. package/dist/nodes/llms/gemini-common/additional-options.js.map +1 -0
  406. package/dist/nodes/llms/gemini-common/safety-options.js +79 -0
  407. package/dist/nodes/llms/gemini-common/safety-options.js.map +1 -0
  408. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +66 -0
  409. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +1 -0
  410. package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js +50 -0
  411. package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js.map +1 -0
  412. package/dist/nodes/mcp/McpClient/McpClient.node.js +335 -0
  413. package/dist/nodes/mcp/McpClient/McpClient.node.js.map +1 -0
  414. package/dist/nodes/mcp/McpClient/listSearch.js +58 -0
  415. package/dist/nodes/mcp/McpClient/listSearch.js.map +1 -0
  416. package/dist/nodes/mcp/McpClient/resourceMapping.js +61 -0
  417. package/dist/nodes/mcp/McpClient/resourceMapping.js.map +1 -0
  418. package/dist/nodes/mcp/McpClient/utils.js +248 -0
  419. package/dist/nodes/mcp/McpClient/utils.js.map +1 -0
  420. package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js +402 -0
  421. package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -0
  422. package/dist/nodes/mcp/McpClientTool/loadOptions.js +61 -0
  423. package/dist/nodes/mcp/McpClientTool/loadOptions.js.map +1 -0
  424. package/dist/nodes/mcp/McpClientTool/types.js +17 -0
  425. package/dist/nodes/mcp/McpClientTool/types.js.map +1 -0
  426. package/dist/nodes/mcp/McpClientTool/utils.js +120 -0
  427. package/dist/nodes/mcp/McpClientTool/utils.js.map +1 -0
  428. package/dist/nodes/mcp/McpTrigger/FlushingTransport.js +60 -0
  429. package/dist/nodes/mcp/McpTrigger/FlushingTransport.js.map +1 -0
  430. package/dist/nodes/mcp/McpTrigger/McpServer.js +255 -0
  431. package/dist/nodes/mcp/McpTrigger/McpServer.js.map +1 -0
  432. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js +199 -0
  433. package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js.map +1 -0
  434. package/dist/nodes/mcp/mcp.dark.svg +7 -0
  435. package/dist/nodes/mcp/mcp.svg +7 -0
  436. package/dist/nodes/mcp/shared/descriptions.js +89 -0
  437. package/dist/nodes/mcp/shared/descriptions.js.map +1 -0
  438. package/dist/nodes/mcp/shared/types.js +17 -0
  439. package/dist/nodes/mcp/shared/types.js.map +1 -0
  440. package/dist/nodes/mcp/shared/utils.js +231 -0
  441. package/dist/nodes/mcp/shared/utils.js.map +1 -0
  442. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +163 -0
  443. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -0
  444. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +116 -0
  445. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -0
  446. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +387 -0
  447. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -0
  448. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js +156 -0
  449. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js.map +1 -0
  450. package/dist/nodes/memory/MemoryMongoDbChat/mongodb.dark.svg +3 -0
  451. package/dist/nodes/memory/MemoryMongoDbChat/mongodb.svg +3 -0
  452. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +134 -0
  453. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -0
  454. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +123 -0
  455. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -0
  456. package/dist/nodes/memory/MemoryPostgresChat/postgres.svg +1 -0
  457. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +179 -0
  458. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -0
  459. package/dist/nodes/memory/MemoryRedisChat/redis.svg +1 -0
  460. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +160 -0
  461. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -0
  462. package/dist/nodes/memory/MemoryXata/xata.svg +1 -0
  463. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +175 -0
  464. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -0
  465. package/dist/nodes/memory/MemoryZep/zep.png +0 -0
  466. package/dist/nodes/memory/descriptions.js +85 -0
  467. package/dist/nodes/memory/descriptions.js.map +1 -0
  468. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +133 -0
  469. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -0
  470. package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js +44 -0
  471. package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js.map +1 -0
  472. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +106 -0
  473. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -0
  474. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +239 -0
  475. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -0
  476. package/dist/nodes/output_parser/OutputParserStructured/prompt.js +44 -0
  477. package/dist/nodes/output_parser/OutputParserStructured/prompt.js.map +1 -0
  478. package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js +116 -0
  479. package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js.map +1 -0
  480. package/dist/nodes/rerankers/RerankerCohere/cohere.dark.svg +5 -0
  481. package/dist/nodes/rerankers/RerankerCohere/cohere.svg +5 -0
  482. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +102 -0
  483. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -0
  484. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +121 -0
  485. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -0
  486. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +100 -0
  487. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -0
  488. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +429 -0
  489. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -0
  490. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +103 -0
  491. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -0
  492. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +139 -0
  493. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -0
  494. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +97 -0
  495. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -0
  496. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js +86 -0
  497. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js.map +1 -0
  498. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +94 -0
  499. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -0
  500. package/dist/nodes/tools/ToolCode/ToolCode.node.js +325 -0
  501. package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -0
  502. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +396 -0
  503. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -0
  504. package/dist/nodes/tools/ToolHttpRequest/descriptions.js +426 -0
  505. package/dist/nodes/tools/ToolHttpRequest/descriptions.js.map +1 -0
  506. package/dist/nodes/tools/ToolHttpRequest/httprequest.dark.svg +3 -0
  507. package/dist/nodes/tools/ToolHttpRequest/httprequest.svg +1 -0
  508. package/dist/nodes/tools/ToolHttpRequest/interfaces.js +17 -0
  509. package/dist/nodes/tools/ToolHttpRequest/interfaces.js.map +1 -0
  510. package/dist/nodes/tools/ToolHttpRequest/utils.js +651 -0
  511. package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -0
  512. package/dist/nodes/tools/ToolSearXng/ToolSearXng.node.js +155 -0
  513. package/dist/nodes/tools/ToolSearXng/ToolSearXng.node.js.map +1 -0
  514. package/dist/nodes/tools/ToolSearXng/searXng.svg +1 -0
  515. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +163 -0
  516. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -0
  517. package/dist/nodes/tools/ToolSerpApi/serpApi.svg +1 -0
  518. package/dist/nodes/tools/ToolThink/ToolThink.node.js +118 -0
  519. package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -0
  520. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +161 -0
  521. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -0
  522. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +93 -0
  523. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -0
  524. package/dist/nodes/tools/ToolWikipedia/wikipedia.svg +1 -0
  525. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +95 -0
  526. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -0
  527. package/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg +1 -0
  528. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +68 -0
  529. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -0
  530. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js +202 -0
  531. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js.map +1 -0
  532. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +347 -0
  533. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -0
  534. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +87 -0
  535. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -0
  536. package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js +39 -0
  537. package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js.map +1 -0
  538. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js +47 -0
  539. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js.map +1 -0
  540. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +308 -0
  541. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -0
  542. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js +172 -0
  543. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -0
  544. package/dist/nodes/trigger/ChatTrigger/Chat.node.js +277 -0
  545. package/dist/nodes/trigger/ChatTrigger/Chat.node.js.map +1 -0
  546. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +813 -0
  547. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -0
  548. package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js +78 -0
  549. package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js.map +1 -0
  550. package/dist/nodes/trigger/ChatTrigger/constants.js +149 -0
  551. package/dist/nodes/trigger/ChatTrigger/constants.js.map +1 -0
  552. package/dist/nodes/trigger/ChatTrigger/error.js +43 -0
  553. package/dist/nodes/trigger/ChatTrigger/error.js.map +1 -0
  554. package/dist/nodes/trigger/ChatTrigger/templates.js +175 -0
  555. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -0
  556. package/dist/nodes/trigger/ChatTrigger/types.js +38 -0
  557. package/dist/nodes/trigger/ChatTrigger/types.js.map +1 -0
  558. package/dist/nodes/trigger/ChatTrigger/util.js +82 -0
  559. package/dist/nodes/trigger/ChatTrigger/util.js.map +1 -0
  560. package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +91 -0
  561. package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -0
  562. package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js +388 -0
  563. package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js.map +1 -0
  564. package/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg +1 -0
  565. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +179 -0
  566. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -0
  567. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +120 -0
  568. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -0
  569. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +94 -0
  570. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -0
  571. package/dist/nodes/vector_store/VectorStoreMilvus/VectorStoreMilvus.node.js +106 -0
  572. package/dist/nodes/vector_store/VectorStoreMilvus/VectorStoreMilvus.node.js.map +1 -0
  573. package/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-black.svg +1 -0
  574. package/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-white.svg +1 -0
  575. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js +380 -0
  576. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js.map +1 -0
  577. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/mongodb.dark.svg +3 -0
  578. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/mongodb.svg +3 -0
  579. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +283 -0
  580. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -0
  581. package/dist/nodes/vector_store/VectorStorePGVector/postgres.svg +1 -0
  582. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js +141 -0
  583. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js.map +1 -0
  584. package/dist/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg +21 -0
  585. package/dist/nodes/vector_store/VectorStorePinecone/pinecone.svg +21 -0
  586. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +143 -0
  587. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -0
  588. package/dist/nodes/vector_store/VectorStorePineconeInsert/pinecone.svg +1 -0
  589. package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +129 -0
  590. package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -0
  591. package/dist/nodes/vector_store/VectorStorePineconeLoad/pinecone.svg +1 -0
  592. package/dist/nodes/vector_store/VectorStoreQdrant/Qdrant.utils.js +54 -0
  593. package/dist/nodes/vector_store/VectorStoreQdrant/Qdrant.utils.js.map +1 -0
  594. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +172 -0
  595. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -0
  596. package/dist/nodes/vector_store/VectorStoreQdrant/qdrant.svg +25 -0
  597. package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js +339 -0
  598. package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js.map +1 -0
  599. package/dist/nodes/vector_store/VectorStoreRedis/redis.dark.svg +37 -0
  600. package/dist/nodes/vector_store/VectorStoreRedis/redis.svg +37 -0
  601. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js +129 -0
  602. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js.map +1 -0
  603. package/dist/nodes/vector_store/VectorStoreSupabase/supabase.svg +1 -0
  604. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +133 -0
  605. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -0
  606. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/supabase.svg +1 -0
  607. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +125 -0
  608. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -0
  609. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/supabase.svg +1 -0
  610. package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js +242 -0
  611. package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js.map +1 -0
  612. package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js +127 -0
  613. package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js.map +1 -0
  614. package/dist/nodes/vector_store/VectorStoreWeaviate/weaviate.svg +2 -0
  615. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js +151 -0
  616. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js.map +1 -0
  617. package/dist/nodes/vector_store/VectorStoreZep/zep.png +0 -0
  618. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +152 -0
  619. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -0
  620. package/dist/nodes/vector_store/VectorStoreZepInsert/zep.png +0 -0
  621. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +132 -0
  622. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -0
  623. package/dist/nodes/vector_store/VectorStoreZepLoad/zep.png +0 -0
  624. package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js +78 -0
  625. package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +1 -0
  626. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +237 -0
  627. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +1 -0
  628. package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js +128 -0
  629. package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +1 -0
  630. package/dist/nodes/vector_store/shared/MemoryManager/config.js +62 -0
  631. package/dist/nodes/vector_store/shared/MemoryManager/config.js.map +1 -0
  632. package/dist/nodes/vector_store/shared/MemoryManager/types.js +17 -0
  633. package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +1 -0
  634. package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +71 -0
  635. package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +1 -0
  636. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +320 -0
  637. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -0
  638. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +109 -0
  639. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -0
  640. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +33 -0
  641. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -0
  642. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +64 -0
  643. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -0
  644. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +80 -0
  645. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -0
  646. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js +98 -0
  647. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js.map +1 -0
  648. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +95 -0
  649. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -0
  650. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +55 -0
  651. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -0
  652. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +69 -0
  653. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -0
  654. package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +17 -0
  655. package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +1 -0
  656. package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +48 -0
  657. package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +1 -0
  658. package/dist/nodes/vector_store/shared/descriptions.js +146 -0
  659. package/dist/nodes/vector_store/shared/descriptions.js.map +1 -0
  660. package/dist/nodes/vector_store/shared/processDocuments.js +65 -0
  661. package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
  662. package/dist/nodes/vendors/Anthropic/Anthropic.node.js +42 -0
  663. package/dist/nodes/vendors/Anthropic/Anthropic.node.js.map +1 -0
  664. package/dist/nodes/vendors/Anthropic/actions/descriptions.js +52 -0
  665. package/dist/nodes/vendors/Anthropic/actions/descriptions.js.map +1 -0
  666. package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js +125 -0
  667. package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js.map +1 -0
  668. package/dist/nodes/vendors/Anthropic/actions/document/index.js +64 -0
  669. package/dist/nodes/vendors/Anthropic/actions/document/index.js.map +1 -0
  670. package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js +61 -0
  671. package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js.map +1 -0
  672. package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js +63 -0
  673. package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js.map +1 -0
  674. package/dist/nodes/vendors/Anthropic/actions/file/index.js +94 -0
  675. package/dist/nodes/vendors/Anthropic/actions/file/index.js.map +1 -0
  676. package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js +108 -0
  677. package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js.map +1 -0
  678. package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js +126 -0
  679. package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js.map +1 -0
  680. package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js +125 -0
  681. package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js.map +1 -0
  682. package/dist/nodes/vendors/Anthropic/actions/image/index.js +64 -0
  683. package/dist/nodes/vendors/Anthropic/actions/image/index.js.map +1 -0
  684. package/dist/nodes/vendors/Anthropic/actions/node.type.js +17 -0
  685. package/dist/nodes/vendors/Anthropic/actions/node.type.js.map +1 -0
  686. package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js +87 -0
  687. package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js.map +1 -0
  688. package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js +154 -0
  689. package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js.map +1 -0
  690. package/dist/nodes/vendors/Anthropic/actions/prompt/index.js +95 -0
  691. package/dist/nodes/vendors/Anthropic/actions/prompt/index.js.map +1 -0
  692. package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js +146 -0
  693. package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js.map +1 -0
  694. package/dist/nodes/vendors/Anthropic/actions/router.js +93 -0
  695. package/dist/nodes/vendors/Anthropic/actions/router.js.map +1 -0
  696. package/dist/nodes/vendors/Anthropic/actions/text/index.js +64 -0
  697. package/dist/nodes/vendors/Anthropic/actions/text/index.js.map +1 -0
  698. package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js +540 -0
  699. package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js.map +1 -0
  700. package/dist/nodes/vendors/Anthropic/actions/versionDescription.js +125 -0
  701. package/dist/nodes/vendors/Anthropic/actions/versionDescription.js.map +1 -0
  702. package/dist/nodes/vendors/Anthropic/anthropic.svg +1 -0
  703. package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js +109 -0
  704. package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js.map +1 -0
  705. package/dist/nodes/vendors/Anthropic/helpers/interfaces.js +17 -0
  706. package/dist/nodes/vendors/Anthropic/helpers/interfaces.js.map +1 -0
  707. package/dist/nodes/vendors/Anthropic/helpers/utils.js +84 -0
  708. package/dist/nodes/vendors/Anthropic/helpers/utils.js.map +1 -0
  709. package/dist/nodes/vendors/Anthropic/methods/index.js +39 -0
  710. package/dist/nodes/vendors/Anthropic/methods/index.js.map +1 -0
  711. package/dist/nodes/vendors/Anthropic/methods/listSearch.js +42 -0
  712. package/dist/nodes/vendors/Anthropic/methods/listSearch.js.map +1 -0
  713. package/dist/nodes/vendors/Anthropic/transport/index.js +61 -0
  714. package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -0
  715. package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js +42 -0
  716. package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js.map +1 -0
  717. package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js +125 -0
  718. package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js.map +1 -0
  719. package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js +74 -0
  720. package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js.map +1 -0
  721. package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js +184 -0
  722. package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js.map +1 -0
  723. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js +52 -0
  724. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js.map +1 -0
  725. package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js +125 -0
  726. package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js.map +1 -0
  727. package/dist/nodes/vendors/GoogleGemini/actions/document/index.js +64 -0
  728. package/dist/nodes/vendors/GoogleGemini/actions/document/index.js.map +1 -0
  729. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +64 -0
  730. package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -0
  731. package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js +102 -0
  732. package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js.map +1 -0
  733. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js +64 -0
  734. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js.map +1 -0
  735. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js +72 -0
  736. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js.map +1 -0
  737. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js +94 -0
  738. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js.map +1 -0
  739. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js +75 -0
  740. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js.map +1 -0
  741. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js +129 -0
  742. package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js.map +1 -0
  743. package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js +125 -0
  744. package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js.map +1 -0
  745. package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js +211 -0
  746. package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js.map +1 -0
  747. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +168 -0
  748. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -0
  749. package/dist/nodes/vendors/GoogleGemini/actions/image/index.js +84 -0
  750. package/dist/nodes/vendors/GoogleGemini/actions/image/index.js.map +1 -0
  751. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js +17 -0
  752. package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -0
  753. package/dist/nodes/vendors/GoogleGemini/actions/router.js +101 -0
  754. package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -0
  755. package/dist/nodes/vendors/GoogleGemini/actions/text/index.js +64 -0
  756. package/dist/nodes/vendors/GoogleGemini/actions/text/index.js.map +1 -0
  757. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +547 -0
  758. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -0
  759. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +138 -0
  760. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -0
  761. package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js +125 -0
  762. package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js.map +1 -0
  763. package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js +88 -0
  764. package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js.map +1 -0
  765. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js +228 -0
  766. package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js.map +1 -0
  767. package/dist/nodes/vendors/GoogleGemini/actions/video/index.js +84 -0
  768. package/dist/nodes/vendors/GoogleGemini/actions/video/index.js.map +1 -0
  769. package/dist/nodes/vendors/GoogleGemini/gemini.svg +1 -0
  770. package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js +106 -0
  771. package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js.map +1 -0
  772. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js +29 -0
  773. package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -0
  774. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +272 -0
  775. package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -0
  776. package/dist/nodes/vendors/GoogleGemini/methods/index.js +39 -0
  777. package/dist/nodes/vendors/GoogleGemini/methods/index.js.map +1 -0
  778. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +94 -0
  779. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -0
  780. package/dist/nodes/vendors/GoogleGemini/transport/index.js +48 -0
  781. package/dist/nodes/vendors/GoogleGemini/transport/index.js.map +1 -0
  782. package/dist/nodes/vendors/Ollama/Ollama.node.js +42 -0
  783. package/dist/nodes/vendors/Ollama/Ollama.node.js.map +1 -0
  784. package/dist/nodes/vendors/Ollama/actions/descriptions.js +52 -0
  785. package/dist/nodes/vendors/Ollama/actions/descriptions.js.map +1 -0
  786. package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js +412 -0
  787. package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js.map +1 -0
  788. package/dist/nodes/vendors/Ollama/actions/image/index.js +64 -0
  789. package/dist/nodes/vendors/Ollama/actions/image/index.js.map +1 -0
  790. package/dist/nodes/vendors/Ollama/actions/node.type.js +17 -0
  791. package/dist/nodes/vendors/Ollama/actions/node.type.js.map +1 -0
  792. package/dist/nodes/vendors/Ollama/actions/router.js +78 -0
  793. package/dist/nodes/vendors/Ollama/actions/router.js.map +1 -0
  794. package/dist/nodes/vendors/Ollama/actions/text/index.js +64 -0
  795. package/dist/nodes/vendors/Ollama/actions/text/index.js.map +1 -0
  796. package/dist/nodes/vendors/Ollama/actions/text/message.operation.js +440 -0
  797. package/dist/nodes/vendors/Ollama/actions/text/message.operation.js.map +1 -0
  798. package/dist/nodes/vendors/Ollama/actions/versionDescription.js +107 -0
  799. package/dist/nodes/vendors/Ollama/actions/versionDescription.js.map +1 -0
  800. package/dist/nodes/vendors/Ollama/helpers/index.js +17 -0
  801. package/dist/nodes/vendors/Ollama/helpers/index.js.map +1 -0
  802. package/dist/nodes/vendors/Ollama/helpers/interfaces.js +17 -0
  803. package/dist/nodes/vendors/Ollama/helpers/interfaces.js.map +1 -0
  804. package/dist/nodes/vendors/Ollama/methods/index.js +39 -0
  805. package/dist/nodes/vendors/Ollama/methods/index.js.map +1 -0
  806. package/dist/nodes/vendors/Ollama/methods/listSearch.js +39 -0
  807. package/dist/nodes/vendors/Ollama/methods/listSearch.js.map +1 -0
  808. package/dist/nodes/vendors/Ollama/ollama.svg +1 -0
  809. package/dist/nodes/vendors/Ollama/transport/index.js +56 -0
  810. package/dist/nodes/vendors/Ollama/transport/index.js.map +1 -0
  811. package/dist/nodes/vendors/OpenAi/OpenAi.node.js +83 -0
  812. package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -0
  813. package/dist/nodes/vendors/OpenAi/helpers/binary-data.js +38 -0
  814. package/dist/nodes/vendors/OpenAi/helpers/binary-data.js.map +1 -0
  815. package/dist/nodes/vendors/OpenAi/helpers/constants.js +50 -0
  816. package/dist/nodes/vendors/OpenAi/helpers/constants.js.map +1 -0
  817. package/dist/nodes/vendors/OpenAi/helpers/description.js +75 -0
  818. package/dist/nodes/vendors/OpenAi/helpers/description.js.map +1 -0
  819. package/dist/nodes/vendors/OpenAi/helpers/error-handling.js +52 -0
  820. package/dist/nodes/vendors/OpenAi/helpers/error-handling.js.map +1 -0
  821. package/dist/nodes/vendors/OpenAi/helpers/interfaces.js +17 -0
  822. package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -0
  823. package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js +34 -0
  824. package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js.map +1 -0
  825. package/dist/nodes/vendors/OpenAi/helpers/polling.js +52 -0
  826. package/dist/nodes/vendors/OpenAi/helpers/polling.js.map +1 -0
  827. package/dist/nodes/vendors/OpenAi/helpers/utils.js +98 -0
  828. package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -0
  829. package/dist/nodes/vendors/OpenAi/methods/index.js +42 -0
  830. package/dist/nodes/vendors/OpenAi/methods/index.js.map +1 -0
  831. package/dist/nodes/vendors/OpenAi/methods/listSearch.js +138 -0
  832. package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -0
  833. package/dist/nodes/vendors/OpenAi/methods/loadOptions.js +40 -0
  834. package/dist/nodes/vendors/OpenAi/methods/loadOptions.js.map +1 -0
  835. package/dist/nodes/vendors/OpenAi/openAi.dark.svg +3 -0
  836. package/dist/nodes/vendors/OpenAi/openAi.svg +3 -0
  837. package/dist/nodes/vendors/OpenAi/transport/index.js +55 -0
  838. package/dist/nodes/vendors/OpenAi/transport/index.js.map +1 -0
  839. package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js +110 -0
  840. package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js.map +1 -0
  841. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js +284 -0
  842. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js.map +1 -0
  843. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js +55 -0
  844. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js.map +1 -0
  845. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js +104 -0
  846. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js.map +1 -0
  847. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js +92 -0
  848. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js.map +1 -0
  849. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js +278 -0
  850. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -0
  851. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js +230 -0
  852. package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js.map +1 -0
  853. package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js +197 -0
  854. package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js.map +1 -0
  855. package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js +96 -0
  856. package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js.map +1 -0
  857. package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js +121 -0
  858. package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js.map +1 -0
  859. package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js +111 -0
  860. package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js.map +1 -0
  861. package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js +79 -0
  862. package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js.map +1 -0
  863. package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js +84 -0
  864. package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js.map +1 -0
  865. package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js +84 -0
  866. package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js.map +1 -0
  867. package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js +83 -0
  868. package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js.map +1 -0
  869. package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js +122 -0
  870. package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js.map +1 -0
  871. package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js +221 -0
  872. package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js.map +1 -0
  873. package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js +319 -0
  874. package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js.map +1 -0
  875. package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js +74 -0
  876. package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js.map +1 -0
  877. package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js +17 -0
  878. package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js.map +1 -0
  879. package/dist/nodes/vendors/OpenAi/v1/actions/router.js +107 -0
  880. package/dist/nodes/vendors/OpenAi/v1/actions/router.js.map +1 -0
  881. package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js +102 -0
  882. package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js.map +1 -0
  883. package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js +75 -0
  884. package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js.map +1 -0
  885. package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js +352 -0
  886. package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js.map +1 -0
  887. package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js +116 -0
  888. package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js.map +1 -0
  889. package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js +197 -0
  890. package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js.map +1 -0
  891. package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js +96 -0
  892. package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js.map +1 -0
  893. package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js +121 -0
  894. package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js.map +1 -0
  895. package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js +111 -0
  896. package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js.map +1 -0
  897. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js +120 -0
  898. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js.map +1 -0
  899. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js +60 -0
  900. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js.map +1 -0
  901. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js +94 -0
  902. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js.map +1 -0
  903. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js +60 -0
  904. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js.map +1 -0
  905. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js +75 -0
  906. package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js.map +1 -0
  907. package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js +279 -0
  908. package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js.map +1 -0
  909. package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js +84 -0
  910. package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js.map +1 -0
  911. package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js +84 -0
  912. package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js.map +1 -0
  913. package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js +92 -0
  914. package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js.map +1 -0
  915. package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js +130 -0
  916. package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js.map +1 -0
  917. package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js +211 -0
  918. package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js.map +1 -0
  919. package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js +464 -0
  920. package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js.map +1 -0
  921. package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js +319 -0
  922. package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js.map +1 -0
  923. package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js +84 -0
  924. package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js.map +1 -0
  925. package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js +17 -0
  926. package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js.map +1 -0
  927. package/dist/nodes/vendors/OpenAi/v2/actions/router.js +111 -0
  928. package/dist/nodes/vendors/OpenAi/v2/actions/router.js.map +1 -0
  929. package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js +111 -0
  930. package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js.map +1 -0
  931. package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js +253 -0
  932. package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js.map +1 -0
  933. package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js +75 -0
  934. package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js.map +1 -0
  935. package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js +701 -0
  936. package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js.map +1 -0
  937. package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js +199 -0
  938. package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js.map +1 -0
  939. package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js +64 -0
  940. package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js.map +1 -0
  941. package/dist/types/credentials.json +28 -0
  942. package/dist/types/nodes.json +115 -0
  943. package/dist/types/types.js +17 -0
  944. package/dist/types/types.js.map +1 -0
  945. package/dist/types/zod.types.js +17 -0
  946. package/dist/types/zod.types.js.map +1 -0
  947. package/dist/utils/N8nBinaryLoader.js +203 -0
  948. package/dist/utils/N8nBinaryLoader.js.map +1 -0
  949. package/dist/utils/N8nJsonLoader.js +89 -0
  950. package/dist/utils/N8nJsonLoader.js.map +1 -0
  951. package/dist/utils/N8nTool.js +106 -0
  952. package/dist/utils/N8nTool.js.map +1 -0
  953. package/dist/utils/agent-execution/buildSteps.js +153 -0
  954. package/dist/utils/agent-execution/buildSteps.js.map +1 -0
  955. package/dist/utils/agent-execution/createEngineRequests.js +88 -0
  956. package/dist/utils/agent-execution/createEngineRequests.js.map +1 -0
  957. package/dist/utils/agent-execution/index.js +42 -0
  958. package/dist/utils/agent-execution/index.js.map +1 -0
  959. package/dist/utils/agent-execution/memoryManagement.js +67 -0
  960. package/dist/utils/agent-execution/memoryManagement.js.map +1 -0
  961. package/dist/utils/agent-execution/processEventStream.js +82 -0
  962. package/dist/utils/agent-execution/processEventStream.js.map +1 -0
  963. package/dist/utils/agent-execution/types.js +41 -0
  964. package/dist/utils/agent-execution/types.js.map +1 -0
  965. package/dist/utils/descriptions.js +212 -0
  966. package/dist/utils/descriptions.js.map +1 -0
  967. package/dist/utils/embeddings/embeddingInputValidation.js +55 -0
  968. package/dist/utils/embeddings/embeddingInputValidation.js.map +1 -0
  969. package/dist/utils/fromAIToolFactory.js +61 -0
  970. package/dist/utils/fromAIToolFactory.js.map +1 -0
  971. package/dist/utils/helpers.js +254 -0
  972. package/dist/utils/helpers.js.map +1 -0
  973. package/dist/utils/httpProxyAgent.js +69 -0
  974. package/dist/utils/httpProxyAgent.js.map +1 -0
  975. package/dist/utils/logWrapper.js +376 -0
  976. package/dist/utils/logWrapper.js.map +1 -0
  977. package/dist/utils/output_parsers/N8nItemListOutputParser.js +64 -0
  978. package/dist/utils/output_parsers/N8nItemListOutputParser.js.map +1 -0
  979. package/dist/utils/output_parsers/N8nOutputFixingParser.js +99 -0
  980. package/dist/utils/output_parsers/N8nOutputFixingParser.js.map +1 -0
  981. package/dist/utils/output_parsers/N8nOutputParser.js +48 -0
  982. package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -0
  983. package/dist/utils/output_parsers/N8nStructuredOutputParser.js +127 -0
  984. package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -0
  985. package/dist/utils/output_parsers/prompt.js +48 -0
  986. package/dist/utils/output_parsers/prompt.js.map +1 -0
  987. package/dist/utils/schemaParsing.js +75 -0
  988. package/dist/utils/schemaParsing.js.map +1 -0
  989. package/dist/utils/sharedFields.js +176 -0
  990. package/dist/utils/sharedFields.js.map +1 -0
  991. package/dist/utils/tokenizer/cl100k_base.json +1 -0
  992. package/dist/utils/tokenizer/o200k_base.json +1 -0
  993. package/dist/utils/tokenizer/tiktoken.js +65 -0
  994. package/dist/utils/tokenizer/tiktoken.js.map +1 -0
  995. package/dist/utils/tokenizer/token-estimator.js +119 -0
  996. package/dist/utils/tokenizer/token-estimator.js.map +1 -0
  997. package/dist/utils/tracing.js +41 -0
  998. package/dist/utils/tracing.js.map +1 -0
  999. package/index.js +0 -0
  1000. package/package.json +255 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/ChainLLM/ChainLlm.node.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { NodeApiError, NodeConnectionTypes, NodeOperationError, sleep } from 'n8n-workflow';\n\nimport { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser';\n\n// Import from centralized module\nimport { formatResponse, getInputs, nodeProperties } from './methods';\nimport { processItem } from './methods/processItem';\nimport {\n\tgetCustomErrorMessage as getCustomOpenAiErrorMessage,\n\tisOpenAiError,\n} from '../../vendors/OpenAi/helpers/error-handling';\n\n/**\n * Basic LLM Chain Node Implementation\n * Allows connecting to language models with optional structured output parsing\n */\nexport class ChainLlm implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Basic LLM Chain',\n\t\tname: 'chainLlm',\n\t\ticon: 'fa:link',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9],\n\t\tdescription: 'A simple chain to prompt a large language model',\n\t\tdefaults: {\n\t\t\tname: 'Basic LLM Chain',\n\t\t\tcolor: '#909298',\n\t\t},\n\t\tcodex: {\n\t\t\talias: ['LangChain'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Chains', 'Root Nodes'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: [],\n\t\tproperties: nodeProperties,\n\t};\n\n\t/**\n\t * Main execution method for the node\n\t */\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tthis.logger.debug('Executing Basic LLM Chain');\n\t\tconst items = this.getInputData();\n\t\tconst returnData: INodeExecutionData[] = [];\n\t\tconst outputParser = await getOptionalOutputParser(this);\n\t\t// If the node version is 1.6(and LLM is using `response_format: json_object`) or higher or an output parser is configured,\n\t\t// we unwrap the response and return the object directly as JSON\n\t\tconst shouldUnwrapObjects = this.getNode().typeVersion >= 1.6 || !!outputParser;\n\n\t\tconst batchSize = this.getNodeParameter('batching.batchSize', 0, 5) as number;\n\t\tconst delayBetweenBatches = this.getNodeParameter(\n\t\t\t'batching.delayBetweenBatches',\n\t\t\t0,\n\t\t\t0,\n\t\t) as number;\n\n\t\tif (this.getNode().typeVersion >= 1.7 && batchSize > 1) {\n\t\t\t// Process items in batches\n\t\t\tfor (let i = 0; i < items.length; i += batchSize) {\n\t\t\t\tconst batch = items.slice(i, i + batchSize);\n\t\t\t\tconst batchPromises = batch.map(async (_item, batchItemIndex) => {\n\t\t\t\t\treturn await processItem(this, i + batchItemIndex);\n\t\t\t\t});\n\n\t\t\t\tconst batchResults = await Promise.allSettled(batchPromises);\n\n\t\t\t\tbatchResults.forEach((promiseResult, batchItemIndex) => {\n\t\t\t\t\tconst itemIndex = i + batchItemIndex;\n\t\t\t\t\tif (promiseResult.status === 'rejected') {\n\t\t\t\t\t\tconst error = promiseResult.reason as Error;\n\t\t\t\t\t\t// Handle OpenAI specific rate limit errors\n\t\t\t\t\t\tif (error instanceof NodeApiError && isOpenAiError(error.cause)) {\n\t\t\t\t\t\t\tconst openAiErrorCode: string | undefined = (error.cause as any).error?.code;\n\t\t\t\t\t\t\tif (openAiErrorCode) {\n\t\t\t\t\t\t\t\tconst customMessage = getCustomOpenAiErrorMessage(openAiErrorCode);\n\t\t\t\t\t\t\t\tif (customMessage) {\n\t\t\t\t\t\t\t\t\terror.message = customMessage;\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\n\t\t\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\t\tjson: { error: error.message },\n\t\t\t\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst responses = promiseResult.value;\n\t\t\t\t\tresponses.forEach((response: unknown) => {\n\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\tjson: formatResponse(response, shouldUnwrapObjects),\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tif (i + batchSize < items.length && delayBetweenBatches > 0) {\n\t\t\t\t\tawait sleep(delayBetweenBatches);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Process each input item\n\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst responses = await processItem(this, itemIndex);\n\n\t\t\t\t\t// Process each response and add to return data\n\t\t\t\t\tresponses.forEach((response) => {\n\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\tjson: formatResponse(response, shouldUnwrapObjects),\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Handle OpenAI specific rate limit errors\n\t\t\t\t\tif (error instanceof NodeApiError && isOpenAiError(error.cause)) {\n\t\t\t\t\t\tconst openAiErrorCode: string | undefined = (error.cause as any).error?.code;\n\t\t\t\t\t\tif (openAiErrorCode) {\n\t\t\t\t\t\t\tconst customMessage = getCustomOpenAiErrorMessage(openAiErrorCode);\n\t\t\t\t\t\t\tif (customMessage) {\n\t\t\t\t\t\t\t\terror.message = customMessage;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Continue on failure if configured\n\t\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":"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","names":["getCustomOpenAiErrorMessage"]}
@@ -0,0 +1,148 @@
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 chainExecutor_exports = {};
20
+ __export(chainExecutor_exports, {
21
+ NaiveJsonOutputParser: () => NaiveJsonOutputParser,
22
+ executeChain: () => executeChain,
23
+ getOutputParserForLLM: () => getOutputParserForLLM,
24
+ isModelInThinkingMode: () => isModelInThinkingMode,
25
+ isModelWithFormat: () => isModelWithFormat,
26
+ isModelWithResponseFormat: () => isModelWithResponseFormat
27
+ });
28
+ module.exports = __toCommonJS(chainExecutor_exports);
29
+ var import_output_parsers = require("@langchain/core/output_parsers");
30
+ var import_helpers = require("../../../../utils/helpers");
31
+ var import_tracing = require("../../../../utils/tracing");
32
+ var import_promptUtils = require("./promptUtils");
33
+ class NaiveJsonOutputParser extends import_output_parsers.JsonOutputParser {
34
+ async parse(text) {
35
+ try {
36
+ const directParsed = JSON.parse(text);
37
+ return directParsed;
38
+ } catch (e) {
39
+ return await super.parse(text);
40
+ }
41
+ }
42
+ }
43
+ function isModelWithResponseFormat(llm) {
44
+ return "modelKwargs" in llm && !!llm.modelKwargs && typeof llm.modelKwargs === "object" && "response_format" in llm.modelKwargs;
45
+ }
46
+ function isModelInThinkingMode(llm) {
47
+ return "lc_kwargs" in llm && "invocationKwargs" in llm.lc_kwargs && typeof llm.lc_kwargs.invocationKwargs === "object" && "thinking" in llm.lc_kwargs.invocationKwargs && llm.lc_kwargs.invocationKwargs.thinking.type === "enabled";
48
+ }
49
+ function isModelWithFormat(llm) {
50
+ return "format" in llm && typeof llm.format !== "undefined";
51
+ }
52
+ function getOutputParserForLLM(llm) {
53
+ if (isModelWithResponseFormat(llm) && llm.modelKwargs?.response_format?.type === "json_object") {
54
+ return new NaiveJsonOutputParser();
55
+ }
56
+ if (isModelWithFormat(llm) && llm.format === "json") {
57
+ return new NaiveJsonOutputParser();
58
+ }
59
+ if (isModelInThinkingMode(llm)) {
60
+ return new NaiveJsonOutputParser();
61
+ }
62
+ if (llm.metadata?.output_format === "json") {
63
+ return new NaiveJsonOutputParser();
64
+ }
65
+ return new import_output_parsers.StringOutputParser();
66
+ }
67
+ async function executeSimpleChain({
68
+ context,
69
+ llm,
70
+ query,
71
+ prompt
72
+ }) {
73
+ const outputParser = getOutputParserForLLM(llm);
74
+ const chain = prompt.pipe(llm).pipe(outputParser).withConfig((0, import_tracing.getTracingConfig)(context));
75
+ const response = await chain.invoke({
76
+ query,
77
+ signal: context.getExecutionCancelSignal()
78
+ });
79
+ return [response];
80
+ }
81
+ function withBuiltInTools(llm) {
82
+ const modelTools = llm.metadata?.tools ?? [];
83
+ if (modelTools.length && (0, import_helpers.isChatInstance)(llm) && llm.bindTools) {
84
+ return llm.bindTools(modelTools);
85
+ }
86
+ return llm;
87
+ }
88
+ function prepareLlm(llm, fallbackLlm) {
89
+ const mainLlm = withBuiltInTools(llm);
90
+ if (fallbackLlm) {
91
+ return mainLlm.withFallbacks([withBuiltInTools(fallbackLlm)]);
92
+ }
93
+ return mainLlm;
94
+ }
95
+ async function executeChain({
96
+ context,
97
+ itemIndex,
98
+ query,
99
+ llm,
100
+ outputParser,
101
+ messages,
102
+ fallbackLlm
103
+ }) {
104
+ const version = context.getNode().typeVersion;
105
+ const model = prepareLlm(llm, fallbackLlm);
106
+ if (!outputParser) {
107
+ const promptTemplate = await (0, import_promptUtils.createPromptTemplate)({
108
+ context,
109
+ itemIndex,
110
+ llm,
111
+ messages,
112
+ query
113
+ });
114
+ return await executeSimpleChain({
115
+ context,
116
+ llm: model,
117
+ query,
118
+ prompt: promptTemplate
119
+ });
120
+ }
121
+ const formatInstructions = outputParser.getFormatInstructions();
122
+ const promptWithInstructions = await (0, import_promptUtils.createPromptTemplate)({
123
+ context,
124
+ itemIndex,
125
+ llm,
126
+ messages,
127
+ formatInstructions,
128
+ query
129
+ });
130
+ let chain;
131
+ if (version >= 1.9) {
132
+ chain = promptWithInstructions.pipe(model).pipe((0, import_promptUtils.getAgentStepsParser)(outputParser)).withConfig((0, import_tracing.getTracingConfig)(context));
133
+ } else {
134
+ chain = promptWithInstructions.pipe(model).pipe(outputParser).withConfig((0, import_tracing.getTracingConfig)(context));
135
+ }
136
+ const response = await chain.invoke({ query }, { signal: context.getExecutionCancelSignal() });
137
+ return Array.isArray(response) ? response : [response];
138
+ }
139
+ // Annotate the CommonJS export names for ESM import in node:
140
+ 0 && (module.exports = {
141
+ NaiveJsonOutputParser,
142
+ executeChain,
143
+ getOutputParserForLLM,
144
+ isModelInThinkingMode,
145
+ isModelWithFormat,
146
+ isModelWithResponseFormat
147
+ });
148
+ //# sourceMappingURL=chainExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/chainExecutor.ts"],"sourcesContent":["import type { Tool } from '@langchain/classic/tools';\nimport type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseLLMOutputParser } from '@langchain/core/output_parsers';\nimport { JsonOutputParser, StringOutputParser } from '@langchain/core/output_parsers';\nimport type { ChatPromptTemplate, PromptTemplate } from '@langchain/core/prompts';\nimport type { Runnable } from '@langchain/core/runnables';\nimport type { IExecuteFunctions } from 'n8n-workflow';\n\nimport { isChatInstance } from '@utils/helpers';\nimport { getTracingConfig } from '@utils/tracing';\n\nimport { createPromptTemplate, getAgentStepsParser } from './promptUtils';\nimport type { ChainExecutionParams } from './types';\n\nexport class NaiveJsonOutputParser<\n\tT extends Record<string, any> = Record<string, any>,\n> extends JsonOutputParser<T> {\n\tasync parse(text: string): Promise<T> {\n\t\t// First try direct JSON parsing\n\t\ttry {\n\t\t\tconst directParsed = JSON.parse(text);\n\t\t\treturn directParsed as T;\n\t\t} catch (e) {\n\t\t\t// If fails, fall back to JsonOutputParser parser\n\t\t\treturn await super.parse(text);\n\t\t}\n\t}\n}\n\n/**\n * Type guard to check if the LLM has a modelKwargs property(OpenAI)\n */\nexport function isModelWithResponseFormat(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { modelKwargs: { response_format: { type: string } } } {\n\treturn (\n\t\t'modelKwargs' in llm &&\n\t\t!!llm.modelKwargs &&\n\t\ttypeof llm.modelKwargs === 'object' &&\n\t\t'response_format' in llm.modelKwargs\n\t);\n}\n\nexport function isModelInThinkingMode(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { lc_kwargs: { invocationKwargs: { thinking: { type: string } } } } {\n\treturn (\n\t\t'lc_kwargs' in llm &&\n\t\t'invocationKwargs' in llm.lc_kwargs &&\n\t\ttypeof llm.lc_kwargs.invocationKwargs === 'object' &&\n\t\t'thinking' in llm.lc_kwargs.invocationKwargs &&\n\t\tllm.lc_kwargs.invocationKwargs.thinking.type === 'enabled'\n\t);\n}\n\n/**\n * Type guard to check if the LLM has a format property(Ollama)\n */\nexport function isModelWithFormat(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { format: string } {\n\treturn 'format' in llm && typeof llm.format !== 'undefined';\n}\n\n/**\n * Determines if an LLM is configured to output JSON and returns the appropriate output parser\n */\nexport function getOutputParserForLLM(\n\tllm: BaseChatModel | BaseLanguageModel,\n): BaseLLMOutputParser<string | Record<string, unknown>> {\n\tif (isModelWithResponseFormat(llm) && llm.modelKwargs?.response_format?.type === 'json_object') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\tif (isModelWithFormat(llm) && llm.format === 'json') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\tif (isModelInThinkingMode(llm)) {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\t// For example Mistral's Magistral models (LmChatMistralCloud node)\n\tif (llm.metadata?.output_format === 'json') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\treturn new StringOutputParser();\n}\n\n/**\n * Creates a simple chain for LLMs without output parsers\n */\nasync function executeSimpleChain({\n\tcontext,\n\tllm,\n\tquery,\n\tprompt,\n}: {\n\tcontext: IExecuteFunctions;\n\tllm: BaseChatModel | BaseLanguageModel;\n\tquery: string;\n\tprompt: ChatPromptTemplate | PromptTemplate;\n}) {\n\tconst outputParser = getOutputParserForLLM(llm);\n\n\tconst chain = prompt.pipe(llm).pipe(outputParser).withConfig(getTracingConfig(context));\n\n\t// Execute the chain\n\tconst response = await chain.invoke({\n\t\tquery,\n\t\tsignal: context.getExecutionCancelSignal(),\n\t});\n\n\t// Ensure response is always returned as an array\n\treturn [response];\n}\n\n// Some models nodes, like OpenAI, can define built-in tools in their metadata\nfunction withBuiltInTools(llm: BaseChatModel | BaseLanguageModel) {\n\tconst modelTools = (llm.metadata?.tools as Tool[]) ?? [];\n\tif (modelTools.length && isChatInstance(llm) && llm.bindTools) {\n\t\treturn llm.bindTools(modelTools);\n\t}\n\treturn llm;\n}\n\nfunction prepareLlm(\n\tllm: BaseLanguageModel | BaseChatModel,\n\tfallbackLlm?: BaseLanguageModel | BaseChatModel | null,\n) {\n\tconst mainLlm = withBuiltInTools(llm);\n\tif (fallbackLlm) {\n\t\treturn mainLlm.withFallbacks([withBuiltInTools(fallbackLlm)]);\n\t}\n\treturn mainLlm;\n}\n\n/**\n * Creates and executes an LLM chain with the given prompt and optional output parsers\n */\nexport async function executeChain({\n\tcontext,\n\titemIndex,\n\tquery,\n\tllm,\n\toutputParser,\n\tmessages,\n\tfallbackLlm,\n}: ChainExecutionParams): Promise<unknown[]> {\n\tconst version = context.getNode().typeVersion;\n\tconst model = prepareLlm(llm, fallbackLlm) as BaseChatModel | BaseLanguageModel;\n\t// If no output parsers provided, use a simple chain with basic prompt template\n\tif (!outputParser) {\n\t\tconst promptTemplate = await createPromptTemplate({\n\t\t\tcontext,\n\t\t\titemIndex,\n\t\t\tllm,\n\t\t\tmessages,\n\t\t\tquery,\n\t\t});\n\n\t\treturn await executeSimpleChain({\n\t\t\tcontext,\n\t\t\tllm: model,\n\t\t\tquery,\n\t\t\tprompt: promptTemplate,\n\t\t});\n\t}\n\n\tconst formatInstructions = outputParser.getFormatInstructions();\n\n\t// Create a prompt template with format instructions\n\tconst promptWithInstructions = await createPromptTemplate({\n\t\tcontext,\n\t\titemIndex,\n\t\tllm,\n\t\tmessages,\n\t\tformatInstructions,\n\t\tquery,\n\t});\n\n\tlet chain: Runnable<{ query: string }>;\n\tif (version >= 1.9) {\n\t\t// use getAgentStepsParser to have more robust output parsing\n\t\tchain = promptWithInstructions\n\t\t\t.pipe(model)\n\t\t\t.pipe(getAgentStepsParser(outputParser))\n\t\t\t.withConfig(getTracingConfig(context));\n\t} else {\n\t\tchain = promptWithInstructions\n\t\t\t.pipe(model)\n\t\t\t.pipe(outputParser)\n\t\t\t.withConfig(getTracingConfig(context));\n\t}\n\n\tconst response = await chain.invoke({ query }, { signal: context.getExecutionCancelSignal() });\n\n\t// Ensure response is always returned as an array\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\treturn Array.isArray(response) ? response : [response];\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,328 @@
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 config_exports = {};
20
+ __export(config_exports, {
21
+ getInputs: () => getInputs,
22
+ nodeProperties: () => nodeProperties
23
+ });
24
+ module.exports = __toCommonJS(config_exports);
25
+ var import_prompts = require("@langchain/core/prompts");
26
+ var import_n8n_workflow = require("n8n-workflow");
27
+ var import_descriptions = require("../../../../utils/descriptions");
28
+ var import_sharedFields = require("../../../../utils/sharedFields");
29
+ function getInputs(parameters) {
30
+ const inputs = [
31
+ { displayName: "", type: "main" },
32
+ {
33
+ displayName: "Model",
34
+ maxConnections: 1,
35
+ type: "ai_languageModel",
36
+ required: true
37
+ }
38
+ ];
39
+ const needsFallback = parameters?.needsFallback;
40
+ if (needsFallback === true) {
41
+ inputs.push({
42
+ displayName: "Fallback Model",
43
+ maxConnections: 1,
44
+ type: "ai_languageModel",
45
+ required: true
46
+ });
47
+ }
48
+ const hasOutputParser = parameters?.hasOutputParser;
49
+ if (hasOutputParser === void 0 || hasOutputParser === true) {
50
+ inputs.push({
51
+ displayName: "Output Parser",
52
+ type: "ai_outputParser",
53
+ maxConnections: 1,
54
+ required: false
55
+ });
56
+ }
57
+ return inputs;
58
+ }
59
+ const nodeProperties = [
60
+ (0, import_sharedFields.getTemplateNoticeField)(1978),
61
+ {
62
+ displayName: "Prompt",
63
+ name: "prompt",
64
+ type: "string",
65
+ required: true,
66
+ default: "={{ $json.input }}",
67
+ displayOptions: {
68
+ show: {
69
+ "@version": [1]
70
+ }
71
+ }
72
+ },
73
+ {
74
+ displayName: "Prompt",
75
+ name: "prompt",
76
+ type: "string",
77
+ required: true,
78
+ default: "={{ $json.chat_input }}",
79
+ displayOptions: {
80
+ show: {
81
+ "@version": [1.1, 1.2]
82
+ }
83
+ }
84
+ },
85
+ {
86
+ displayName: "Prompt",
87
+ name: "prompt",
88
+ type: "string",
89
+ required: true,
90
+ default: "={{ $json.chatInput }}",
91
+ displayOptions: {
92
+ show: {
93
+ "@version": [1.3]
94
+ }
95
+ }
96
+ },
97
+ {
98
+ ...import_descriptions.promptTypeOptionsDeprecated,
99
+ displayOptions: {
100
+ hide: {
101
+ "@version": [{ _cnd: { lte: 1.3 } }, { _cnd: { gte: 1.8 } }]
102
+ }
103
+ }
104
+ },
105
+ {
106
+ ...import_descriptions.promptTypeOptions,
107
+ displayOptions: {
108
+ show: {
109
+ "@version": [{ _cnd: { gte: 1.8 } }]
110
+ }
111
+ }
112
+ },
113
+ {
114
+ ...import_descriptions.textFromGuardrailsNode,
115
+ displayOptions: { show: { promptType: ["guardrails"], "@version": [{ _cnd: { gte: 1.5 } }] } }
116
+ },
117
+ {
118
+ ...import_descriptions.textFromPreviousNode,
119
+ displayOptions: { show: { promptType: ["auto"], "@version": [{ _cnd: { gte: 1.5 } }] } }
120
+ },
121
+ {
122
+ displayName: "Prompt (User Message)",
123
+ name: "text",
124
+ type: "string",
125
+ required: true,
126
+ default: "",
127
+ placeholder: "e.g. Hello, how can you help me?",
128
+ typeOptions: {
129
+ rows: 2
130
+ },
131
+ displayOptions: {
132
+ show: {
133
+ promptType: ["define"]
134
+ }
135
+ }
136
+ },
137
+ {
138
+ displayName: "Require Specific Output Format",
139
+ name: "hasOutputParser",
140
+ type: "boolean",
141
+ default: false,
142
+ noDataExpression: true,
143
+ displayOptions: {
144
+ hide: {
145
+ "@version": [1, 1.1, 1.3]
146
+ }
147
+ }
148
+ },
149
+ {
150
+ displayName: "Enable Fallback Model",
151
+ name: "needsFallback",
152
+ type: "boolean",
153
+ default: false,
154
+ noDataExpression: true,
155
+ displayOptions: {
156
+ hide: {
157
+ "@version": [1, 1.1, 1.3]
158
+ }
159
+ }
160
+ },
161
+ {
162
+ displayName: "Chat Messages (if Using a Chat Model)",
163
+ name: "messages",
164
+ type: "fixedCollection",
165
+ typeOptions: {
166
+ multipleValues: true
167
+ },
168
+ default: {},
169
+ placeholder: "Add prompt",
170
+ options: [
171
+ {
172
+ name: "messageValues",
173
+ displayName: "Prompt",
174
+ values: [
175
+ {
176
+ displayName: "Type Name or ID",
177
+ name: "type",
178
+ type: "options",
179
+ options: [
180
+ {
181
+ name: "AI",
182
+ value: import_prompts.AIMessagePromptTemplate.lc_name()
183
+ },
184
+ {
185
+ name: "System",
186
+ value: import_prompts.SystemMessagePromptTemplate.lc_name()
187
+ },
188
+ {
189
+ name: "User",
190
+ value: import_prompts.HumanMessagePromptTemplate.lc_name()
191
+ }
192
+ ],
193
+ default: import_prompts.SystemMessagePromptTemplate.lc_name()
194
+ },
195
+ {
196
+ displayName: "Message Type",
197
+ name: "messageType",
198
+ type: "options",
199
+ displayOptions: {
200
+ show: {
201
+ type: [import_prompts.HumanMessagePromptTemplate.lc_name()]
202
+ }
203
+ },
204
+ options: [
205
+ {
206
+ name: "Text",
207
+ value: "text",
208
+ description: "Simple text message"
209
+ },
210
+ {
211
+ name: "Image (Binary)",
212
+ value: "imageBinary",
213
+ description: "Process the binary input from the previous node"
214
+ },
215
+ {
216
+ name: "Image (URL)",
217
+ value: "imageUrl",
218
+ description: "Process the image from the specified URL"
219
+ }
220
+ ],
221
+ default: "text"
222
+ },
223
+ {
224
+ displayName: "Image Data Field Name",
225
+ name: "binaryImageDataKey",
226
+ type: "string",
227
+ default: "data",
228
+ required: true,
229
+ description: "The name of the field in the chain's input that contains the binary image file to be processed",
230
+ displayOptions: {
231
+ show: {
232
+ messageType: ["imageBinary"]
233
+ }
234
+ }
235
+ },
236
+ {
237
+ displayName: "Image URL",
238
+ name: "imageUrl",
239
+ type: "string",
240
+ default: "",
241
+ required: true,
242
+ description: "URL to the image to be processed",
243
+ displayOptions: {
244
+ show: {
245
+ messageType: ["imageUrl"]
246
+ }
247
+ }
248
+ },
249
+ {
250
+ displayName: "Image Details",
251
+ description: "Control how the model processes the image and generates its textual understanding",
252
+ name: "imageDetail",
253
+ type: "options",
254
+ displayOptions: {
255
+ show: {
256
+ type: [import_prompts.HumanMessagePromptTemplate.lc_name()],
257
+ messageType: ["imageBinary", "imageUrl"]
258
+ }
259
+ },
260
+ options: [
261
+ {
262
+ name: "Auto",
263
+ value: "auto",
264
+ description: "Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting"
265
+ },
266
+ {
267
+ name: "Low",
268
+ value: "low",
269
+ description: "The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail."
270
+ },
271
+ {
272
+ name: "High",
273
+ value: "high",
274
+ description: "Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens."
275
+ }
276
+ ],
277
+ default: "auto"
278
+ },
279
+ {
280
+ displayName: "Message",
281
+ name: "message",
282
+ type: "string",
283
+ required: true,
284
+ displayOptions: {
285
+ hide: {
286
+ messageType: ["imageBinary", "imageUrl"]
287
+ }
288
+ },
289
+ default: ""
290
+ }
291
+ ]
292
+ }
293
+ ]
294
+ },
295
+ (0, import_sharedFields.getBatchingOptionFields)({
296
+ show: {
297
+ "@version": [{ _cnd: { gte: 1.7 } }]
298
+ }
299
+ }),
300
+ {
301
+ displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${import_n8n_workflow.NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,
302
+ name: "notice",
303
+ type: "notice",
304
+ default: "",
305
+ displayOptions: {
306
+ show: {
307
+ hasOutputParser: [true]
308
+ }
309
+ }
310
+ },
311
+ {
312
+ displayName: "Connect an additional language model on the canvas to use it as a fallback if the main model fails",
313
+ name: "fallbackNotice",
314
+ type: "notice",
315
+ default: "",
316
+ displayOptions: {
317
+ show: {
318
+ needsFallback: [true]
319
+ }
320
+ }
321
+ }
322
+ ];
323
+ // Annotate the CommonJS export names for ESM import in node:
324
+ 0 && (module.exports = {
325
+ getInputs,
326
+ nodeProperties
327
+ });
328
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/config.ts"],"sourcesContent":["import {\n\tAIMessagePromptTemplate,\n\tHumanMessagePromptTemplate,\n\tSystemMessagePromptTemplate,\n} from '@langchain/core/prompts';\nimport type { IDataObject, INodeInputConfiguration, INodeProperties } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n} from '@utils/descriptions';\nimport { getBatchingOptionFields, getTemplateNoticeField } from '@utils/sharedFields';\n\n/**\n * Dynamic input configuration generation based on node parameters\n */\nexport function getInputs(parameters: IDataObject) {\n\tconst inputs: INodeInputConfiguration[] = [\n\t\t{ displayName: '', type: 'main' },\n\t\t{\n\t\t\tdisplayName: 'Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t},\n\t];\n\n\tconst needsFallback = parameters?.needsFallback;\n\n\tif (needsFallback === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Fallback Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t});\n\t}\n\n\t// If `hasOutputParser` is undefined it must be version 1.3 or earlier so we\n\t// always add the output parser input\n\tconst hasOutputParser = parameters?.hasOutputParser;\n\tif (hasOutputParser === undefined || hasOutputParser === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Output Parser',\n\t\t\ttype: 'ai_outputParser',\n\t\t\tmaxConnections: 1,\n\t\t\trequired: false,\n\t\t});\n\t}\n\n\treturn inputs;\n}\n\n/**\n * Node properties configuration\n */\nexport const nodeProperties: INodeProperties[] = [\n\tgetTemplateNoticeField(1978),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chat_input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.1, 1.2],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chatInput }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptionsDeprecated,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [{ _cnd: { lte: 1.3 } }, { _cnd: { gte: 1.8 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptions,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [{ _cnd: { gte: 1.8 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromGuardrailsNode,\n\t\tdisplayOptions: { show: { promptType: ['guardrails'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: { show: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\tdisplayName: 'Prompt (User Message)',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Require Specific Output Format',\n\t\tname: 'hasOutputParser',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Enable Fallback Model',\n\t\tname: 'needsFallback',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Chat Messages (if Using a Chat Model)',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add prompt',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'messageValues',\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Type Name or ID',\n\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'AI',\n\t\t\t\t\t\t\t\tvalue: AIMessagePromptTemplate.lc_name(),\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: SystemMessagePromptTemplate.lc_name(),\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: 'User',\n\t\t\t\t\t\t\t\tvalue: HumanMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message Type',\n\t\t\t\t\t\tname: 'messageType',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Simple text message',\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: 'Image (Binary)',\n\t\t\t\t\t\t\t\tvalue: 'imageBinary',\n\t\t\t\t\t\t\t\tdescription: 'Process the binary input from the previous node',\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: 'Image (URL)',\n\t\t\t\t\t\t\t\tvalue: 'imageUrl',\n\t\t\t\t\t\t\t\tdescription: 'Process the image from the specified URL',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Data Field Name',\n\t\t\t\t\t\tname: 'binaryImageDataKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: 'data',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The name of the field in the chain's input that contains the binary image file to be processed\",\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary'],\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\t{\n\t\t\t\t\t\tdisplayName: 'Image URL',\n\t\t\t\t\t\tname: 'imageUrl',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription: 'URL to the image to be processed',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageUrl'],\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\t{\n\t\t\t\t\t\tdisplayName: 'Image Details',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Control how the model processes the image and generates its textual understanding',\n\t\t\t\t\t\tname: 'imageDetail',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting',\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: 'Low',\n\t\t\t\t\t\t\t\tvalue: 'low',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail.',\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: 'High',\n\t\t\t\t\t\t\t\tvalue: 'high',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t},\n\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message',\n\t\t\t\t\t\tname: 'message',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tgetBatchingOptionFields({\n\t\tshow: {\n\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t},\n\t}),\n\t{\n\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\tname: 'notice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\thasOutputParser: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\tname: 'fallbackNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tneedsFallback: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":"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","names":[]}
@@ -0,0 +1,100 @@
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 imageUtils_exports = {};
20
+ __export(imageUtils_exports, {
21
+ UnsupportedMimeTypeError: () => UnsupportedMimeTypeError,
22
+ createImageMessage: () => createImageMessage,
23
+ dataUriFromImageData: () => dataUriFromImageData
24
+ });
25
+ module.exports = __toCommonJS(imageUtils_exports);
26
+ var import_messages = require("@langchain/core/messages");
27
+ var import_google_genai = require("@langchain/google-genai");
28
+ var import_ollama = require("@langchain/ollama");
29
+ var import_n8n_workflow = require("n8n-workflow");
30
+ class UnsupportedMimeTypeError extends import_n8n_workflow.OperationalError {
31
+ }
32
+ function dataUriFromImageData(binaryData, bufferData) {
33
+ if (!binaryData.mimeType?.startsWith("image/")) {
34
+ throw new UnsupportedMimeTypeError(
35
+ `${binaryData.mimeType} is not a supported type of binary data. Only images are supported.`
36
+ );
37
+ }
38
+ return `data:${binaryData.mimeType};base64,${bufferData.toString("base64")}`;
39
+ }
40
+ async function createImageMessage({
41
+ context,
42
+ itemIndex,
43
+ message
44
+ }) {
45
+ if (message.messageType !== "imageBinary" && message.messageType !== "imageUrl") {
46
+ throw new import_n8n_workflow.NodeOperationError(
47
+ context.getNode(),
48
+ "Invalid message type. Only imageBinary and imageUrl are supported"
49
+ );
50
+ }
51
+ const detail = message.imageDetail === "auto" ? void 0 : message.imageDetail;
52
+ if (message.messageType === "imageUrl" && message.imageUrl) {
53
+ return new import_messages.HumanMessage({
54
+ content: [
55
+ {
56
+ type: "image_url",
57
+ image_url: {
58
+ url: message.imageUrl,
59
+ detail
60
+ }
61
+ }
62
+ ]
63
+ });
64
+ }
65
+ const binaryDataKey = message.binaryImageDataKey ?? "data";
66
+ const inputData = context.getInputData()[itemIndex];
67
+ const binaryData = inputData.binary?.[binaryDataKey];
68
+ if (!binaryData) {
69
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), "No binary data set.");
70
+ }
71
+ const bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);
72
+ const model = await context.getInputConnectionData(
73
+ import_n8n_workflow.NodeConnectionTypes.AiLanguageModel,
74
+ 0
75
+ );
76
+ try {
77
+ const dataURI = dataUriFromImageData(binaryData, bufferData);
78
+ const directUriModels = [import_google_genai.ChatGoogleGenerativeAI, import_ollama.ChatOllama];
79
+ const imageUrl = directUriModels.some((i) => model instanceof i) ? dataURI : { url: dataURI, detail };
80
+ return new import_messages.HumanMessage({
81
+ content: [
82
+ {
83
+ type: "image_url",
84
+ image_url: imageUrl
85
+ }
86
+ ]
87
+ });
88
+ } catch (error) {
89
+ if (error instanceof UnsupportedMimeTypeError)
90
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), error.message);
91
+ throw error;
92
+ }
93
+ }
94
+ // Annotate the CommonJS export names for ESM import in node:
95
+ 0 && (module.exports = {
96
+ UnsupportedMimeTypeError,
97
+ createImageMessage,
98
+ dataUriFromImageData
99
+ });
100
+ //# sourceMappingURL=imageUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/imageUtils.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { ChatGoogleGenerativeAI } from '@langchain/google-genai';\nimport { ChatOllama } from '@langchain/ollama';\nimport type { IExecuteFunctions, IBinaryData } from 'n8n-workflow';\nimport { NodeOperationError, NodeConnectionTypes, OperationalError } from 'n8n-workflow';\n\nimport type { MessageTemplate } from './types';\n\nexport class UnsupportedMimeTypeError extends OperationalError {}\n\n/**\n * Converts binary image data to a data URI\n */\nexport function dataUriFromImageData(binaryData: IBinaryData, bufferData: Buffer): string {\n\tif (!binaryData.mimeType?.startsWith('image/')) {\n\t\tthrow new UnsupportedMimeTypeError(\n\t\t\t`${binaryData.mimeType} is not a supported type of binary data. Only images are supported.`,\n\t\t);\n\t}\n\treturn `data:${binaryData.mimeType};base64,${bufferData.toString('base64')}`;\n}\n\n/**\n * Creates a human message with image content from either binary data or URL\n */\nexport async function createImageMessage({\n\tcontext,\n\titemIndex,\n\tmessage,\n}: {\n\tcontext: IExecuteFunctions;\n\titemIndex: number;\n\tmessage: MessageTemplate;\n}): Promise<HumanMessage> {\n\t// Validate message type\n\tif (message.messageType !== 'imageBinary' && message.messageType !== 'imageUrl') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\t'Invalid message type. Only imageBinary and imageUrl are supported',\n\t\t);\n\t}\n\n\tconst detail = message.imageDetail === 'auto' ? undefined : message.imageDetail;\n\n\t// Handle image URL case\n\tif (message.messageType === 'imageUrl' && message.imageUrl) {\n\t\treturn new HumanMessage({\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'image_url',\n\t\t\t\t\timage_url: {\n\t\t\t\t\t\turl: message.imageUrl,\n\t\t\t\t\t\tdetail,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t}\n\n\t// Handle binary image case\n\tconst binaryDataKey = message.binaryImageDataKey ?? 'data';\n\tconst inputData = context.getInputData()[itemIndex];\n\tconst binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;\n\n\tif (!binaryData) {\n\t\tthrow new NodeOperationError(context.getNode(), 'No binary data set.');\n\t}\n\n\tconst bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);\n\tconst model = (await context.getInputConnectionData(\n\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t0,\n\t)) as BaseLanguageModel;\n\n\ttry {\n\t\t// Create data URI from binary data\n\t\tconst dataURI = dataUriFromImageData(binaryData, bufferData);\n\n\t\t// Some models need different image URL formats\n\t\tconst directUriModels = [ChatGoogleGenerativeAI, ChatOllama];\n\t\tconst imageUrl = directUriModels.some((i) => model instanceof i)\n\t\t\t? dataURI\n\t\t\t: { url: dataURI, detail };\n\n\t\treturn new HumanMessage({\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'image_url',\n\t\t\t\t\timage_url: imageUrl,\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof UnsupportedMimeTypeError)\n\t\t\tthrow new NodeOperationError(context.getNode(), error.message);\n\t\tthrow error;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA6B;AAC7B,0BAAuC;AACvC,oBAA2B;AAE3B,0BAA0E;AAInE,MAAM,iCAAiC,qCAAiB;AAAC;AAKzD,SAAS,qBAAqB,YAAyB,YAA4B;AACzF,MAAI,CAAC,WAAW,UAAU,WAAW,QAAQ,GAAG;AAC/C,UAAM,IAAI;AAAA,MACT,GAAG,WAAW,QAAQ;AAAA,IACvB;AAAA,EACD;AACA,SAAO,QAAQ,WAAW,QAAQ,WAAW,WAAW,SAAS,QAAQ,CAAC;AAC3E;AAKA,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AACD,GAI0B;AAEzB,MAAI,QAAQ,gBAAgB,iBAAiB,QAAQ,gBAAgB,YAAY;AAChF,UAAM,IAAI;AAAA,MACT,QAAQ,QAAQ;AAAA,MAChB;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAAS,QAAQ,gBAAgB,SAAS,SAAY,QAAQ;AAGpE,MAAI,QAAQ,gBAAgB,cAAc,QAAQ,UAAU;AAC3D,WAAO,IAAI,6BAAa;AAAA,MACvB,SAAS;AAAA,QACR;AAAA,UACC,MAAM;AAAA,UACN,WAAW;AAAA,YACV,KAAK,QAAQ;AAAA,YACb;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAGA,QAAM,gBAAgB,QAAQ,sBAAsB;AACpD,QAAM,YAAY,QAAQ,aAAa,EAAE,SAAS;AAClD,QAAM,aAAa,UAAU,SAAS,aAAa;AAEnD,MAAI,CAAC,YAAY;AAChB,UAAM,IAAI,uCAAmB,QAAQ,QAAQ,GAAG,qBAAqB;AAAA,EACtE;AAEA,QAAM,aAAa,MAAM,QAAQ,QAAQ,oBAAoB,WAAW,aAAa;AACrF,QAAM,QAAS,MAAM,QAAQ;AAAA,IAC5B,wCAAoB;AAAA,IACpB;AAAA,EACD;AAEA,MAAI;AAEH,UAAM,UAAU,qBAAqB,YAAY,UAAU;AAG3D,UAAM,kBAAkB,CAAC,4CAAwB,wBAAU;AAC3D,UAAM,WAAW,gBAAgB,KAAK,CAAC,MAAM,iBAAiB,CAAC,IAC5D,UACA,EAAE,KAAK,SAAS,OAAO;AAE1B,WAAO,IAAI,6BAAa;AAAA,MACvB,SAAS;AAAA,QACR;AAAA,UACC,MAAM;AAAA,UACN,WAAW;AAAA,QACZ;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF,SAAS,OAAO;AACf,QAAI,iBAAiB;AACpB,YAAM,IAAI,uCAAmB,QAAQ,QAAQ,GAAG,MAAM,OAAO;AAC9D,UAAM;AAAA,EACP;AACD;","names":[]}