@n8n/n8n-nodes-langchain 1.86.0 → 1.87.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 (466) hide show
  1. package/dist/credentials/AnthropicApi.credentials.js +1 -0
  2. package/dist/credentials/AnthropicApi.credentials.js.map +1 -0
  3. package/dist/credentials/AzureOpenAiApi.credentials.js +1 -0
  4. package/dist/credentials/AzureOpenAiApi.credentials.js.map +1 -0
  5. package/dist/credentials/CohereApi.credentials.js +1 -0
  6. package/dist/credentials/CohereApi.credentials.js.map +1 -0
  7. package/dist/credentials/DeepSeekApi.credentials.js +1 -0
  8. package/dist/credentials/DeepSeekApi.credentials.js.map +1 -0
  9. package/dist/credentials/GooglePalmApi.credentials.js +1 -0
  10. package/dist/credentials/GooglePalmApi.credentials.js.map +1 -0
  11. package/dist/credentials/GroqApi.credentials.js +1 -0
  12. package/dist/credentials/GroqApi.credentials.js.map +1 -0
  13. package/dist/credentials/HuggingFaceApi.credentials.js +1 -0
  14. package/dist/credentials/HuggingFaceApi.credentials.js.map +1 -0
  15. package/dist/credentials/MistralCloudApi.credentials.js +1 -0
  16. package/dist/credentials/MistralCloudApi.credentials.js.map +1 -0
  17. package/dist/credentials/MotorheadApi.credentials.js +1 -0
  18. package/dist/credentials/MotorheadApi.credentials.js.map +1 -0
  19. package/dist/credentials/OllamaApi.credentials.js +1 -0
  20. package/dist/credentials/OllamaApi.credentials.js.map +1 -0
  21. package/dist/credentials/OpenRouterApi.credentials.js +1 -0
  22. package/dist/credentials/OpenRouterApi.credentials.js.map +1 -0
  23. package/dist/credentials/PineconeApi.credentials.js +1 -0
  24. package/dist/credentials/PineconeApi.credentials.js.map +1 -0
  25. package/dist/credentials/QdrantApi.credentials.js +1 -0
  26. package/dist/credentials/QdrantApi.credentials.js.map +1 -0
  27. package/dist/credentials/SerpApi.credentials.js +1 -0
  28. package/dist/credentials/SerpApi.credentials.js.map +1 -0
  29. package/dist/credentials/WolframAlphaApi.credentials.js +1 -0
  30. package/dist/credentials/WolframAlphaApi.credentials.js.map +1 -0
  31. package/dist/credentials/XAiApi.credentials.js +1 -0
  32. package/dist/credentials/XAiApi.credentials.js.map +1 -0
  33. package/dist/credentials/XataApi.credentials.js +1 -0
  34. package/dist/credentials/XataApi.credentials.js.map +1 -0
  35. package/dist/credentials/ZepApi.credentials.js +1 -0
  36. package/dist/credentials/ZepApi.credentials.js.map +1 -0
  37. package/dist/known/nodes.json +12 -0
  38. package/dist/nodes/agents/Agent/Agent.node.js +1 -0
  39. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -0
  40. package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +1 -0
  41. package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -0
  42. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +1 -0
  43. package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -0
  44. package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js +1 -0
  45. package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js.map +1 -0
  46. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +1 -0
  47. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -0
  48. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +1 -0
  49. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -0
  50. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js +1 -0
  51. package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js.map +1 -0
  52. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js +1 -0
  53. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js.map +1 -0
  54. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js +1 -0
  55. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js.map +1 -0
  56. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js +1 -0
  57. package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js.map +1 -0
  58. package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +1 -0
  59. package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -0
  60. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +1 -0
  61. package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -0
  62. package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js +1 -0
  63. package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js.map +1 -0
  64. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +1 -0
  65. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -0
  66. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +1 -0
  67. package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -0
  68. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js +1 -0
  69. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js.map +1 -0
  70. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js +1 -0
  71. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js.map +1 -0
  72. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js +1 -0
  73. package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js.map +1 -0
  74. package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js +1 -0
  75. package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js.map +1 -0
  76. package/dist/nodes/agents/Agent/agents/ToolsAgent/description.js +1 -0
  77. package/dist/nodes/agents/Agent/agents/ToolsAgent/description.js.map +1 -0
  78. package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js +1 -0
  79. package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js.map +1 -0
  80. package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js +1 -0
  81. package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js.map +1 -0
  82. package/dist/nodes/agents/Agent/agents/utils.js +1 -0
  83. package/dist/nodes/agents/Agent/agents/utils.js.map +1 -0
  84. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +1 -0
  85. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -0
  86. package/dist/nodes/agents/OpenAiAssistant/utils.js +1 -0
  87. package/dist/nodes/agents/OpenAiAssistant/utils.js.map +1 -0
  88. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +1 -0
  89. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -0
  90. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +1 -0
  91. package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -0
  92. package/dist/nodes/chains/ChainLLM/methods/config.js +1 -0
  93. package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -0
  94. package/dist/nodes/chains/ChainLLM/methods/imageUtils.js +1 -0
  95. package/dist/nodes/chains/ChainLLM/methods/imageUtils.js.map +1 -0
  96. package/dist/nodes/chains/ChainLLM/methods/index.js +1 -0
  97. package/dist/nodes/chains/ChainLLM/methods/index.js.map +1 -0
  98. package/dist/nodes/chains/ChainLLM/methods/promptUtils.js +1 -0
  99. package/dist/nodes/chains/ChainLLM/methods/promptUtils.js.map +1 -0
  100. package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js +1 -0
  101. package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js.map +1 -0
  102. package/dist/nodes/chains/ChainLLM/methods/types.js +1 -0
  103. package/dist/nodes/chains/ChainLLM/methods/types.js.map +1 -0
  104. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +1 -0
  105. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -0
  106. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +1 -0
  107. package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -0
  108. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +1 -0
  109. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -0
  110. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +1 -0
  111. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -0
  112. package/dist/nodes/chains/ChainSummarization/helpers.js +1 -0
  113. package/dist/nodes/chains/ChainSummarization/helpers.js.map +1 -0
  114. package/dist/nodes/chains/ChainSummarization/prompt.js +1 -0
  115. package/dist/nodes/chains/ChainSummarization/prompt.js.map +1 -0
  116. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +1 -0
  117. package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -0
  118. package/dist/nodes/chains/InformationExtractor/helpers.js +1 -0
  119. package/dist/nodes/chains/InformationExtractor/helpers.js.map +1 -0
  120. package/dist/nodes/chains/InformationExtractor/types.js +1 -0
  121. package/dist/nodes/chains/InformationExtractor/types.js.map +1 -0
  122. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +1 -0
  123. package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -0
  124. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +1 -0
  125. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -0
  126. package/dist/nodes/code/Code.node.js +1 -0
  127. package/dist/nodes/code/Code.node.js.map +1 -0
  128. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +1 -0
  129. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -0
  130. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +1 -0
  131. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -0
  132. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +1 -0
  133. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -0
  134. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +1 -0
  135. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -0
  136. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +1 -0
  137. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -0
  138. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +1 -0
  139. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -0
  140. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +1 -0
  141. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -0
  142. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +1 -0
  143. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -0
  144. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js +166 -0
  145. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js.map +1 -0
  146. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/google.svg +1 -0
  147. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +1 -0
  148. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -0
  149. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +1 -0
  150. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -0
  151. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +1 -0
  152. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -0
  153. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +1 -0
  154. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -0
  155. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +1 -0
  156. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -0
  157. package/dist/nodes/llms/LMChatAnthropic/methods/searchModels.js +1 -0
  158. package/dist/nodes/llms/LMChatAnthropic/methods/searchModels.js.map +1 -0
  159. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +1 -0
  160. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -0
  161. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +1 -0
  162. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -0
  163. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +1 -0
  164. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -0
  165. package/dist/nodes/llms/LMCohere/LmCohere.node.js +1 -0
  166. package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -0
  167. package/dist/nodes/llms/LMOllama/LmOllama.node.js +1 -0
  168. package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -0
  169. package/dist/nodes/llms/LMOllama/description.js +1 -0
  170. package/dist/nodes/llms/LMOllama/description.js.map +1 -0
  171. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +1 -0
  172. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -0
  173. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +1 -0
  174. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -0
  175. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +1 -0
  176. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -0
  177. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +1 -0
  178. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -0
  179. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +1 -0
  180. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -0
  181. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +1 -0
  182. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -0
  183. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +1 -0
  184. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -0
  185. package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js +1 -0
  186. package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js.map +1 -0
  187. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +1 -0
  188. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -0
  189. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +1 -0
  190. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -0
  191. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +1 -0
  192. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -0
  193. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +1 -0
  194. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -0
  195. package/dist/nodes/llms/N8nLlmTracing.js +1 -0
  196. package/dist/nodes/llms/N8nLlmTracing.js.map +1 -0
  197. package/dist/nodes/llms/gemini-common/additional-options.js +1 -0
  198. package/dist/nodes/llms/gemini-common/additional-options.js.map +1 -0
  199. package/dist/nodes/llms/gemini-common/safety-options.js +1 -0
  200. package/dist/nodes/llms/gemini-common/safety-options.js.map +1 -0
  201. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +1 -0
  202. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +1 -0
  203. package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js +1 -0
  204. package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js.map +1 -0
  205. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +1 -0
  206. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -0
  207. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +1 -0
  208. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -0
  209. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +1 -0
  210. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -0
  211. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js +155 -0
  212. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js.map +1 -0
  213. package/dist/nodes/memory/MemoryMongoDbChat/mongodb.dark.svg +3 -0
  214. package/dist/nodes/memory/MemoryMongoDbChat/mongodb.svg +3 -0
  215. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +1 -0
  216. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -0
  217. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +1 -0
  218. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -0
  219. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +1 -0
  220. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -0
  221. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +1 -0
  222. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -0
  223. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +1 -0
  224. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -0
  225. package/dist/nodes/memory/descriptions.js +1 -0
  226. package/dist/nodes/memory/descriptions.js.map +1 -0
  227. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +1 -0
  228. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -0
  229. package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js +1 -0
  230. package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js.map +1 -0
  231. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +1 -0
  232. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -0
  233. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +1 -0
  234. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -0
  235. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +1 -0
  236. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -0
  237. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +1 -0
  238. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -0
  239. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +1 -0
  240. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -0
  241. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +1 -0
  242. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -0
  243. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +1 -0
  244. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -0
  245. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +1 -0
  246. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -0
  247. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +1 -0
  248. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -0
  249. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +1 -0
  250. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -0
  251. package/dist/nodes/tools/ToolCode/ToolCode.node.js +1 -0
  252. package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -0
  253. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +1 -0
  254. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -0
  255. package/dist/nodes/tools/ToolHttpRequest/descriptions.js +1 -0
  256. package/dist/nodes/tools/ToolHttpRequest/descriptions.js.map +1 -0
  257. package/dist/nodes/tools/ToolHttpRequest/interfaces.js +1 -0
  258. package/dist/nodes/tools/ToolHttpRequest/interfaces.js.map +1 -0
  259. package/dist/nodes/tools/ToolHttpRequest/utils.js +3 -2
  260. package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -0
  261. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +1 -0
  262. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -0
  263. package/dist/nodes/tools/ToolThink/ToolThink.node.js +94 -0
  264. package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -0
  265. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +1 -0
  266. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -0
  267. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +1 -0
  268. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -0
  269. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +1 -0
  270. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -0
  271. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +1 -0
  272. package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -0
  273. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js +1 -0
  274. package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js.map +1 -0
  275. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +1 -0
  276. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -0
  277. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +1 -0
  278. package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -0
  279. package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js +1 -0
  280. package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js.map +1 -0
  281. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js +1 -0
  282. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js.map +1 -0
  283. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +1 -0
  284. package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -0
  285. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js +1 -0
  286. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -0
  287. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +1 -0
  288. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -0
  289. package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js +1 -0
  290. package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js.map +1 -0
  291. package/dist/nodes/trigger/ChatTrigger/constants.js +1 -0
  292. package/dist/nodes/trigger/ChatTrigger/constants.js.map +1 -0
  293. package/dist/nodes/trigger/ChatTrigger/error.js +1 -0
  294. package/dist/nodes/trigger/ChatTrigger/error.js.map +1 -0
  295. package/dist/nodes/trigger/ChatTrigger/templates.js +1 -0
  296. package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -0
  297. package/dist/nodes/trigger/ChatTrigger/types.js +1 -0
  298. package/dist/nodes/trigger/ChatTrigger/types.js.map +1 -0
  299. package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +1 -0
  300. package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -0
  301. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +1 -0
  302. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -0
  303. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +1 -0
  304. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -0
  305. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +1 -0
  306. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -0
  307. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js +1 -0
  308. package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js.map +1 -0
  309. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +1 -0
  310. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -0
  311. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js +1 -0
  312. package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js.map +1 -0
  313. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +1 -0
  314. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -0
  315. package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +1 -0
  316. package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -0
  317. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +1 -0
  318. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -0
  319. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js +1 -0
  320. package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js.map +1 -0
  321. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +1 -0
  322. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -0
  323. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +1 -0
  324. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -0
  325. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js +1 -0
  326. package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js.map +1 -0
  327. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +1 -0
  328. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -0
  329. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +1 -0
  330. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -0
  331. package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js +1 -0
  332. package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +1 -0
  333. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +1 -0
  334. package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +1 -0
  335. package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js +1 -0
  336. package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +1 -0
  337. package/dist/nodes/vector_store/shared/MemoryManager/config.js +1 -0
  338. package/dist/nodes/vector_store/shared/MemoryManager/config.js.map +1 -0
  339. package/dist/nodes/vector_store/shared/MemoryManager/types.js +1 -0
  340. package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +1 -0
  341. package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +1 -0
  342. package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +1 -0
  343. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +1 -0
  344. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -0
  345. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +1 -0
  346. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -0
  347. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +1 -0
  348. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -0
  349. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +1 -0
  350. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -0
  351. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +1 -0
  352. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -0
  353. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +1 -0
  354. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -0
  355. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +1 -0
  356. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -0
  357. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +1 -0
  358. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -0
  359. package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +1 -0
  360. package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +1 -0
  361. package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +1 -0
  362. package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +1 -0
  363. package/dist/nodes/vector_store/shared/descriptions.js +1 -0
  364. package/dist/nodes/vector_store/shared/descriptions.js.map +1 -0
  365. package/dist/nodes/vector_store/shared/processDocuments.js +1 -0
  366. package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
  367. package/dist/nodes/vendors/OpenAi/OpenAi.node.js +1 -0
  368. package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -0
  369. package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js +1 -0
  370. package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js.map +1 -0
  371. package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js +1 -0
  372. package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js.map +1 -0
  373. package/dist/nodes/vendors/OpenAi/actions/assistant/index.js +1 -0
  374. package/dist/nodes/vendors/OpenAi/actions/assistant/index.js.map +1 -0
  375. package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js +1 -0
  376. package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js.map +1 -0
  377. package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js +1 -0
  378. package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +1 -0
  379. package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js +1 -0
  380. package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js.map +1 -0
  381. package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js +1 -0
  382. package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js.map +1 -0
  383. package/dist/nodes/vendors/OpenAi/actions/audio/index.js +1 -0
  384. package/dist/nodes/vendors/OpenAi/actions/audio/index.js.map +1 -0
  385. package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js +1 -0
  386. package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js.map +1 -0
  387. package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js +1 -0
  388. package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js.map +1 -0
  389. package/dist/nodes/vendors/OpenAi/actions/descriptions.js +1 -0
  390. package/dist/nodes/vendors/OpenAi/actions/descriptions.js.map +1 -0
  391. package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js +1 -0
  392. package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js.map +1 -0
  393. package/dist/nodes/vendors/OpenAi/actions/file/index.js +1 -0
  394. package/dist/nodes/vendors/OpenAi/actions/file/index.js.map +1 -0
  395. package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js +1 -0
  396. package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js.map +1 -0
  397. package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js +1 -0
  398. package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js.map +1 -0
  399. package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js +1 -0
  400. package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js.map +1 -0
  401. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js +1 -0
  402. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +1 -0
  403. package/dist/nodes/vendors/OpenAi/actions/image/index.js +1 -0
  404. package/dist/nodes/vendors/OpenAi/actions/image/index.js.map +1 -0
  405. package/dist/nodes/vendors/OpenAi/actions/node.type.js +1 -0
  406. package/dist/nodes/vendors/OpenAi/actions/node.type.js.map +1 -0
  407. package/dist/nodes/vendors/OpenAi/actions/router.js +1 -0
  408. package/dist/nodes/vendors/OpenAi/actions/router.js.map +1 -0
  409. package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js +1 -0
  410. package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js.map +1 -0
  411. package/dist/nodes/vendors/OpenAi/actions/text/index.js +1 -0
  412. package/dist/nodes/vendors/OpenAi/actions/text/index.js.map +1 -0
  413. package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js +1 -0
  414. package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js.map +1 -0
  415. package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +1 -0
  416. package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +1 -0
  417. package/dist/nodes/vendors/OpenAi/helpers/constants.js +1 -0
  418. package/dist/nodes/vendors/OpenAi/helpers/constants.js.map +1 -0
  419. package/dist/nodes/vendors/OpenAi/helpers/error-handling.js +1 -0
  420. package/dist/nodes/vendors/OpenAi/helpers/error-handling.js.map +1 -0
  421. package/dist/nodes/vendors/OpenAi/helpers/interfaces.js +1 -0
  422. package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -0
  423. package/dist/nodes/vendors/OpenAi/helpers/utils.js +1 -0
  424. package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -0
  425. package/dist/nodes/vendors/OpenAi/methods/index.js +1 -0
  426. package/dist/nodes/vendors/OpenAi/methods/index.js.map +1 -0
  427. package/dist/nodes/vendors/OpenAi/methods/listSearch.js +1 -0
  428. package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -0
  429. package/dist/nodes/vendors/OpenAi/methods/loadOptions.js +1 -0
  430. package/dist/nodes/vendors/OpenAi/methods/loadOptions.js.map +1 -0
  431. package/dist/nodes/vendors/OpenAi/transport/index.js +1 -0
  432. package/dist/nodes/vendors/OpenAi/transport/index.js.map +1 -0
  433. package/dist/types/nodes.json +3 -0
  434. package/dist/types/types.js +1 -0
  435. package/dist/types/types.js.map +1 -0
  436. package/dist/types/zod.types.js +1 -0
  437. package/dist/types/zod.types.js.map +1 -0
  438. package/dist/utils/N8nBinaryLoader.js +1 -0
  439. package/dist/utils/N8nBinaryLoader.js.map +1 -0
  440. package/dist/utils/N8nJsonLoader.js +1 -0
  441. package/dist/utils/N8nJsonLoader.js.map +1 -0
  442. package/dist/utils/N8nTool.js +1 -0
  443. package/dist/utils/N8nTool.js.map +1 -0
  444. package/dist/utils/descriptions.js +1 -0
  445. package/dist/utils/descriptions.js.map +1 -0
  446. package/dist/utils/helpers.js +1 -0
  447. package/dist/utils/helpers.js.map +1 -0
  448. package/dist/utils/logWrapper.js +1 -0
  449. package/dist/utils/logWrapper.js.map +1 -0
  450. package/dist/utils/output_parsers/N8nItemListOutputParser.js +1 -0
  451. package/dist/utils/output_parsers/N8nItemListOutputParser.js.map +1 -0
  452. package/dist/utils/output_parsers/N8nOutputFixingParser.js +1 -0
  453. package/dist/utils/output_parsers/N8nOutputFixingParser.js.map +1 -0
  454. package/dist/utils/output_parsers/N8nOutputParser.js +1 -0
  455. package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -0
  456. package/dist/utils/output_parsers/N8nStructuredOutputParser.js +1 -0
  457. package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -0
  458. package/dist/utils/output_parsers/prompt.js +1 -0
  459. package/dist/utils/output_parsers/prompt.js.map +1 -0
  460. package/dist/utils/schemaParsing.js +1 -0
  461. package/dist/utils/schemaParsing.js.map +1 -0
  462. package/dist/utils/sharedFields.js +1 -0
  463. package/dist/utils/sharedFields.js.map +1 -0
  464. package/dist/utils/tracing.js +1 -0
  465. package/dist/utils/tracing.js.map +1 -0
  466. package/package.json +8 -5
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts"],"sourcesContent":["import type { Document } from '@langchain/core/documents';\nimport type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { TextSplitter } from '@langchain/textsplitters';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport { loadSummarizationChain } from 'langchain/chains';\nimport type {\n\tINodeTypeBaseDescription,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tIDataObject,\n\tINodeInputConfiguration,\n} from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport { N8nBinaryLoader } from '@utils/N8nBinaryLoader';\nimport { N8nJsonLoader } from '@utils/N8nJsonLoader';\nimport { getTemplateNoticeField } from '@utils/sharedFields';\nimport { getTracingConfig } from '@utils/tracing';\n\nimport { getChainPromptsArgs } from '../helpers';\nimport { REFINE_PROMPT_TEMPLATE, DEFAULT_PROMPT_TEMPLATE } from '../prompt';\n\nfunction getInputs(parameters: IDataObject) {\n\tconst chunkingMode = parameters?.chunkingMode;\n\tconst operationMode = parameters?.operationMode;\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\tif (operationMode === 'documentLoader') {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Document',\n\t\t\ttype: 'ai_document',\n\t\t\trequired: true,\n\t\t\tmaxConnections: 1,\n\t\t});\n\t\treturn inputs;\n\t}\n\n\tif (chunkingMode === 'advanced') {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Text Splitter',\n\t\t\ttype: 'ai_textSplitter',\n\t\t\trequired: false,\n\t\t\tmaxConnections: 1,\n\t\t});\n\t\treturn inputs;\n\t}\n\treturn inputs;\n}\n\nexport class ChainSummarizationV2 implements INodeType {\n\tdescription: INodeTypeDescription;\n\n\tconstructor(baseDescription: INodeTypeBaseDescription) {\n\t\tthis.description = {\n\t\t\t...baseDescription,\n\t\t\tversion: [2],\n\t\t\tdefaults: {\n\t\t\t\tname: 'Summarization Chain',\n\t\t\t\tcolor: '#909298',\n\t\t\t},\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\t\tinputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,\n\t\t\toutputs: [NodeConnectionTypes.Main],\n\t\t\tcredentials: [],\n\t\t\tproperties: [\n\t\t\t\tgetTemplateNoticeField(1951),\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Data to Summarize',\n\t\t\t\t\tname: 'operationMode',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdescription: 'How to pass data into the summarization chain',\n\t\t\t\t\tdefault: 'nodeInputJson',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Use Node Input (JSON)',\n\t\t\t\t\t\t\tvalue: 'nodeInputJson',\n\t\t\t\t\t\t\tdescription: 'Summarize the JSON data coming into this node from the previous one',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Use Node Input (Binary)',\n\t\t\t\t\t\t\tvalue: 'nodeInputBinary',\n\t\t\t\t\t\t\tdescription: 'Summarize the binary data coming into this node from the previous one',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Use Document Loader',\n\t\t\t\t\t\t\tvalue: 'documentLoader',\n\t\t\t\t\t\t\tdescription: 'Use a loader sub-node with more configuration options',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Chunking Strategy',\n\t\t\t\t\tname: 'chunkingMode',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tdescription: 'Chunk splitting strategy',\n\t\t\t\t\tdefault: 'simple',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Simple (Define Below)',\n\t\t\t\t\t\t\tvalue: 'simple',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'Advanced',\n\t\t\t\t\t\t\tvalue: 'advanced',\n\t\t\t\t\t\t\tdescription: 'Use a splitter sub-node with more configuration options',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'/operationMode': ['nodeInputJson', 'nodeInputBinary'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Characters Per Chunk',\n\t\t\t\t\tname: 'chunkSize',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Controls the max size (in terms of number of characters) of the final document chunk',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 1000,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'/chunkingMode': ['simple'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Chunk Overlap (Characters)',\n\t\t\t\t\tname: 'chunkOverlap',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdescription: 'Specifies how much characters overlap there should be between chunks',\n\t\t\t\t\tdefault: 200,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'/chunkingMode': ['simple'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Options',\n\t\t\t\t\tname: 'options',\n\t\t\t\t\ttype: 'collection',\n\t\t\t\t\tdefault: {},\n\t\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Input Data Field Name',\n\t\t\t\t\t\t\tname: 'binaryDataKey',\n\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\tdefault: 'data',\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t'The name of the field in the agent or chain’s input that contains the binary file to be processed',\n\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t'/operationMode': ['nodeInputBinary'],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Summarization Method and Prompts',\n\t\t\t\t\t\t\tname: 'summarizationMethodAndPrompts',\n\t\t\t\t\t\t\ttype: 'fixedCollection',\n\t\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\t\tvalues: {\n\t\t\t\t\t\t\t\t\tsummarizationMethod: 'map_reduce',\n\t\t\t\t\t\t\t\t\tprompt: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\tcombineMapPrompt: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\t\t\t\ttypeOptions: {},\n\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Summarization Method',\n\t\t\t\t\t\t\t\t\t\t\tname: 'summarizationMethod',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\t\t\t\tdescription: 'The type of summarization to run',\n\t\t\t\t\t\t\t\t\t\t\tdefault: 'map_reduce',\n\t\t\t\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'Map Reduce (Recommended)',\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: 'map_reduce',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Summarize each document (or chunk) individually, then summarize those summaries',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'Refine',\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: 'refine',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Summarize the first document (or chunk). Then update that summary based on the next document (or chunk), and repeat.',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'Stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue: 'stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Pass all documents (or chunks) at once. Ideal for small datasets.',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Individual Summary Prompt',\n\t\t\t\t\t\t\t\t\t\t\tname: 'combineMapPrompt',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\thint: 'The prompt to summarize an individual document (or chunk)',\n\t\t\t\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t'/options.summarizationMethodAndPrompts.values.summarizationMethod': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'refine',\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tdefault: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\trows: 9,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Final Prompt to Combine',\n\t\t\t\t\t\t\t\t\t\t\tname: 'prompt',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\tdefault: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\t\t\thint: 'The prompt to combine individual summaries',\n\t\t\t\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t'/options.summarizationMethodAndPrompts.values.summarizationMethod': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'refine',\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\trows: 9,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\t\t\t\t\t\t\tname: 'prompt',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\tdefault: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t'/options.summarizationMethodAndPrompts.values.summarizationMethod': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'refine',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'map_reduce',\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\trows: 9,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Subsequent (Refine) Prompt',\n\t\t\t\t\t\t\t\t\t\t\tname: 'refinePrompt',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t'/options.summarizationMethodAndPrompts.values.summarizationMethod': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'map_reduce',\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tdefault: REFINE_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\t\t\thint: 'The prompt to refine the summary based on the next document (or chunk)',\n\t\t\t\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\trows: 9,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: 'Initial Prompt',\n\t\t\t\t\t\t\t\t\t\t\tname: 'refineQuestionPrompt',\n\t\t\t\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t'/options.summarizationMethodAndPrompts.values.summarizationMethod': [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'stuff',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'map_reduce',\n\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tdefault: DEFAULT_PROMPT_TEMPLATE,\n\t\t\t\t\t\t\t\t\t\t\thint: 'The prompt for the first document (or chunk)',\n\t\t\t\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\t\t\t\trows: 9,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tthis.logger.debug('Executing Summarization Chain V2');\n\t\tconst operationMode = this.getNodeParameter('operationMode', 0, 'nodeInputJson') as\n\t\t\t| 'nodeInputJson'\n\t\t\t| 'nodeInputBinary'\n\t\t\t| 'documentLoader';\n\t\tconst chunkingMode = this.getNodeParameter('chunkingMode', 0, 'simple') as\n\t\t\t| 'simple'\n\t\t\t| 'advanced';\n\n\t\tconst items = this.getInputData();\n\t\tconst returnData: INodeExecutionData[] = [];\n\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\ttry {\n\t\t\t\tconst model = (await this.getInputConnectionData(\n\t\t\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\t\t\t0,\n\t\t\t\t)) as BaseLanguageModel;\n\n\t\t\t\tconst summarizationMethodAndPrompts = this.getNodeParameter(\n\t\t\t\t\t'options.summarizationMethodAndPrompts.values',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t{},\n\t\t\t\t) as {\n\t\t\t\t\tprompt?: string;\n\t\t\t\t\trefineQuestionPrompt?: string;\n\t\t\t\t\trefinePrompt?: string;\n\t\t\t\t\tsummarizationMethod: 'map_reduce' | 'stuff' | 'refine';\n\t\t\t\t\tcombineMapPrompt?: string;\n\t\t\t\t};\n\n\t\t\t\tconst chainArgs = getChainPromptsArgs(\n\t\t\t\t\tsummarizationMethodAndPrompts.summarizationMethod ?? 'map_reduce',\n\t\t\t\t\tsummarizationMethodAndPrompts,\n\t\t\t\t);\n\n\t\t\t\tconst chain = loadSummarizationChain(model, chainArgs);\n\t\t\t\tconst item = items[itemIndex];\n\n\t\t\t\tlet processedDocuments: Document[];\n\n\t\t\t\t// Use dedicated document loader input to load documents\n\t\t\t\tif (operationMode === 'documentLoader') {\n\t\t\t\t\tconst documentInput = (await this.getInputConnectionData(\n\t\t\t\t\t\tNodeConnectionTypes.AiDocument,\n\t\t\t\t\t\t0,\n\t\t\t\t\t)) as N8nJsonLoader | Array<Document<Record<string, unknown>>>;\n\n\t\t\t\t\tconst isN8nLoader =\n\t\t\t\t\t\tdocumentInput instanceof N8nJsonLoader || documentInput instanceof N8nBinaryLoader;\n\n\t\t\t\t\tprocessedDocuments = isN8nLoader\n\t\t\t\t\t\t? await documentInput.processItem(item, itemIndex)\n\t\t\t\t\t\t: documentInput;\n\n\t\t\t\t\tconst response = await chain.withConfig(getTracingConfig(this)).invoke({\n\t\t\t\t\t\tinput_documents: processedDocuments,\n\t\t\t\t\t});\n\n\t\t\t\t\treturnData.push({ json: { response } });\n\t\t\t\t}\n\n\t\t\t\t// Take the input and use binary or json loader\n\t\t\t\tif (['nodeInputJson', 'nodeInputBinary'].includes(operationMode)) {\n\t\t\t\t\tlet textSplitter: TextSplitter | undefined;\n\n\t\t\t\t\tswitch (chunkingMode) {\n\t\t\t\t\t\t// In simple mode we use recursive character splitter with default settings\n\t\t\t\t\t\tcase 'simple':\n\t\t\t\t\t\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex, 1000) as number;\n\t\t\t\t\t\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex, 200) as number;\n\n\t\t\t\t\t\t\ttextSplitter = new RecursiveCharacterTextSplitter({ chunkOverlap, chunkSize });\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t// In advanced mode user can connect text splitter node so we just retrieve it\n\t\t\t\t\t\tcase 'advanced':\n\t\t\t\t\t\t\ttextSplitter = (await this.getInputConnectionData(\n\t\t\t\t\t\t\t\tNodeConnectionTypes.AiTextSplitter,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t)) as TextSplitter | undefined;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet processor: N8nJsonLoader | N8nBinaryLoader;\n\t\t\t\t\tif (operationMode === 'nodeInputBinary') {\n\t\t\t\t\t\tconst binaryDataKey = this.getNodeParameter(\n\t\t\t\t\t\t\t'options.binaryDataKey',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t'data',\n\t\t\t\t\t\t) as string;\n\t\t\t\t\t\tprocessor = new N8nBinaryLoader(this, 'options.', binaryDataKey, textSplitter);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprocessor = new N8nJsonLoader(this, 'options.', textSplitter);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst processedItem = await processor.processItem(item, itemIndex);\n\t\t\t\t\tconst response = await chain.invoke(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinput_documents: processedItem,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ signal: this.getExecutionCancelSignal() },\n\t\t\t\t\t);\n\t\t\t\t\treturnData.push({ json: { response } });\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,2BAA+C;AAC/C,oBAAuC;AAUvC,0BAAoC;AAEpC,6BAAgC;AAChC,2BAA8B;AAC9B,0BAAuC;AACvC,qBAAiC;AAEjC,qBAAoC;AACpC,oBAAgE;AAEhE,SAAS,UAAU,YAAyB;AAC3C,QAAM,eAAe,YAAY;AACjC,QAAM,gBAAgB,YAAY;AAClC,QAAM,SAAoC;AAAA,IACzC,EAAE,aAAa,IAAI,MAAM,OAAO;AAAA,IAChC;AAAA,MACC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AAEA,MAAI,kBAAkB,kBAAkB;AACvC,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,MAAM;AAAA,MACN,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB,CAAC;AACD,WAAO;AAAA,EACR;AAEA,MAAI,iBAAiB,YAAY;AAChC,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,MAAM;AAAA,MACN,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB,CAAC;AACD,WAAO;AAAA,EACR;AACA,SAAO;AACR;AAEO,MAAM,qBAA0C;AAAA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ainPromptsArgs
73
73
  });
74
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/ChainSummarization/helpers.ts"],"sourcesContent":["import { PromptTemplate } from '@langchain/core/prompts';\nimport type { SummarizationChainParams } from 'langchain/chains';\ninterface ChainTypeOptions {\n\tcombineMapPrompt?: string;\n\tprompt?: string;\n\trefinePrompt?: string;\n\trefineQuestionPrompt?: string;\n}\n\nexport function getChainPromptsArgs(\n\ttype: 'stuff' | 'map_reduce' | 'refine',\n\toptions: ChainTypeOptions,\n) {\n\tconst chainArgs: SummarizationChainParams = {\n\t\ttype,\n\t};\n\t// Map reduce prompt override\n\tif (type === 'map_reduce') {\n\t\tconst mapReduceArgs = chainArgs as SummarizationChainParams & {\n\t\t\ttype: 'map_reduce';\n\t\t};\n\t\tif (options.combineMapPrompt) {\n\t\t\tmapReduceArgs.combineMapPrompt = new PromptTemplate({\n\t\t\t\ttemplate: options.combineMapPrompt,\n\t\t\t\tinputVariables: ['text'],\n\t\t\t});\n\t\t}\n\t\tif (options.prompt) {\n\t\t\tmapReduceArgs.combinePrompt = new PromptTemplate({\n\t\t\t\ttemplate: options.prompt,\n\t\t\t\tinputVariables: ['text'],\n\t\t\t});\n\t\t}\n\t}\n\n\t// Stuff prompt override\n\tif (type === 'stuff') {\n\t\tconst stuffArgs = chainArgs as SummarizationChainParams & {\n\t\t\ttype: 'stuff';\n\t\t};\n\t\tif (options.prompt) {\n\t\t\tstuffArgs.prompt = new PromptTemplate({\n\t\t\t\ttemplate: options.prompt,\n\t\t\t\tinputVariables: ['text'],\n\t\t\t});\n\t\t}\n\t}\n\n\t// Refine prompt override\n\tif (type === 'refine') {\n\t\tconst refineArgs = chainArgs as SummarizationChainParams & {\n\t\t\ttype: 'refine';\n\t\t};\n\n\t\tif (options.refinePrompt) {\n\t\t\trefineArgs.refinePrompt = new PromptTemplate({\n\t\t\t\ttemplate: options.refinePrompt,\n\t\t\t\tinputVariables: ['existing_answer', 'text'],\n\t\t\t});\n\t\t}\n\n\t\tif (options.refineQuestionPrompt) {\n\t\t\trefineArgs.questionPrompt = new PromptTemplate({\n\t\t\t\ttemplate: options.refineQuestionPrompt,\n\t\t\t\tinputVariables: ['text'],\n\t\t\t});\n\t\t}\n\t}\n\n\treturn chainArgs;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B;AASxB,SAAS,oBACf,MACA,SACC;AACD,QAAM,YAAsC;AAAA,IAC3C;AAAA,EACD;AAEA,MAAI,SAAS,cAAc;AAC1B,UAAM,gBAAgB;AAGtB,QAAI,QAAQ,kBAAkB;AAC7B,oBAAc,mBAAmB,IAAI,8BAAe;AAAA,QACnD,UAAU,QAAQ;AAAA,QAClB,gBAAgB,CAAC,MAAM;AAAA,MACxB,CAAC;AAAA,IACF;AACA,QAAI,QAAQ,QAAQ;AACnB,oBAAc,gBAAgB,IAAI,8BAAe;AAAA,QAChD,UAAU,QAAQ;AAAA,QAClB,gBAAgB,CAAC,MAAM;AAAA,MACxB,CAAC;AAAA,IACF;AAAA,EACD;AAGA,MAAI,SAAS,SAAS;AACrB,UAAM,YAAY;AAGlB,QAAI,QAAQ,QAAQ;AACnB,gBAAU,SAAS,IAAI,8BAAe;AAAA,QACrC,UAAU,QAAQ;AAAA,QAClB,gBAAgB,CAAC,MAAM;AAAA,MACxB,CAAC;AAAA,IACF;AAAA,EACD;AAGA,MAAI,SAAS,UAAU;AACtB,UAAM,aAAa;AAInB,QAAI,QAAQ,cAAc;AACzB,iBAAW,eAAe,IAAI,8BAAe;AAAA,QAC5C,UAAU,QAAQ;AAAA,QAClB,gBAAgB,CAAC,mBAAmB,MAAM;AAAA,MAC3C,CAAC;AAAA,IACF;AAEA,QAAI,QAAQ,sBAAsB;AACjC,iBAAW,iBAAiB,IAAI,8BAAe;AAAA,QAC9C,UAAU,QAAQ;AAAA,QAClB,gBAAgB,CAAC,MAAM;AAAA,MACxB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
@@ -46,3 +46,4 @@ CONCISE SUMMARY:`;
46
46
  DEFAULT_PROMPT_TEMPLATE,
47
47
  REFINE_PROMPT_TEMPLATE
48
48
  });
49
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/ChainSummarization/prompt.ts"],"sourcesContent":["export const REFINE_PROMPT_TEMPLATE = `Your job is to produce a final summary\nWe have provided an existing summary up to a certain point: \"{existing_answer}\"\nWe have the opportunity to refine the existing summary\n(only if needed) with some more context below.\n------------\n\"{text}\"\n------------\n\nGiven the new context, refine the original summary\nIf the context isn't useful, return the original summary.\n\nREFINED SUMMARY:`;\n\nexport const DEFAULT_PROMPT_TEMPLATE = `Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:`;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAa/B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -293,3 +293,4 @@ class InformationExtractor {
293
293
  0 && (module.exports = {
294
294
  InformationExtractor
295
295
  });
296
+ //# sourceMappingURL=InformationExtractor.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/InformationExtractor/InformationExtractor.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { ChatPromptTemplate, SystemMessagePromptTemplate } from '@langchain/core/prompts';\nimport type { JSONSchema7 } from 'json-schema';\nimport { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers';\nimport { jsonParse, NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tINodeType,\n\tINodeTypeDescription,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodePropertyOptions,\n} from 'n8n-workflow';\nimport type { z } from 'zod';\n\nimport { inputSchemaField, jsonSchemaExampleField, schemaTypeField } from '@utils/descriptions';\nimport { convertJsonSchemaToZod, generateSchema } from '@utils/schemaParsing';\nimport { getTracingConfig } from '@utils/tracing';\n\nimport { makeZodSchemaFromAttributes } from './helpers';\nimport type { AttributeDefinition } from './types';\n\nconst SYSTEM_PROMPT_TEMPLATE = `You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value.`;\n\nexport class InformationExtractor implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Information Extractor',\n\t\tname: 'informationExtractor',\n\t\ticon: 'fa:project-diagram',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Extract information from text in a structured format',\n\t\tcodex: {\n\t\t\talias: ['NER', 'parse', 'parsing', 'JSON', 'data extraction', 'structured'],\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.information-extractor/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tdefaults: {\n\t\t\tname: 'Information Extractor',\n\t\t},\n\t\tinputs: [\n\t\t\t{ displayName: '', type: NodeConnectionTypes.Main },\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text',\n\t\t\t\tname: 'text',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The text to extract information from',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...schemaTypeField,\n\t\t\t\tdescription: 'How to specify the schema for the desired output',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'From Attribute Descriptions',\n\t\t\t\t\t\tvalue: 'fromAttributes',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Extract specific attributes from the text based on types and descriptions',\n\t\t\t\t\t} as INodePropertyOptions,\n\t\t\t\t\t...(schemaTypeField.options as INodePropertyOptions[]),\n\t\t\t\t],\n\t\t\t\tdefault: 'fromAttributes',\n\t\t\t},\n\t\t\t{\n\t\t\t\t...jsonSchemaExampleField,\n\t\t\t\tdefault: `{\n\t\"state\": \"California\",\n\t\"cities\": [\"Los Angeles\", \"San Francisco\", \"San Diego\"]\n}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\t...inputSchemaField,\n\t\t\t\tdefault: `{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"state\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"cities\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'The schema has to be defined in the <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format. Look at <a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">this</a> page for examples.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tschemaType: ['manual'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Attributes',\n\t\t\t\tname: 'attributes',\n\t\t\t\tplaceholder: 'Add Attribute',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: {},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tschemaType: ['fromAttributes'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'attributes',\n\t\t\t\t\t\tdisplayName: 'Attribute List',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Attribute to extract',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. company_name',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdescription: 'Data type of the attribute',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Boolean',\n\t\t\t\t\t\t\t\t\t\tvalue: 'boolean',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Date',\n\t\t\t\t\t\t\t\t\t\tvalue: 'date',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Number',\n\t\t\t\t\t\t\t\t\t\tvalue: 'number',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'String',\n\t\t\t\t\t\t\t\t\t\tvalue: 'string',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tdefault: 'string',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\t\t\t\tname: 'description',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Describe your attribute',\n\t\t\t\t\t\t\t\tplaceholder: 'Add description for the attribute',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Required',\n\t\t\t\t\t\t\t\tname: 'required',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription: 'Whether attribute is required',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'System Prompt Template',\n\t\t\t\t\t\tname: 'systemPromptTemplate',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: SYSTEM_PROMPT_TEMPLATE,\n\t\t\t\t\t\tdescription: 'String to use directly as the system prompt template',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 6,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\n\t\tconst llm = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\t0,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst schemaType = this.getNodeParameter('schemaType', 0, '') as\n\t\t\t| 'fromAttributes'\n\t\t\t| 'fromJson'\n\t\t\t| 'manual';\n\n\t\tlet parser: OutputFixingParser<object>;\n\n\t\tif (schemaType === 'fromAttributes') {\n\t\t\tconst attributes = this.getNodeParameter(\n\t\t\t\t'attributes.attributes',\n\t\t\t\t0,\n\t\t\t\t[],\n\t\t\t) as AttributeDefinition[];\n\n\t\t\tif (attributes.length === 0) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'At least one attribute must be specified');\n\t\t\t}\n\n\t\t\tparser = OutputFixingParser.fromLLM(\n\t\t\t\tllm,\n\t\t\t\tStructuredOutputParser.fromZodSchema(makeZodSchemaFromAttributes(attributes)),\n\t\t\t);\n\t\t} else {\n\t\t\tlet jsonSchema: JSONSchema7;\n\n\t\t\tif (schemaType === 'fromJson') {\n\t\t\t\tconst jsonExample = this.getNodeParameter('jsonSchemaExample', 0, '') as string;\n\t\t\t\tjsonSchema = generateSchema(jsonExample);\n\t\t\t} else {\n\t\t\t\tconst inputSchema = this.getNodeParameter('inputSchema', 0, '') as string;\n\t\t\t\tjsonSchema = jsonParse<JSONSchema7>(inputSchema);\n\t\t\t}\n\n\t\t\tconst zodSchema = convertJsonSchemaToZod<z.ZodSchema<object>>(jsonSchema);\n\n\t\t\tparser = OutputFixingParser.fromLLM(llm, StructuredOutputParser.fromZodSchema(zodSchema));\n\t\t}\n\n\t\tconst resultData: INodeExecutionData[] = [];\n\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\tconst input = this.getNodeParameter('text', itemIndex) as string;\n\t\t\tconst inputPrompt = new HumanMessage(input);\n\n\t\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\t\tsystemPromptTemplate?: string;\n\t\t\t};\n\n\t\t\tconst systemPromptTemplate = SystemMessagePromptTemplate.fromTemplate(\n\t\t\t\t`${options.systemPromptTemplate ?? SYSTEM_PROMPT_TEMPLATE}\n{format_instructions}`,\n\t\t\t);\n\n\t\t\tconst messages = [\n\t\t\t\tawait systemPromptTemplate.format({\n\t\t\t\t\tformat_instructions: parser.getFormatInstructions(),\n\t\t\t\t}),\n\t\t\t\tinputPrompt,\n\t\t\t];\n\t\t\tconst prompt = ChatPromptTemplate.fromMessages(messages);\n\t\t\tconst chain = prompt.pipe(llm).pipe(parser).withConfig(getTracingConfig(this));\n\n\t\t\ttry {\n\t\t\t\tconst output = await chain.invoke(messages);\n\t\t\t\tresultData.push({ json: { output } });\n\t\t\t} catch (error) {\n\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\tresultData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn [resultData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA6B;AAC7B,qBAAgE;AAEhE,4BAA2D;AAC3D,0BAAmE;AAUnE,0BAA0E;AAC1E,2BAAuD;AACvD,qBAAiC;AAEjC,qBAA4C;AAG5C,MAAM,yBAAyB;AAAA;AAAA;AAIxB,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,OAAO;AAAA,QACN,OAAO,CAAC,OAAO,SAAS,WAAW,QAAQ,mBAAmB,YAAY;AAAA,QAC1E,YAAY,CAAC,IAAI;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,6BAAa,KAAK;AAE1C,YAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAI9D,YAAM,uBAAuB,2CAA4B;AAAA,QACxD,GAAG,QAAQ,wBAAwB,sBAAsB;AAAA;AAAA,MAE1D;AAEA,YAAM,WAAW;AAAA,QAChB,MAAM,qBAAqB,OAAO;AAAA,UACjC,qBAAqB,OAAO,sBAAsB;AAAA,QACnD,CAAC;AAAA,QACD;AAAA,MACD;AACA,YAAM,SAAS,kCAAmB,aAAa,QAAQ;AACvD,YAAM,QAAQ,OAAO,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,eAAW,iCAAiB,IAAI,CAAC;AAE7E,UAAI;AACH,cAAM,SAAS,MAAM,MAAM,OAAO,QAAQ;AAC1C,mBAAW,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAAA,MACrC,SAAS,OAAO;AACf,YAAI,KAAK,eAAe,GAAG;AAC1B,qBAAW,KAAK,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,GAAG,YAAY,EAAE,MAAM,UAAU,EAAE,CAAC;AACnF;AAAA,QACD;AAEA,cAAM;AAAA,MACP;AAAA,IACD;AAEA,WAAO,CAAC,UAAU;AAAA,EACnB;AACD;","names":[]}
@@ -51,3 +51,4 @@ function makeZodSchemaFromAttributes(attributes) {
51
51
  0 && (module.exports = {
52
52
  makeZodSchemaFromAttributes
53
53
  });
54
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/InformationExtractor/helpers.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport type { AttributeDefinition } from './types';\n\nfunction makeAttributeSchema(attributeDefinition: AttributeDefinition, required: boolean = true) {\n\tlet schema: z.ZodTypeAny;\n\n\tif (attributeDefinition.type === 'string') {\n\t\tschema = z.string();\n\t} else if (attributeDefinition.type === 'number') {\n\t\tschema = z.number();\n\t} else if (attributeDefinition.type === 'boolean') {\n\t\tschema = z.boolean();\n\t} else if (attributeDefinition.type === 'date') {\n\t\tschema = z.string().date();\n\t} else {\n\t\tschema = z.unknown();\n\t}\n\n\tif (!required) {\n\t\tschema = schema.optional();\n\t}\n\n\treturn schema.describe(attributeDefinition.description);\n}\n\nexport function makeZodSchemaFromAttributes(attributes: AttributeDefinition[]) {\n\tconst schemaEntries = attributes.map((attr) => [\n\t\tattr.name,\n\t\tmakeAttributeSchema(attr, attr.required),\n\t]);\n\n\treturn z.object(Object.fromEntries(schemaEntries));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAkB;AAIlB,SAAS,oBAAoB,qBAA0C,WAAoB,MAAM;AAChG,MAAI;AAEJ,MAAI,oBAAoB,SAAS,UAAU;AAC1C,aAAS,aAAE,OAAO;AAAA,EACnB,WAAW,oBAAoB,SAAS,UAAU;AACjD,aAAS,aAAE,OAAO;AAAA,EACnB,WAAW,oBAAoB,SAAS,WAAW;AAClD,aAAS,aAAE,QAAQ;AAAA,EACpB,WAAW,oBAAoB,SAAS,QAAQ;AAC/C,aAAS,aAAE,OAAO,EAAE,KAAK;AAAA,EAC1B,OAAO;AACN,aAAS,aAAE,QAAQ;AAAA,EACpB;AAEA,MAAI,CAAC,UAAU;AACd,aAAS,OAAO,SAAS;AAAA,EAC1B;AAEA,SAAO,OAAO,SAAS,oBAAoB,WAAW;AACvD;AAEO,SAAS,4BAA4B,YAAmC;AAC9E,QAAM,gBAAgB,WAAW,IAAI,CAAC,SAAS;AAAA,IAC9C,KAAK;AAAA,IACL,oBAAoB,MAAM,KAAK,QAAQ;AAAA,EACxC,CAAC;AAED,SAAO,aAAE,OAAO,OAAO,YAAY,aAAa,CAAC;AAClD;","names":[]}
@@ -14,3 +14,4 @@ var __copyProps = (to, from, except, desc) => {
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
15
  var types_exports = {};
16
16
  module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/InformationExtractor/types.ts"],"sourcesContent":["export interface AttributeDefinition {\n\tname: string;\n\tdescription: string;\n\ttype: 'string' | 'number' | 'boolean' | 'date';\n\trequired: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -236,3 +236,4 @@ class SentimentAnalysis {
236
236
  0 && (module.exports = {
237
237
  SentimentAnalysis
238
238
  });
239
+ //# sourceMappingURL=SentimentAnalysis.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/SentimentAnalysis/SentimentAnalysis.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { SystemMessagePromptTemplate, ChatPromptTemplate } from '@langchain/core/prompts';\nimport { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeParameters,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { z } from 'zod';\n\nimport { getTracingConfig } from '@utils/tracing';\n\nconst DEFAULT_SYSTEM_PROMPT_TEMPLATE =\n\t'You are highly intelligent and accurate sentiment analyzer. Analyze the sentiment of the provided text. Categorize it into one of the following: {categories}. Use the provided formatting instructions. Only output the JSON.';\n\nconst DEFAULT_CATEGORIES = 'Positive, Neutral, Negative';\nconst configuredOutputs = (parameters: INodeParameters, defaultCategories: string) => {\n\tconst options = (parameters?.options ?? {}) as IDataObject;\n\tconst categories = (options?.categories as string) ?? defaultCategories;\n\tconst categoriesArray = categories.split(',').map((cat) => cat.trim());\n\n\tconst ret = categoriesArray.map((cat) => ({ type: 'main', displayName: cat }));\n\treturn ret;\n};\n\nexport class SentimentAnalysis implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Sentiment Analysis',\n\t\tname: 'sentimentAnalysis',\n\t\ticon: 'fa:balance-scale-left',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Analyze the sentiment of your text',\n\t\tcodex: {\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.sentimentanalysis/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tdefaults: {\n\t\t\tname: 'Sentiment Analysis',\n\t\t},\n\t\tinputs: [\n\t\t\t{ displayName: '', type: NodeConnectionTypes.Main },\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: `={{(${configuredOutputs})($parameter, \"${DEFAULT_CATEGORIES}\")}}`,\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text to Analyze',\n\t\t\t\tname: 'inputText',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Use an expression to reference data in previous nodes or enter static text',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Sentiment scores are LLM-generated estimates, not statistically rigorous measurements. They may be inconsistent across runs and should be used as rough indicators only.',\n\t\t\t\tname: 'detailedResultsNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/options.includeDetailedResults': [true],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Sentiment Categories',\n\t\t\t\t\t\tname: 'categories',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: DEFAULT_CATEGORIES,\n\t\t\t\t\t\tdescription: 'A comma-separated list of categories to analyze',\n\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 2,\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: 'System Prompt Template',\n\t\t\t\t\t\tname: 'systemPromptTemplate',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: DEFAULT_SYSTEM_PROMPT_TEMPLATE,\n\t\t\t\t\t\tdescription: 'String to use directly as the system prompt template',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 6,\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: 'Include Detailed Results',\n\t\t\t\t\t\tname: 'includeDetailedResults',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to include sentiment strength and confidence scores in the output',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Enable Auto-Fixing',\n\t\t\t\t\t\tname: 'enableAutoFixing',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to enable auto-fixing (may trigger an additional LLM call if output is broken)',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\n\t\tconst llm = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\t0,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst returnData: INodeExecutionData[][] = [];\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\ttry {\n\t\t\t\tconst sentimentCategories = this.getNodeParameter(\n\t\t\t\t\t'options.categories',\n\t\t\t\t\ti,\n\t\t\t\t\tDEFAULT_CATEGORIES,\n\t\t\t\t) as string;\n\n\t\t\t\tconst categories = sentimentCategories\n\t\t\t\t\t.split(',')\n\t\t\t\t\t.map((cat) => cat.trim())\n\t\t\t\t\t.filter(Boolean);\n\n\t\t\t\tif (categories.length === 0) {\n\t\t\t\t\tthrow new NodeOperationError(this.getNode(), 'No sentiment categories provided', {\n\t\t\t\t\t\titemIndex: i,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Initialize returnData with empty arrays for each category\n\t\t\t\tif (returnData.length === 0) {\n\t\t\t\t\treturnData.push(...Array.from({ length: categories.length }, () => []));\n\t\t\t\t}\n\n\t\t\t\tconst options = this.getNodeParameter('options', i, {}) as {\n\t\t\t\t\tsystemPromptTemplate?: string;\n\t\t\t\t\tincludeDetailedResults?: boolean;\n\t\t\t\t\tenableAutoFixing?: boolean;\n\t\t\t\t};\n\n\t\t\t\tconst schema = z.object({\n\t\t\t\t\tsentiment: z.enum(categories as [string, ...string[]]),\n\t\t\t\t\tstrength: z\n\t\t\t\t\t\t.number()\n\t\t\t\t\t\t.min(0)\n\t\t\t\t\t\t.max(1)\n\t\t\t\t\t\t.describe('Strength score for sentiment in relation to the category'),\n\t\t\t\t\tconfidence: z.number().min(0).max(1),\n\t\t\t\t});\n\n\t\t\t\tconst structuredParser = StructuredOutputParser.fromZodSchema(schema);\n\n\t\t\t\tconst parser = options.enableAutoFixing\n\t\t\t\t\t? OutputFixingParser.fromLLM(llm, structuredParser)\n\t\t\t\t\t: structuredParser;\n\n\t\t\t\tconst systemPromptTemplate = SystemMessagePromptTemplate.fromTemplate(\n\t\t\t\t\t`${options.systemPromptTemplate ?? DEFAULT_SYSTEM_PROMPT_TEMPLATE}\n\t\t{format_instructions}`,\n\t\t\t\t);\n\n\t\t\t\tconst input = this.getNodeParameter('inputText', i) as string;\n\t\t\t\tconst inputPrompt = new HumanMessage(input);\n\t\t\t\tconst messages = [\n\t\t\t\t\tawait systemPromptTemplate.format({\n\t\t\t\t\t\tcategories: sentimentCategories,\n\t\t\t\t\t\tformat_instructions: parser.getFormatInstructions(),\n\t\t\t\t\t}),\n\t\t\t\t\tinputPrompt,\n\t\t\t\t];\n\n\t\t\t\tconst prompt = ChatPromptTemplate.fromMessages(messages);\n\t\t\t\tconst chain = prompt.pipe(llm).pipe(parser).withConfig(getTracingConfig(this));\n\n\t\t\t\ttry {\n\t\t\t\t\tconst output = await chain.invoke(messages);\n\t\t\t\t\tconst sentimentIndex = categories.findIndex(\n\t\t\t\t\t\t(s) => s.toLowerCase() === output.sentiment.toLowerCase(),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (sentimentIndex !== -1) {\n\t\t\t\t\t\tconst resultItem = { ...items[i] };\n\t\t\t\t\t\tconst sentimentAnalysis: IDataObject = {\n\t\t\t\t\t\t\tcategory: output.sentiment,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (options.includeDetailedResults) {\n\t\t\t\t\t\t\tsentimentAnalysis.strength = output.strength;\n\t\t\t\t\t\t\tsentimentAnalysis.confidence = output.confidence;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresultItem.json = {\n\t\t\t\t\t\t\t...resultItem.json,\n\t\t\t\t\t\t\tsentimentAnalysis,\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturnData[sentimentIndex].push(resultItem);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\tthis.getNode(),\n\t\t\t\t\t\t'Error during parsing of LLM output, please check your LLM model and configuration',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titemIndex: i,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\tconst executionErrorData = this.helpers.constructExecutionMetaData(\n\t\t\t\t\t\tthis.helpers.returnJsonArray({ error: error.message }),\n\t\t\t\t\t\t{ itemData: { item: i } },\n\t\t\t\t\t);\n\t\t\t\t\treturnData[0].push(...executionErrorData);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\treturn returnData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA6B;AAC7B,qBAAgE;AAChE,4BAA2D;AAC3D,0BAAwD;AASxD,iBAAkB;AAElB,qBAAiC;AAEjC,MAAM,iCACL;AAED,MAAM,qBAAqB;AAC3B,MAAM,oBAAoB,CAAC,YAA6B,sBAA8B;AACrF,QAAM,UAAW,YAAY,WAAW,CAAC;AACzC,QAAM,aAAc,SAAS,cAAyB;AACtD,QAAM,kBAAkB,WAAW,MAAM,GAAG,EAAE,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;AAErE,QAAM,MAAM,gBAAgB,IAAI,CAAC,SAAS,EAAE,MAAM,QAAQ,aAAa,IAAI,EAAE;AAC7E,SAAO;AACR;AAEO,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eA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B,gBAAM,qBAAqB,KAAK,QAAQ;AAAA,YACvC,KAAK,QAAQ,gBAAgB,EAAE,OAAO,MAAM,QAAQ,CAAC;AAAA,YACrD,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE;AAAA,UACzB;AACA,qBAAW,CAAC,EAAE,KAAK,GAAG,kBAAkB;AACxC;AAAA,QACD;AACA,cAAM;AAAA,MACP;AAAA,IACD;AACA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -257,3 +257,4 @@ ${fallbackPrompt}`
257
257
  0 && (module.exports = {
258
258
  TextClassifier
259
259
  });
260
+ //# sourceMappingURL=TextClassifier.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/chains/TextClassifier/TextClassifier.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { SystemMessagePromptTemplate, ChatPromptTemplate } from '@langchain/core/prompts';\nimport { OutputFixingParser, StructuredOutputParser } from 'langchain/output_parsers';\nimport { NodeOperationError, NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeParameters,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { z } from 'zod';\n\nimport { getTracingConfig } from '@utils/tracing';\n\nconst SYSTEM_PROMPT_TEMPLATE =\n\t\"Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.\";\n\nconst configuredOutputs = (parameters: INodeParameters) => {\n\tconst categories = ((parameters.categories as IDataObject)?.categories as IDataObject[]) ?? [];\n\tconst fallback = (parameters.options as IDataObject)?.fallback as string;\n\tconst ret = categories.map((cat) => {\n\t\treturn { type: 'main', displayName: cat.category };\n\t});\n\tif (fallback === 'other') ret.push({ type: 'main', displayName: 'Other' });\n\treturn ret;\n};\n\nexport class TextClassifier implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Text Classifier',\n\t\tname: 'textClassifier',\n\t\ticon: 'fa:tags',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Classify your text into distinct categories',\n\t\tcodex: {\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.text-classifier/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tdefaults: {\n\t\t\tname: 'Text Classifier',\n\t\t},\n\t\tinputs: [\n\t\t\t{ displayName: '', type: NodeConnectionTypes.Main },\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: `={{(${configuredOutputs})($parameter)}}`,\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text to Classify',\n\t\t\t\tname: 'inputText',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Use an expression to reference data in previous nodes or enter static text',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Categories',\n\t\t\t\tname: 'categories',\n\t\t\t\tplaceholder: 'Add Category',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdefault: {},\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'categories',\n\t\t\t\t\t\tdisplayName: 'Categories',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Category',\n\t\t\t\t\t\t\t\tname: 'category',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: 'Category to add',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\t\t\t\tname: 'description',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdescription: \"Describe your category if it's not obvious\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Allow Multiple Classes To Be True',\n\t\t\t\t\t\tname: 'multiClass',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'When No Clear Match',\n\t\t\t\t\t\tname: 'fallback',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdefault: 'discard',\n\t\t\t\t\t\tdescription: 'What to do with items that don’t match the categories exactly',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Discard Item',\n\t\t\t\t\t\t\t\tvalue: 'discard',\n\t\t\t\t\t\t\t\tdescription: 'Ignore the item and drop it from the output',\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: \"Output on Extra, 'Other' Branch\",\n\t\t\t\t\t\t\t\tvalue: 'other',\n\t\t\t\t\t\t\t\tdescription: \"Create a separate output branch called 'Other'\",\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: 'System Prompt Template',\n\t\t\t\t\t\tname: 'systemPromptTemplate',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: SYSTEM_PROMPT_TEMPLATE,\n\t\t\t\t\t\tdescription: 'String to use directly as the system prompt template',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 6,\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: 'Enable Auto-Fixing',\n\t\t\t\t\t\tname: 'enableAutoFixing',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Whether to enable auto-fixing (may trigger an additional LLM call if output is broken)',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst items = this.getInputData();\n\n\t\tconst llm = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\t0,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst categories = this.getNodeParameter('categories.categories', 0, []) as Array<{\n\t\t\tcategory: string;\n\t\t\tdescription: string;\n\t\t}>;\n\n\t\tif (categories.length === 0) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'At least one category must be defined');\n\t\t}\n\n\t\tconst options = this.getNodeParameter('options', 0, {}) as {\n\t\t\tmultiClass: boolean;\n\t\t\tfallback?: string;\n\t\t\tsystemPromptTemplate?: string;\n\t\t\tenableAutoFixing: boolean;\n\t\t};\n\t\tconst multiClass = options?.multiClass ?? false;\n\t\tconst fallback = options?.fallback ?? 'discard';\n\n\t\tconst schemaEntries = categories.map((cat) => [\n\t\t\tcat.category,\n\t\t\tz\n\t\t\t\t.boolean()\n\t\t\t\t.describe(\n\t\t\t\t\t`Should be true if the input has category \"${cat.category}\" (description: ${cat.description})`,\n\t\t\t\t),\n\t\t]);\n\t\tif (fallback === 'other')\n\t\t\tschemaEntries.push([\n\t\t\t\t'fallback',\n\t\t\t\tz.boolean().describe('Should be true if none of the other categories apply'),\n\t\t\t]);\n\t\tconst schema = z.object(Object.fromEntries(schemaEntries));\n\n\t\tconst structuredParser = StructuredOutputParser.fromZodSchema(schema);\n\n\t\tconst parser = options.enableAutoFixing\n\t\t\t? OutputFixingParser.fromLLM(llm, structuredParser)\n\t\t\t: structuredParser;\n\n\t\tconst multiClassPrompt = multiClass\n\t\t\t? 'Categories are not mutually exclusive, and multiple can be true'\n\t\t\t: 'Categories are mutually exclusive, and only one can be true';\n\n\t\tconst fallbackPrompt = {\n\t\t\tother: 'If no categories apply, select the \"fallback\" option.',\n\t\t\tdiscard: 'If there is not a very fitting category, select none of the categories.',\n\t\t}[fallback];\n\n\t\tconst returnData: INodeExecutionData[][] = Array.from(\n\t\t\t{ length: categories.length + (fallback === 'other' ? 1 : 0) },\n\t\t\t(_) => [],\n\t\t);\n\t\tfor (let itemIdx = 0; itemIdx < items.length; itemIdx++) {\n\t\t\tconst item = items[itemIdx];\n\t\t\titem.pairedItem = { item: itemIdx };\n\t\t\tconst input = this.getNodeParameter('inputText', itemIdx) as string;\n\t\t\tconst inputPrompt = new HumanMessage(input);\n\n\t\t\tconst systemPromptTemplateOpt = this.getNodeParameter(\n\t\t\t\t'options.systemPromptTemplate',\n\t\t\t\titemIdx,\n\t\t\t\tSYSTEM_PROMPT_TEMPLATE,\n\t\t\t) as string;\n\t\t\tconst systemPromptTemplate = SystemMessagePromptTemplate.fromTemplate(\n\t\t\t\t`${systemPromptTemplateOpt ?? SYSTEM_PROMPT_TEMPLATE}\n{format_instructions}\n${multiClassPrompt}\n${fallbackPrompt}`,\n\t\t\t);\n\n\t\t\tconst messages = [\n\t\t\t\tawait systemPromptTemplate.format({\n\t\t\t\t\tcategories: categories.map((cat) => cat.category).join(', '),\n\t\t\t\t\tformat_instructions: parser.getFormatInstructions(),\n\t\t\t\t}),\n\t\t\t\tinputPrompt,\n\t\t\t];\n\t\t\tconst prompt = ChatPromptTemplate.fromMessages(messages);\n\t\t\tconst chain = prompt.pipe(llm).pipe(parser).withConfig(getTracingConfig(this));\n\n\t\t\ttry {\n\t\t\t\tconst output = await chain.invoke(messages);\n\n\t\t\t\tcategories.forEach((cat, idx) => {\n\t\t\t\t\tif (output[cat.category]) returnData[idx].push(item);\n\t\t\t\t});\n\t\t\t\tif (fallback === 'other' && output.fallback) returnData[returnData.length - 1].push(item);\n\t\t\t} catch (error) {\n\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\treturnData[0].push({\n\t\t\t\t\t\tjson: { error: error.message },\n\t\t\t\t\t\tpairedItem: { item: itemIdx },\n\t\t\t\t\t});\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn returnData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA6B;AAC7B,qBAAgE;AAChE,4BAA2D;AAC3D,0BAAwD;AASxD,iBAAkB;AAElB,qBAAiC;AAEjC,MAAM,yBACL;AAED,MAAM,oBAAoB,CAAC,eAAgC;AAC1D,QAAM,aAAe,WAAW,YAA4B,cAAgC,CAAC;AAC7F,QAAM,WAAY,WAAW,SAAyB;AACtD,QAAM,MAAM,WAAW,IAAI,CAAC,QAAQ;AACnC,WAAO,EAAE,MAAM,QAAQ,aAAa,IAAI,SAAS;AAAA,EAClD,CAAC;AACD,MAAI,aAAa,QAAS,KAAI,KAAK,EAAE,MAAM,QAAQ,aAAa,QAAQ,CAAC;AACzE,SAAO;AACR;AAEO,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,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QAAQ,IAAI,QAAQ,EAAE,KAAK,IAAI;AAAA,UAC3D,qBAAqB,OAAO,sBAAsB;AAAA,QACnD,CAAC;AAAA,QACD;AAAA,MACD;AACA,YAAM,SAAS,kCAAmB,aAAa,QAAQ;AACvD,YAAM,QAAQ,OAAO,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,eAAW,iCAAiB,IAAI,CAAC;AAE7E,UAAI;AACH,cAAM,SAAS,MAAM,MAAM,OAAO,QAAQ;AAE1C,mBAAW,QAAQ,CAAC,KAAK,QAAQ;AAChC,cAAI,OAAO,IAAI,QAAQ,EAAG,YAAW,GAAG,EAAE,KAAK,IAAI;AAAA,QACpD,CAAC;AACD,YAAI,aAAa,WAAW,OAAO,SAAU,YAAW,WAAW,SAAS,CAAC,EAAE,KAAK,IAAI;AAAA,MACzF,SAAS,OAAO;AACf,YAAI,KAAK,eAAe,GAAG;AAC1B,qBAAW,CAAC,EAAE,KAAK;AAAA,YAClB,MAAM,EAAE,OAAO,MAAM,QAAQ;AAAA,YAC7B,YAAY,EAAE,MAAM,QAAQ;AAAA,UAC7B,CAAC;AAED;AAAA,QACD;AAEA,cAAM;AAAA,MACP;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -346,3 +346,4 @@ class Code {
346
346
  Code,
347
347
  vmResolver
348
348
  });
349
+ //# sourceMappingURL=Code.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/code/Code.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { Tool } from '@langchain/core/tools';\nimport { makeResolverFromLegacyOptions } from '@n8n/vm2';\nimport { JavaScriptSandbox } from 'n8n-nodes-base/dist/nodes/Code/JavaScriptSandbox';\nimport { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';\nimport { standardizeOutput } from 'n8n-nodes-base/dist/nodes/Code/utils';\nimport { NodeOperationError, NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n\tINodeOutputConfiguration,\n\tSupplyData,\n\tISupplyDataFunctions,\n} from 'n8n-workflow';\n\n// TODO: Add support for execute function. Got already started but got commented out\n\nimport { logWrapper } from '@utils/logWrapper';\n\nconst { NODE_FUNCTION_ALLOW_BUILTIN: builtIn, NODE_FUNCTION_ALLOW_EXTERNAL: external } =\n\tprocess.env;\n\n// TODO: Replace\nconst connectorTypes = {\n\t[NodeConnectionTypes.AiChain]: 'Chain',\n\t[NodeConnectionTypes.AiDocument]: 'Document',\n\t[NodeConnectionTypes.AiEmbedding]: 'Embedding',\n\t[NodeConnectionTypes.AiLanguageModel]: 'Language Model',\n\t[NodeConnectionTypes.AiMemory]: 'Memory',\n\t[NodeConnectionTypes.AiOutputParser]: 'Output Parser',\n\t[NodeConnectionTypes.AiTextSplitter]: 'Text Splitter',\n\t[NodeConnectionTypes.AiTool]: 'Tool',\n\t[NodeConnectionTypes.AiVectorStore]: 'Vector Store',\n\t[NodeConnectionTypes.Main]: 'Main',\n};\n\nconst defaultCodeExecute = `const { PromptTemplate } = require('@langchain/core/prompts');\n\nconst query = 'Tell me a joke';\nconst prompt = PromptTemplate.fromTemplate(query);\n\n// If you are allowing more than one language model input connection (-1 or\n// anything greater than 1), getInputConnectionData returns an array, so you\n// will have to change the code below it to deal with that. For example, use\n// llm[0] in the chain definition\n\nconst llm = await this.getInputConnectionData('ai_languageModel', 0);\nlet chain = prompt.pipe(llm);\nconst output = await chain.invoke();\nreturn [ {json: { output } } ];`;\n\nconst defaultCodeSupplyData = `const { WikipediaQueryRun } = require( '@langchain/community/tools/wikipedia_query_run');\nreturn new WikipediaQueryRun();`;\n\nconst langchainModules = ['langchain', '@langchain/*'];\nexport const vmResolver = makeResolverFromLegacyOptions({\n\texternal: {\n\t\tmodules: external ? [...langchainModules, ...external.split(',')] : [...langchainModules],\n\t\ttransitive: false,\n\t},\n\tresolve(moduleName, parentDirname) {\n\t\tif (moduleName.match(/^langchain\\//) ?? moduleName.match(/^@langchain\\//)) {\n\t\t\treturn require.resolve(`@n8n/n8n-nodes-langchain/node_modules/${moduleName}.cjs`, {\n\t\t\t\tpaths: [parentDirname],\n\t\t\t});\n\t\t}\n\t\treturn;\n\t},\n\tbuiltin: builtIn?.split(',') ?? [],\n});\n\nfunction getSandbox(\n\tthis: IExecuteFunctions | ISupplyDataFunctions,\n\tcode: string,\n\toptions?: { addItems?: boolean; itemIndex?: number },\n) {\n\tconst itemIndex = options?.itemIndex ?? 0;\n\tconst node = this.getNode();\n\tconst workflowMode = this.getMode();\n\n\tconst context = getSandboxContext.call(this, itemIndex);\n\tcontext.addInputData = this.addInputData.bind(this);\n\tcontext.addOutputData = this.addOutputData.bind(this);\n\tcontext.getInputConnectionData = this.getInputConnectionData.bind(this);\n\tcontext.getInputData = this.getInputData.bind(this);\n\tcontext.getNode = this.getNode.bind(this);\n\tcontext.getExecutionCancelSignal = this.getExecutionCancelSignal.bind(this);\n\tcontext.getNodeOutputs = this.getNodeOutputs.bind(this);\n\tcontext.executeWorkflow = this.executeWorkflow.bind(this);\n\tcontext.getWorkflowDataProxy = this.getWorkflowDataProxy.bind(this);\n\tcontext.logger = this.logger;\n\n\tif (options?.addItems) {\n\t\tcontext.items = context.$input.all();\n\t}\n\n\tconst sandbox = new JavaScriptSandbox(context, code, this.helpers, {\n\t\tresolver: vmResolver,\n\t});\n\n\tsandbox.on(\n\t\t'output',\n\t\tworkflowMode === 'manual'\n\t\t\t? this.sendMessageToUI.bind(this)\n\t\t\t: (...args: unknown[]) =>\n\t\t\t\t\tconsole.log(`[Workflow \"${this.getWorkflow().id}\"][Node \"${node.name}\"]`, ...args),\n\t);\n\treturn sandbox;\n}\n\nexport class Code implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'LangChain Code',\n\t\tname: 'code',\n\t\ticon: 'fa:code',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'LangChain Code Node',\n\t\tdefaults: {\n\t\t\tname: 'LangChain Code',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Miscellaneous'],\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.code/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: `={{ ((values) => { const connectorTypes = ${JSON.stringify(\n\t\t\tconnectorTypes,\n\t\t)}; return values.map(value => { return { type: value.type, required: value.required, maxConnections: value.maxConnections === -1 ? undefined : value.maxConnections, displayName: connectorTypes[value.type] !== 'Main' ? connectorTypes[value.type] : undefined } } ) })($parameter.inputs.input) }}`,\n\t\toutputs: `={{ ((values) => { const connectorTypes = ${JSON.stringify(\n\t\t\tconnectorTypes,\n\t\t)}; return values.map(value => { return { type: value.type, displayName: connectorTypes[value.type] !== 'Main' ? connectorTypes[value.type] : undefined } } ) })($parameter.outputs.output) }}`,\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Code',\n\t\t\t\tname: 'code',\n\t\t\t\tplaceholder: 'Add Code',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'execute',\n\t\t\t\t\t\tdisplayName: 'Execute',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'JavaScript - Execute',\n\t\t\t\t\t\t\t\tname: 'code',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdefault: defaultCodeExecute,\n\t\t\t\t\t\t\t\thint: 'This code will only run and return data if a \"Main\" input & output got created.',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\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\tname: 'supplyData',\n\t\t\t\t\t\tdisplayName: 'Supply Data',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'JavaScript - Supply Data',\n\t\t\t\t\t\t\t\tname: 'code',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\teditor: 'jsEditor',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdefault: defaultCodeSupplyData,\n\t\t\t\t\t\t\t\thint: 'This code will only run and return data if an output got created which is not \"Main\".',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\n\t\t\t// TODO: Add links to docs which provide additional information regarding functionality\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'You can import LangChain and use all available functionality. Debug by using <code>console.log()</code> statements and viewing their output in the browser console.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Inputs',\n\t\t\t\tname: 'inputs',\n\t\t\t\tplaceholder: 'Add Input',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdescription: 'The input to add',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'input',\n\t\t\t\t\t\tdisplayName: 'Input',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\toptions: Object.keys(connectorTypes).map((key) => ({\n\t\t\t\t\t\t\t\t\tname: connectorTypes[key as keyof typeof connectorTypes],\n\t\t\t\t\t\t\t\t\tvalue: key,\n\t\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdescription: 'The type of the input',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Max Connections',\n\t\t\t\t\t\t\t\tname: 'maxConnections',\n\t\t\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'How many nodes of this type are allowed to be connected. Set it to -1 for unlimited.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Required',\n\t\t\t\t\t\t\t\tname: 'required',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdescription: 'Whether the input needs a connection',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Outputs',\n\t\t\t\tname: 'outputs',\n\t\t\t\tplaceholder: 'Add Output',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdescription: 'The output to add',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'output',\n\t\t\t\t\t\tdisplayName: 'Output',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\toptions: Object.keys(connectorTypes).map((key) => ({\n\t\t\t\t\t\t\t\t\tname: connectorTypes[key as keyof typeof connectorTypes],\n\t\t\t\t\t\t\t\t\tvalue: key,\n\t\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdescription: 'The type of the input',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tconst itemIndex = 0;\n\n\t\tconst code = this.getNodeParameter('code', itemIndex) as { execute?: { code: string } };\n\n\t\tif (!code.execute?.code) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`No code for \"Execute\" set on node \"${this.getNode().name}`,\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst sandbox = getSandbox.call(this, code.execute.code, { addItems: true, itemIndex });\n\n\t\tconst outputs = this.getNodeOutputs();\n\t\tconst mainOutputs: INodeOutputConfiguration[] = outputs.filter(\n\t\t\t(output) => output.type === NodeConnectionTypes.Main,\n\t\t);\n\n\t\tconst options = { multiOutput: mainOutputs.length !== 1 };\n\n\t\tlet items: INodeExecutionData[] | INodeExecutionData[][];\n\t\ttry {\n\t\t\titems = await sandbox.runCodeAllItems(options);\n\t\t} catch (error) {\n\t\t\tif (!this.continueOnFail()) throw error;\n\t\t\titems = [{ json: { error: (error as Error).message } }];\n\t\t\tif (options.multiOutput) {\n\t\t\t\titems = [items];\n\t\t\t}\n\t\t}\n\n\t\tif (mainOutputs.length === 0) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'The node does not have a \"Main\" output set. Please add one.',\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t},\n\t\t\t);\n\t\t} else if (!options.multiOutput) {\n\t\t\tfor (const item of items as INodeExecutionData[]) {\n\t\t\t\tstandardizeOutput(item.json);\n\t\t\t}\n\t\t\treturn [items as INodeExecutionData[]];\n\t\t} else {\n\t\t\titems.forEach((data) => {\n\t\t\t\tfor (const item of data as INodeExecutionData[]) {\n\t\t\t\t\tstandardizeOutput(item.json);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn items as INodeExecutionData[][];\n\t\t}\n\t}\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst code = this.getNodeParameter('code', itemIndex) as { supplyData?: { code: string } };\n\n\t\tif (!code.supplyData?.code) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t`No code for \"Supply Data\" set on node \"${this.getNode().name}`,\n\t\t\t\t{\n\t\t\t\t\titemIndex,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst sandbox = getSandbox.call(this, code.supplyData.code, { itemIndex });\n\t\tconst response = await sandbox.runCode<Tool>();\n\n\t\treturn {\n\t\t\tresponse: logWrapper(response, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA8C;AAC9C,+BAAkC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QAAQ,MAA8B;AAChD,8CAAkB,KAAK,IAAI;AAAA,QAC5B;AAAA,MACD,CAAC;AACD,aAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,OAAO,KAAK,iBAAiB,QAAQ,SAAS;AAEpD,QAAI,CAAC,KAAK,YAAY,MAAM;AAC3B,YAAM,IAAI;AAAA,QACT,KAAK,QAAQ;AAAA,QACb,0CAA0C,KAAK,QAAQ,EAAE,IAAI;AAAA,QAC7D;AAAA,UACC;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAEA,UAAM,UAAU,WAAW,KAAK,MAAM,KAAK,WAAW,MAAM,EAAE,UAAU,CAAC;AACzE,UAAM,WAAW,MAAM,QAAQ,QAAc;AAE7C,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
@@ -202,3 +202,4 @@ class DocumentBinaryInputLoader {
202
202
  0 && (module.exports = {
203
203
  DocumentBinaryInputLoader
204
204
  });
205
+ //# sourceMappingURL=DocumentBinaryInputLoader.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { TextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { N8nBinaryLoader } from '@utils/N8nBinaryLoader';\nimport { getConnectionHintNoticeField, metadataFilterField } from '@utils/sharedFields';\n\n// Dependencies needed underneath the hood for the loaders. We add them\n// here only to track where what dependency is sued\n// import 'd3-dsv'; // for csv\nimport 'mammoth'; // for docx\nimport 'epub2'; // for epub\nimport 'pdf-parse'; // for pdf\n\nexport class DocumentBinaryInputLoader implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\t// This node is deprecated and will be removed in the future.\n\t\t// The functionality was merged with the `DocumentJSONInputLoader` to `DocumentDefaultDataLoader`\n\t\thidden: true,\n\t\tdisplayName: 'Binary Input Loader',\n\t\tname: 'documentBinaryInputLoader',\n\t\ticon: 'file:binary.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use binary data from a previous step in the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Binary Input Loader',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Document Loaders'],\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/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text Splitter',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiTextSplitter,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiDocument],\n\t\toutputNames: ['Document'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Loader Type',\n\t\t\t\tname: 'loader',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'jsonLoader',\n\t\t\t\trequired: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'CSV Loader',\n\t\t\t\t\t\tvalue: 'csvLoader',\n\t\t\t\t\t\tdescription: 'Load CSV files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Docx Loader',\n\t\t\t\t\t\tvalue: 'docxLoader',\n\t\t\t\t\t\tdescription: 'Load Docx documents',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'EPub Loader',\n\t\t\t\t\t\tvalue: 'epubLoader',\n\t\t\t\t\t\tdescription: 'Load EPub files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'JSON Loader',\n\t\t\t\t\t\tvalue: 'jsonLoader',\n\t\t\t\t\t\tdescription: 'Load JSON files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'PDF Loader',\n\t\t\t\t\t\tvalue: 'pdfLoader',\n\t\t\t\t\t\tdescription: 'Load PDF documents',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Text Loader',\n\t\t\t\t\t\tvalue: 'textLoader',\n\t\t\t\t\t\tdescription: 'Load plain text files',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Binary Data Key',\n\t\t\t\tname: 'binaryDataKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'Name of the binary property from which to read the file buffer',\n\t\t\t},\n\t\t\t// PDF Only Fields\n\t\t\t{\n\t\t\t\tdisplayName: 'Split Pages',\n\t\t\t\tname: 'splitPages',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tloader: ['pdfLoader'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t// CSV Only Fields\n\t\t\t{\n\t\t\t\tdisplayName: 'Column',\n\t\t\t\tname: 'column',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Column to extract from CSV',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tloader: ['csvLoader'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Separator',\n\t\t\t\tname: 'separator',\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'Separator to use for CSV',\n\t\t\t\tdefault: ',',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tloader: ['csvLoader'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t// JSON Only Fields\n\t\t\t{\n\t\t\t\tdisplayName: 'Pointers',\n\t\t\t\tname: 'pointers',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Pointers to extract from JSON, e.g. \"/text\" or \"/text, /meta/title\"',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tloader: ['jsonLoader'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...metadataFilterField,\n\t\t\t\t\t\tdisplayName: 'Metadata',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Metadata to add to each document. Could be used for filtering during retrieval',\n\t\t\t\t\t\tplaceholder: 'Add property',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Binary Input Loader');\n\t\tconst textSplitter = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiTextSplitter,\n\t\t\t0,\n\t\t)) as TextSplitter | undefined;\n\n\t\tconst binaryDataKey = this.getNodeParameter('binaryDataKey', 0) as string;\n\t\tconst processor = new N8nBinaryLoader(this, undefined, binaryDataKey, textSplitter);\n\n\t\treturn {\n\t\t\tresponse: logWrapper(processor, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAMO;AAEP,wBAA2B;AAC3B,6BAAgC;AAChC,0BAAkE;AAKlE,qBAAO;AACP,mBAAO;AACP,uBAAO;AAEA,MAAM,0BAA+C;AAAA,EAArD;AACN,uBAAoC;AAAA;AAAA;AAAA,MAGnC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,kBAAkB;AAAA,QACxB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA;AAAA,MAEA,SAAS,CAAC,wCAAoB,UAAU;AAAA,MACxC,aAAa,CAAC,UAAU;AAAA,MACxB,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,aAAa,CAAC;AAAA,QAChE;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,UAAU;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,cACP,aAAa;AAAA,YACd;AAAA,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AAQ,CAAC,YAAY;AAAA,YACtB;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,GAAG;AAAA,cACH,aAAa;AAAA,cACb,aACC;AAAA,cACD,aAAa;AAAA,YACd;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,aAA4D;AACjE,SAAK,OAAO,MAAM,qCAAqC;AACvD,UAAM,eAAgB,MAAM,KAAK;AAAA,MAChC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,gBAAgB,KAAK,iBAAiB,iBAAiB,CAAC;AAC9D,UAAM,YAAY,IAAI,uCAAgB,MAAM,QAAW,eAAe,YAAY;AAElF,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -306,3 +306,4 @@ class DocumentDefaultDataLoader {
306
306
  0 && (module.exports = {
307
307
  DocumentDefaultDataLoader
308
308
  });
309
+ //# sourceMappingURL=DocumentDefaultDataLoader.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { TextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { N8nBinaryLoader } from '@utils/N8nBinaryLoader';\nimport { N8nJsonLoader } from '@utils/N8nJsonLoader';\nimport { metadataFilterField } from '@utils/sharedFields';\n\n// Dependencies needed underneath the hood for the loaders. We add them\n// here only to track where what dependency is sued\n// import 'd3-dsv'; // for csv\nimport 'mammoth'; // for docx\nimport 'epub2'; // for epub\nimport 'pdf-parse'; // for pdf\n\nexport class DocumentDefaultDataLoader implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Default Data Loader',\n\t\tname: 'documentDefaultDataLoader',\n\t\ticon: 'file:binary.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Load data from previous step in the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Default Data Loader',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Document Loaders'],\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/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text Splitter',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiTextSplitter,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiDocument],\n\t\toutputNames: ['Document'],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'This will load data from a previous step in the workflow. <a href=\"/templates/1962\" target=\"_blank\">Example</a>',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Type of Data',\n\t\t\t\tname: 'dataType',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'json',\n\t\t\t\trequired: true,\n\t\t\t\tnoDataExpression: true,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'JSON',\n\t\t\t\t\t\tvalue: 'json',\n\t\t\t\t\t\tdescription: 'Process JSON data from previous step in the workflow',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Binary',\n\t\t\t\t\t\tvalue: 'binary',\n\t\t\t\t\t\tdescription: 'Process binary data from previous step in the workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Mode',\n\t\t\t\tname: 'jsonMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'allInputData',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tdataType: ['json'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load All Input Data',\n\t\t\t\t\t\tvalue: 'allInputData',\n\t\t\t\t\t\tdescription: 'Use all JSON data that flows into the parent agent or chain',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load Specific Data',\n\t\t\t\t\t\tvalue: 'expressionData',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Load a subset of data, and/or data from any previous step in the workflow',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Mode',\n\t\t\t\tname: 'binaryMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'allInputData',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tdataType: ['binary'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load All Input Data',\n\t\t\t\t\t\tvalue: 'allInputData',\n\t\t\t\t\t\tdescription: 'Use all Binary data that flows into the parent agent or chain',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Load Specific Data',\n\t\t\t\t\t\tvalue: 'specificField',\n\t\t\t\t\t\tdescription: 'Load data from a specific field in the parent agent or chain',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Data Format',\n\t\t\t\tname: 'loader',\n\t\t\t\ttype: 'options',\n\t\t\t\tdefault: 'auto',\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tdataType: ['binary'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Automatically Detect by Mime Type',\n\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t\tdescription: 'Uses the mime type to detect the format',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'CSV',\n\t\t\t\t\t\tvalue: 'csvLoader',\n\t\t\t\t\t\tdescription: 'Load CSV files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Docx',\n\t\t\t\t\t\tvalue: 'docxLoader',\n\t\t\t\t\t\tdescription: 'Load Docx documents',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'EPub',\n\t\t\t\t\t\tvalue: 'epubLoader',\n\t\t\t\t\t\tdescription: 'Load EPub files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'JSON',\n\t\t\t\t\t\tvalue: 'jsonLoader',\n\t\t\t\t\t\tdescription: 'Load JSON files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'PDF',\n\t\t\t\t\t\tvalue: 'pdfLoader',\n\t\t\t\t\t\tdescription: 'Load PDF documents',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\tvalue: 'textLoader',\n\t\t\t\t\t\tdescription: 'Load plain text files',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Data',\n\t\t\t\tname: 'jsonData',\n\t\t\t\ttype: 'string',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 6,\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'Drag and drop fields from the input pane, or use an expression',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tdataType: ['json'],\n\t\t\t\t\t\tjsonMode: ['expressionData'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Input Data Field Name',\n\t\t\t\tname: 'binaryDataKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\trequired: true,\n\t\t\t\tdescription:\n\t\t\t\t\t'The name of the field in the agent or chain’s input that contains the binary file to be processed',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tdataType: ['binary'],\n\t\t\t\t\t},\n\t\t\t\t\thide: {\n\t\t\t\t\t\tbinaryMode: ['allInputData'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'JSON Pointers',\n\t\t\t\t\t\tname: 'pointers',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'Pointers to extract from JSON, e.g. \"/text\" or \"/text, /meta/title\"',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t'/loader': ['jsonLoader', 'auto'],\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: 'CSV Separator',\n\t\t\t\t\t\tname: 'separator',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: 'Separator to use for CSV',\n\t\t\t\t\t\tdefault: ',',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t'/loader': ['csvLoader', 'auto'],\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: 'CSV Column',\n\t\t\t\t\t\tname: 'column',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'Column to extract from CSV',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t'/loader': ['csvLoader', 'auto'],\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: 'Split Pages in PDF',\n\t\t\t\t\t\tdescription: 'Whether to split PDF pages into separate documents',\n\t\t\t\t\t\tname: 'splitPages',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t'/loader': ['pdfLoader', 'auto'],\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\t...metadataFilterField,\n\t\t\t\t\t\tdisplayName: 'Metadata',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Metadata to add to each document. Could be used for filtering during retrieval',\n\t\t\t\t\t\tplaceholder: 'Add property',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst dataType = this.getNodeParameter('dataType', itemIndex, 'json') as 'json' | 'binary';\n\t\tconst textSplitter = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiTextSplitter,\n\t\t\t0,\n\t\t)) as TextSplitter | undefined;\n\t\tconst binaryDataKey = this.getNodeParameter('binaryDataKey', itemIndex, '') as string;\n\n\t\tconst processor =\n\t\t\tdataType === 'binary'\n\t\t\t\t? new N8nBinaryLoader(this, 'options.', binaryDataKey, textSplitter)\n\t\t\t\t: new N8nJsonLoader(this, 'options.', textSplitter);\n\n\t\treturn {\n\t\t\tresponse: logWrapper(processor, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAMO;AAEP,wBAA2B;AAC3B,6BAAgC;AAChC,2BAA8B;AAC9B,0BAAoC;AAKpC,qBAAO;AACP,mBAAO;AACP,uBAAO;AAEA,MAAM,0BAA+C;AAAA,EAArD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,kBAAkB;AAAA,QACxB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA;AAAA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MACpB;AAAA,IACD;AACA,UAAM,gBAAgB,KAAK,iBAAiB,iBAAiB,WAAW,EAAE;AAE1E,UAAM,YACL,aAAa,WACV,IAAI,uCAAgB,MAAM,YAAY,eAAe,YAAY,IACjE,IAAI,mCAAc,MAAM,YAAY,YAAY;AAEpD,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -138,3 +138,4 @@ class DocumentGithubLoader {
138
138
  0 && (module.exports = {
139
139
  DocumentGithubLoader
140
140
  });
141
+ //# sourceMappingURL=DocumentGithubLoader.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { GithubRepoLoader } from '@langchain/community/document_loaders/web/github';\nimport type { CharacterTextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class DocumentGithubLoader implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'GitHub Document Loader',\n\t\tname: 'documentGithubLoader',\n\t\ticon: 'file:github.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use GitHub data as input to this chain',\n\t\tdefaults: {\n\t\t\tname: 'GitHub Document Loader',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Document Loaders'],\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/sub-nodes/n8n-nodes-langchain.documentgithubloader/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'githubApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text Splitter',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiTextSplitter,\n\t\t\t},\n\t\t],\n\t\tinputNames: ['Text Splitter'],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiDocument],\n\t\toutputNames: ['Document'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Repository Link',\n\t\t\t\tname: 'repository',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Branch',\n\t\t\t\tname: 'branch',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'main',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'additionalOptions',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Recursive',\n\t\t\t\t\t\tname: 'recursive',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Ignore Paths',\n\t\t\t\t\t\tname: 'ignorePaths',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: 'Comma-separated list of paths to ignore, e.g. \"docs, src/tests',\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\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supplying data for Github Document Loader');\n\n\t\tconst repository = this.getNodeParameter('repository', itemIndex) as string;\n\t\tconst branch = this.getNodeParameter('branch', itemIndex) as string;\n\t\tconst credentials = await this.getCredentials('githubApi');\n\t\tconst { ignorePaths, recursive } = this.getNodeParameter('additionalOptions', 0) as {\n\t\t\trecursive: boolean;\n\t\t\tignorePaths: string;\n\t\t};\n\n\t\tconst textSplitter = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiTextSplitter,\n\t\t\t0,\n\t\t)) as CharacterTextSplitter | undefined;\n\n\t\tconst { index } = this.addInputData(NodeConnectionTypes.AiDocument, [\n\t\t\t[{ json: { repository, branch, ignorePaths, recursive } }],\n\t\t]);\n\t\tconst docs = new GithubRepoLoader(repository, {\n\t\t\tbranch,\n\t\t\tignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()),\n\t\t\trecursive,\n\t\t\taccessToken: (credentials.accessToken as string) || '',\n\t\t\tapiUrl: credentials.server as string,\n\t\t});\n\n\t\tconst loadedDocs = textSplitter\n\t\t\t? await textSplitter.splitDocuments(await docs.load())\n\t\t\t: await docs.load();\n\n\t\tthis.addOutputData(NodeConnectionTypes.AiDocument, index, [[{ json: { loadedDocs } }]]);\n\t\treturn {\n\t\t\tresponse: logWrapper(loadedDocs, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAiC;AAEjC,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MAC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C;AAE7D,UAAM,aAAa,KAAK,iBAAiB,cAAc,SAAS;AAChE,UAAM,SAAS,KAAK,iBAAiB,UAAU,SAAS;AACxD,UAAM,cAAc,MAAM,KAAK,eAAe,WAAW;AACzD,UAAM,EAAE,aAAa,UAAU,IAAI,KAAK,iBAAiB,qBAAqB,CAAC;AAK/E,UAAM,eAAgB,MAAM,KAAK;AAAA,MAChC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,EAAE,MAAM,IAAI,KAAK,aAAa,wCAAoB,YAAY;AAAA,MACnE,CAAC,EAAE,MAAM,EAAE,YAAY,QAAQ,aAAa,UAAU,EAAE,CAAC;AAAA,IAC1D,CAAC;AACD,UAAM,OAAO,IAAI,+BAAiB,YAAY;AAAA,MAC7C;AAAA,MACA,cAAc,eAAe,IAAI,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAAA,MAC/D;AAAA,MACA,aAAc,YAAY,eAA0B;AAAA,MACpD,QAAQ,YAAY;AAAA,IACrB,CAAC;AAED,UAAM,aAAa,eAChB,MAAM,aAAa,eAAe,MAAM,KAAK,KAAK,CAAC,IACnD,MAAM,KAAK,KAAK;AAEnB,SAAK,cAAc,wCAAoB,YAAY,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;AACtF,WAAO;AAAA,MACN,cAAU,8BAAW,YAAY,IAAI;AAAA,IACtC;AAAA,EACD;AACD;","names":[]}
@@ -108,3 +108,4 @@ class DocumentJsonInputLoader {
108
108
  0 && (module.exports = {
109
109
  DocumentJsonInputLoader
110
110
  });
111
+ //# sourceMappingURL=DocumentJsonInputLoader.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { TextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { N8nJsonLoader } from '@utils/N8nJsonLoader';\nimport { getConnectionHintNoticeField, metadataFilterField } from '@utils/sharedFields';\n\nexport class DocumentJsonInputLoader implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\t// This node is deprecated and will be removed in the future.\n\t\t// The functionality was merged with the `DocumentBinaryInputLoader` to `DocumentDefaultDataLoader`\n\t\thidden: true,\n\t\tdisplayName: 'JSON Input Loader',\n\t\tname: 'documentJsonInputLoader',\n\t\ticon: 'file:json.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use JSON data from a previous step in the workflow',\n\t\tdefaults: {\n\t\t\tname: 'JSON Input Loader',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Document Loaders'],\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/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Text Splitter',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiTextSplitter,\n\t\t\t},\n\t\t],\n\t\tinputNames: ['Text Splitter'],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiDocument],\n\t\toutputNames: ['Document'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Pointers',\n\t\t\t\tname: 'pointers',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Pointers to extract from JSON, e.g. \"/text\" or \"/text, /meta/title\"',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\t...metadataFilterField,\n\t\t\t\t\t\tdisplayName: 'Metadata',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Metadata to add to each document. Could be used for filtering during retrieval',\n\t\t\t\t\t\tplaceholder: 'Add property',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for JSON Input Loader');\n\t\tconst textSplitter = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiTextSplitter,\n\t\t\t0,\n\t\t)) as TextSplitter | undefined;\n\n\t\tconst processor = new N8nJsonLoader(this, undefined, textSplitter);\n\n\t\treturn {\n\t\t\tresponse: logWrapper(processor, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAMO;AAEP,wBAA2B;AAC3B,2BAA8B;AAC9B,0BAAkE;AAE3D,MAAM,wBAA6C;AAAA,EAAnD;AACN,uBAAoC;AAAA;AAAA;AAAA,MAGnC,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,kBAAkB;AAAA,QACxB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,YAAY,CAAC,eAAe;AAAA;AAAA,MAE5B,SAAS,CAAC,wCAAoB,UAAU;AAAA,MACxC,aAAa,CAAC,UAAU;AAAA,MACxB,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,aAAa,CAAC;AAAA,QAChE;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,GAAG;AAAA,cACH,aAAa;AAAA,cACb,aACC;AAAA,cACD,aAAa;AAAA,YACd;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,aAA4D;AACjE,SAAK,OAAO,MAAM,mCAAmC;AACrD,UAAM,eAAgB,MAAM,KAAK;AAAA,MAChC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,YAAY,IAAI,mCAAc,MAAM,QAAW,YAAY;AAEjE,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -139,3 +139,4 @@ class EmbeddingsAwsBedrock {
139
139
  0 && (module.exports = {
140
140
  EmbeddingsAwsBedrock
141
141
  });
142
+ //# sourceMappingURL=EmbeddingsAwsBedrock.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { BedrockEmbeddings } from '@langchain/aws';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class EmbeddingsAwsBedrock implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Embeddings AWS Bedrock',\n\t\tname: 'embeddingsAwsBedrock',\n\t\ticon: 'file:bedrock.svg',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'aws',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use Embeddings AWS Bedrock',\n\t\tdefaults: {\n\t\t\tname: 'Embeddings AWS Bedrock',\n\t\t},\n\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Embeddings'],\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/sub-nodes/n8n-nodes-langchain.embeddingsawsbedrock/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiEmbedding],\n\t\toutputNames: ['Embeddings'],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '=https://bedrock.{{$credentials?.region ?? \"eu-central-1\"}}.amazonaws.com',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The model which will generate the completion. <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html\">Learn more</a>.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tloadOptions: {\n\t\t\t\t\t\trouting: {\n\t\t\t\t\t\t\trequest: {\n\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\turl: '/foundation-models?byInferenceType=ON_DEMAND&byOutputModality=EMBEDDING',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\t\tpostReceive: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'rootProperty',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tproperty: 'modelSummaries',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'setKeyValue',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tname: '={{$responseItem.modelName}}',\n\t\t\t\t\t\t\t\t\t\t\tdescription: '={{$responseItem.modelArn}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.modelId}}',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'sort',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tkey: 'name',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trouting: {\n\t\t\t\t\tsend: {\n\t\t\t\t\t\ttype: 'body',\n\t\t\t\t\t\tproperty: 'model',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials('aws');\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst embeddings = new BedrockEmbeddings({\n\t\t\tregion: credentials.region as string,\n\t\t\tmodel: modelName,\n\t\t\tmaxRetries: 3,\n\t\t\tcredentials: {\n\t\t\t\tsecretAccessKey: credentials.secretAccessKey as string,\n\t\t\t\taccessKeyId: credentials.accessKeyId as string,\n\t\t\t\tsessionToken: credentials.sessionToken as string,\n\t\t\t},\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(embeddings, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAkC;AAClC,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MAEA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAA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AA,MACpB,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,aAAa;AAAA,QACZ,iBAAiB,YAAY;AAAA,QAC7B,aAAa,YAAY;AAAA,QACzB,cAAc,YAAY;AAAA,MAC3B;AAAA,IACD,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,YAAY,IAAI;AAAA,IACtC;AAAA,EACD;AACD;","names":[]}
@@ -162,3 +162,4 @@ class EmbeddingsAzureOpenAi {
162
162
  0 && (module.exports = {
163
163
  EmbeddingsAzureOpenAi
164
164
  });
165
+ //# sourceMappingURL=EmbeddingsAzureOpenAi.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { OpenAIEmbeddings } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class EmbeddingsAzureOpenAi implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Embeddings Azure OpenAI',\n\t\tname: 'embeddingsAzureOpenAi',\n\t\ticon: 'file:azure.svg',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'azureOpenAiApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use Embeddings Azure OpenAI',\n\t\tdefaults: {\n\t\t\tname: 'Embeddings Azure OpenAI',\n\t\t},\n\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Embeddings'],\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/sub-nodes/n8n-nodes-langchain.embeddingsazureopenai/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiEmbedding],\n\t\toutputNames: ['Embeddings'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Model (Deployment) Name',\n\t\t\t\tname: 'model',\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription: 'The name of the model(deployment) to use',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdescription: 'Additional options to add',\n\t\t\t\ttype: 'collection',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Batch Size',\n\t\t\t\t\t\tname: 'batchSize',\n\t\t\t\t\t\tdefault: 512,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2048 },\n\t\t\t\t\t\tdescription: 'Maximum number of documents to send in each request',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Strip New Lines',\n\t\t\t\t\t\tname: 'stripNewLines',\n\t\t\t\t\t\tdefault: true,\n\t\t\t\t\t\tdescription: 'Whether to strip new lines from the input text',\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Maximum amount of time a request is allowed to take in seconds. Set to -1 for no timeout.',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Dimensions',\n\t\t\t\t\t\tname: 'dimensions',\n\t\t\t\t\t\tdefault: undefined,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.',\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: '256',\n\t\t\t\t\t\t\t\tvalue: 256,\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: '512',\n\t\t\t\t\t\t\t\tvalue: 512,\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: '1024',\n\t\t\t\t\t\t\t\tvalue: 1024,\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: '1536',\n\t\t\t\t\t\t\t\tvalue: 1536,\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: '3072',\n\t\t\t\t\t\t\t\tvalue: 3072,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply data for embeddings');\n\t\tconst credentials = await this.getCredentials<{\n\t\t\tapiKey: string;\n\t\t\tresourceName: string;\n\t\t\tapiVersion: string;\n\t\t\tendpoint?: string;\n\t\t}>('azureOpenAiApi');\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tbatchSize?: number;\n\t\t\tstripNewLines?: boolean;\n\t\t\ttimeout?: number;\n\t\t\tdimensions?: number | undefined;\n\t\t};\n\n\t\tif (options.timeout === -1) {\n\t\t\toptions.timeout = undefined;\n\t\t}\n\n\t\tconst embeddings = new OpenAIEmbeddings({\n\t\t\tazureOpenAIApiDeploymentName: modelName,\n\t\t\t// instance name only needed to set base url\n\t\t\tazureOpenAIApiInstanceName: !credentials.endpoint ? credentials.resourceName : undefined,\n\t\t\tazureOpenAIApiKey: credentials.apiKey,\n\t\t\tazureOpenAIApiVersion: credentials.apiVersion,\n\t\t\t// azureOpenAIEndpoint and configuration.baseURL are both ignored here\n\t\t\t// only setting azureOpenAIBasePath worked\n\t\t\tazureOpenAIBasePath: credentials.endpoint\n\t\t\t\t? `${credentials.endpoint}/openai/deployments`\n\t\t\t\t: undefined,\n\t\t\t...options,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(embeddings, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAiC;AACjC,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,sBAA2C;AAAA,EAAjD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MAEA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,Q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A,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,4BAA4B;AAC9C,UAAM,cAAc,MAAM,KAAK,eAK5B,gBAAgB;AACnB,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAO9D,QAAI,QAAQ,YAAY,IAAI;AAC3B,cAAQ,UAAU;AAAA,IACnB;AAEA,UAAM,aAAa,IAAI,+BAAiB;AAAA,MACvC,8BAA8B;AAAA;AAAA,MAE9B,4BAA4B,CAAC,YAAY,WAAW,YAAY,eAAe;AAAA,MAC/E,mBAAmB,YAAY;AAAA,MAC/B,uBAAuB,YAAY;AAAA;AAAA;AAAA,MAGnC,qBAAqB,YAAY,WAC9B,GAAG,YAAY,QAAQ,wBACvB;AAAA,MACH,GAAG;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,YAAY,IAAI;AAAA,IACtC;AAAA,EACD;AACD;","names":[]}
@@ -130,3 +130,4 @@ class EmbeddingsCohere {
130
130
  0 && (module.exports = {
131
131
  EmbeddingsCohere
132
132
  });
133
+ //# sourceMappingURL=EmbeddingsCohere.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { CohereEmbeddings } from '@langchain/cohere';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class EmbeddingsCohere implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Embeddings Cohere',\n\t\tname: 'embeddingsCohere',\n\t\ticon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use Cohere Embeddings',\n\t\tdefaults: {\n\t\t\tname: 'Embeddings Cohere',\n\t\t},\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials.host }}',\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'cohereApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Embeddings'],\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/sub-nodes/n8n-nodes-langchain.embeddingscohere/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiEmbedding],\n\t\toutputNames: ['Embeddings'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Each model is using different dimensional density for embeddings. Please make sure to use the same dimensionality for your vector store. The default model is using 768-dimensional embeddings.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'modelName',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The model which will generate the embeddings. <a href=\"https://docs.cohere.com/docs/models\">Learn more</a>.',\n\t\t\t\tdefault: 'embed-english-v2.0',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-English-Light-v2.0 (1024 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-english-light-v2.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-English-Light-v3.0 (384 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-english-light-v3.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-English-v2.0 (4096 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-english-v2.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-English-v3.0 (1024 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-english-v3.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-Multilingual-Light-v3.0 (384 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-multilingual-light-v3.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-Multilingual-v2.0 (768 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-multilingual-v2.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Embed-Multilingual-v3.0 (1024 Dimensions)',\n\t\t\t\t\t\tvalue: 'embed-multilingual-v3.0',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply data for embeddings Cohere');\n\t\tconst modelName = this.getNodeParameter('modelName', itemIndex, 'embed-english-v2.0') as string;\n\t\tconst credentials = await this.getCredentials<{ apiKey: string }>('cohereApi');\n\t\tconst embeddings = new CohereEmbeddings({\n\t\t\tapiKey: credentials.apiKey,\n\t\t\tmodel: modelName,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(embeddings, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;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,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,mCAAmC;AACrD,UAAM,YAAY,KAAK,iBAAiB,aAAa,WAAW,oBAAoB;AACpF,UAAM,cAAc,MAAM,KAAK,eAAmC,WAAW;AAC7E,UAAM,aAAa,IAAI,+BAAiB;AAAA,MACvC,QAAQ,YAAY;AAAA,MACpB,OAAO;AAAA,IACR,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,YAAY,IAAI;AAAA,IACtC;AAAA,EACD;AACD;","names":[]}
@@ -150,3 +150,4 @@ class EmbeddingsGoogleGemini {
150
150
  0 && (module.exports = {
151
151
  EmbeddingsGoogleGemini
152
152
  });
153
+ //# sourceMappingURL=EmbeddingsGoogleGemini.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { GoogleGenerativeAIEmbeddings } from '@langchain/google-genai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class EmbeddingsGoogleGemini implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Embeddings Google Gemini',\n\t\tname: 'embeddingsGoogleGemini',\n\t\ticon: 'file:google.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use Google Gemini Embeddings',\n\t\tdefaults: {\n\t\t\tname: 'Embeddings Google Gemini',\n\t\t},\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials.host }}',\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'googlePalmApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Embeddings'],\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/sub-nodes/n8n-nodes-langchain.embeddingsgooglegemini/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiEmbedding],\n\t\toutputNames: ['Embeddings'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiVectorStore]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'Each model is using different dimensional density for embeddings. Please make sure to use the same dimensionality for your vector store. The default model is using 768-dimensional embeddings.',\n\t\t\t\tname: 'notice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tname: 'modelName',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The model which will generate the embeddings. <a href=\"https://developers.generativeai.google/api/rest/generativelanguage/models/list\">Learn more</a>.',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tloadOptions: {\n\t\t\t\t\t\trouting: {\n\t\t\t\t\t\t\trequest: {\n\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\turl: '/v1beta/models',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutput: {\n\t\t\t\t\t\t\t\tpostReceive: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'rootProperty',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tproperty: 'models',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'filter',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tpass: \"={{ $responseItem.name.includes('embedding') }}\",\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'setKeyValue',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tname: '={{$responseItem.name}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.name}}',\n\t\t\t\t\t\t\t\t\t\t\tdescription: '={{$responseItem.description}}',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttype: 'sort',\n\t\t\t\t\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\t\t\t\t\tkey: 'name',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trouting: {\n\t\t\t\t\tsend: {\n\t\t\t\t\t\ttype: 'body',\n\t\t\t\t\t\tproperty: 'model',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'textembedding-gecko-multilingual@latest',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply data for embeddings Google Gemini');\n\t\tconst modelName = this.getNodeParameter(\n\t\t\t'modelName',\n\t\t\titemIndex,\n\t\t\t'textembedding-gecko-multilingual@latest',\n\t\t) as string;\n\t\tconst credentials = await this.getCredentials('googlePalmApi');\n\t\tconst embeddings = new GoogleGenerativeAIEmbeddings({\n\t\t\tapiKey: credentials.apiKey as string,\n\t\t\tmodelName,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(embeddings, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA6C;AAC7C,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,uBAA4C;AAAA,EAAlD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,iBAAiB;AAAA,QAChB,wBAAwB;AAAA,QACxB,SAAS;AAAA,MACV;AAAA,MACA,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ,CAAC;AAAA;AAAA,MA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