@n8n/n8n-nodes-langchain 1.86.1 → 1.87.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +9 -6
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { ChatBedrockConverse } from '@langchain/aws';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatAwsBedrock implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'AWS Bedrock Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatAwsBedrock',\n\t\ticon: 'file:bedrock.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Language Model AWS Bedrock',\n\t\tdefaults: {\n\t\t\tname: 'AWS Bedrock Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatawsbedrock/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-credentials-name-unsuffixed\n\t\t\t\tname: 'aws',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\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.AiChain, NodeConnectionTypes.AiChain]),\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?&byOutputModality=TEXT&byInferenceType=ON_DEMAND',\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\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokensToSample',\n\t\t\t\t\t\tdefault: 2000,\n\t\t\t\t\t\tdescription: 'The maximum number of tokens to generate in the completion',\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\n\t\t\t\t\t\ttype: 'number',\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 credentials = await this.getCredentials('aws');\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\ttemperature: number;\n\t\t\tmaxTokensToSample: number;\n\t\t};\n\n\t\tconst model = new ChatBedrockConverse({\n\t\t\tregion: credentials.region as string,\n\t\t\tmodel: modelName,\n\t\t\ttemperature: options.temperature,\n\t\t\tmaxTokens: options.maxTokensToSample,\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\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAoC;AACpC,0BAMO;AAEP,0BAA6C;AAE7C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,iBAAsC;AAAA,EAA5C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,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,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA;A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AAa,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,EAAE;AAAA,cAC5D,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAAe,KAAK;AACnD,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAC1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAK9D,UAAM,QAAQ,IAAI,+BAAoB;AAAA,MACrC,QAAQ,YAAY;AAAA,MACpB,OAAO;AAAA,MACP,aAAa,QAAQ;AAAA,MACrB,WAAW,QAAQ;AAAA,MACnB,aAAa;AAAA,QACZ,iBAAiB,YAAY;AAAA,QAC7B,aAAa,YAAY;AAAA,QACzB,cAAc,YAAY;AAAA,MAC3B;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,qBAAiB,kEAA+B,IAAI;AAAA,IACrD,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -200,3 +200,4 @@ class LmChatAzureOpenAi {
200
200
  0 && (module.exports = {
201
201
  LmChatAzureOpenAi
202
202
  });
203
+ //# sourceMappingURL=LmChatAzureOpenAi.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { AzureChatOpenAI } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatAzureOpenAi implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Azure OpenAI Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatAzureOpenAi',\n\t\ticon: 'file:azure.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'For advanced usage with an AI chain',\n\t\tdefaults: {\n\t\t\tname: 'Azure OpenAI Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatazureopenai/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\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\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',\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\t'/options.responseFormat': ['json_object'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\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: 'Frequency Penalty',\n\t\t\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Response Format',\n\t\t\t\t\t\tname: 'responseFormat',\n\t\t\t\t\t\tdefault: 'text',\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: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Regular text response',\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: 'JSON',\n\t\t\t\t\t\t\t\tvalue: 'json_object',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Enables JSON mode, which should guarantee the message the model generates is valid JSON',\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: 'Presence Penalty',\n\t\t\t\t\t\tname: 'presencePenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\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: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: 60000,\n\t\t\t\t\t\tdescription: 'Maximum amount of time a request is allowed to take in milliseconds',\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: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\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: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\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 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\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tfrequencyPenalty?: number;\n\t\t\tmaxTokens?: number;\n\t\t\tmaxRetries: number;\n\t\t\ttimeout: number;\n\t\t\tpresencePenalty?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopP?: number;\n\t\t\tresponseFormat?: 'text' | 'json_object';\n\t\t};\n\n\t\tconst model = new AzureChatOpenAI({\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\tazureOpenAIEndpoint: credentials.endpoint,\n\t\t\t...options,\n\t\t\ttimeout: options.timeout ?? 60000,\n\t\t\tmaxRetries: options.maxRetries ?? 2,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tmodelKwargs: options.responseFormat\n\t\t\t\t? {\n\t\t\t\t\t\tresponse_format: { type: options.responseFormat },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAgC;AAChC,0BAMO;AAEP,0BAA6C;AAE7C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,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,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,SAAS,wCAAoB,OAAO,CAAC;AAAA,QACvF;AAAA,UACC,aACC;AAAA,UACD,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,2BAA2B,CAAC,aAAa;AAAA,YAC1C;AAAA,UACD;AAAA,QACD;AAAA,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ACT,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,EAAE;AAAA,cAC5D,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAK5B,gBAAgB;AAEnB,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAC1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAW9D,UAAM,QAAQ,IAAI,8BAAgB;AAAA,MACjC,8BAA8B;AAAA;AAAA,MAE9B,4BAA4B,CAAC,YAAY,WAAW,YAAY,eAAe;AAAA,MAC/E,mBAAmB,YAAY;AAAA,MAC/B,uBAAuB,YAAY;AAAA,MACnC,qBAAqB,YAAY;AAAA,MACjC,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW;AAAA,MAC5B,YAAY,QAAQ,cAAc;AAAA,MAClC,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,aAAa,QAAQ,iBAClB;AAAA,QACA,iBAAiB,EAAE,MAAM,QAAQ,eAAe;AAAA,MACjD,IACC;AAAA,MACH,qBAAiB,kEAA+B,IAAI;AAAA,IACrD,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -244,3 +244,4 @@ class LmChatDeepSeek {
244
244
  0 && (module.exports = {
245
245
  LmChatDeepSeek
246
246
  });
247
+ //# sourceMappingURL=LmChatDeepSeek.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport { ChatOpenAI, type ClientOptions } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { openAiFailedAttemptHandler } from '../../vendors/OpenAi/helpers/error-handling';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatDeepSeek implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'DeepSeek Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatDeepSeek',\n\t\ticon: 'file:deepseek.svg',\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription: 'For advanced usage with an AI chain',\n\t\tdefaults: {\n\t\t\tname: 'DeepSeek Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatdeepseek/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'deepSeekApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials?.url }}',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',\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\t'/options.responseFormat': ['json_object'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\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://api-docs.deepseek.com/quick_start/pricing\">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: '/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: 'data',\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.id}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.id}}',\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: 'deepseek-chat',\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: 'Frequency Penalty',\n\t\t\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Response Format',\n\t\t\t\t\t\tname: 'responseFormat',\n\t\t\t\t\t\tdefault: 'text',\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: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Regular text response',\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: 'JSON',\n\t\t\t\t\t\t\t\tvalue: 'json_object',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Enables JSON mode, which should guarantee the message the model generates is valid JSON',\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: 'Presence Penalty',\n\t\t\t\t\t\tname: 'presencePenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\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: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: 360000,\n\t\t\t\t\t\tdescription: 'Maximum amount of time a request is allowed to take in milliseconds',\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: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\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: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\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 credentials = await this.getCredentials<OpenAICompatibleCredential>('deepSeekApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tfrequencyPenalty?: number;\n\t\t\tmaxTokens?: number;\n\t\t\tmaxRetries: number;\n\t\t\ttimeout: number;\n\t\t\tpresencePenalty?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopP?: number;\n\t\t\tresponseFormat?: 'text' | 'json_object';\n\t\t};\n\n\t\tconst configuration: ClientOptions = {\n\t\t\tbaseURL: credentials.url,\n\t\t};\n\n\t\tconst model = new ChatOpenAI({\n\t\t\topenAIApiKey: credentials.apiKey,\n\t\t\tmodelName,\n\t\t\t...options,\n\t\t\ttimeout: options.timeout ?? 60000,\n\t\t\tmaxRetries: options.maxRetries ?? 2,\n\t\t\tconfiguration,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tmodelKwargs: options.responseFormat\n\t\t\t\t? {\n\t\t\t\t\t\tresponse_format: { type: options.responseFormat },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this, openAiFailedAttemptHandler),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA+C;AAC/C,0BAMO;AAEP,0BAA6C;AAE7C,4BAA2C;AAC3C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,CAAC;AAAA,MACX,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,iBAAiB;AAAA,QAChB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,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAA2C,aAAa;AAEvF,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAW9D,UAAM,gBAA+B;AAAA,MACpC,SAAS,YAAY;AAAA,IACtB;AAEA,UAAM,QAAQ,IAAI,yBAAW;AAAA,MAC5B,cAAc,YAAY;AAAA,MAC1B;AAAA,MACA,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW;AAAA,MAC5B,YAAY,QAAQ,cAAc;AAAA,MAClC;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,aAAa,QAAQ,iBAClB;AAAA,QACA,iBAAiB,EAAE,MAAM,QAAQ,eAAe;AAAA,MACjD,IACC;AAAA,MACH,qBAAiB,kEAA+B,MAAM,gDAA0B;AAAA,IACjF,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -169,3 +169,4 @@ class LmChatGoogleGemini {
169
169
  0 && (module.exports = {
170
170
  LmChatGoogleGemini
171
171
  });
172
+ //# sourceMappingURL=LmChatGoogleGemini.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { SafetySetting } from '@google/generative-ai';\nimport { ChatGoogleGenerativeAI } from '@langchain/google-genai';\nimport { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tNodeError,\n\tINodeType,\n\tINodeTypeDescription,\n\tISupplyDataFunctions,\n\tSupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { additionalOptions } from '../gemini-common/additional-options';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nfunction errorDescriptionMapper(error: NodeError) {\n\tif (error.description?.includes('properties: should be non-empty for OBJECT type')) {\n\t\treturn 'Google Gemini requires at least one <a href=\"https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/\" target=\"_blank\">dynamic parameter</a> when using tools';\n\t}\n\n\treturn error.description ?? 'Unknown error';\n}\nexport class LmChatGoogleGemini implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Google Gemini Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatGoogleGemini',\n\t\ticon: 'file:google.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Chat Model Google Gemini',\n\t\tdefaults: {\n\t\t\tname: 'Google Gemini Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatgooglegemini/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\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\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials.host }}',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\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 completion. <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: 'models/gemini-1.0-pro',\n\t\t\t},\n\t\t\tadditionalOptions,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials('googlePalmApi');\n\n\t\tconst modelName = this.getNodeParameter('modelName', itemIndex) as string;\n\t\tconst options = this.getNodeParameter('options', itemIndex, {\n\t\t\tmaxOutputTokens: 1024,\n\t\t\ttemperature: 0.7,\n\t\t\ttopK: 40,\n\t\t\ttopP: 0.9,\n\t\t}) as {\n\t\t\tmaxOutputTokens: number;\n\t\t\ttemperature: number;\n\t\t\ttopK: number;\n\t\t\ttopP: number;\n\t\t};\n\n\t\tconst safetySettings = this.getNodeParameter(\n\t\t\t'options.safetySettings.values',\n\t\t\titemIndex,\n\t\t\tnull,\n\t\t) as SafetySetting[];\n\n\t\tconst model = new ChatGoogleGenerativeAI({\n\t\t\tapiKey: credentials.apiKey as string,\n\t\t\tbaseUrl: credentials.host as string,\n\t\t\tmodelName,\n\t\t\ttopK: options.topK,\n\t\t\ttopP: options.topP,\n\t\t\ttemperature: options.temperature,\n\t\t\tmaxOutputTokens: options.maxOutputTokens,\n\t\t\tsafetySettings,\n\t\t\tcallbacks: [new N8nLlmTracing(this, { errorDescriptionMapper })],\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this),\n\t\t});\n\n\t\treturn {\n\t\t\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,iBAAiB,QAAQ;AAAA,MACzB;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAAA,MAC/D,qBAAiB,kEAA+B,IAAI;AAAA,IACrD,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -199,3 +199,4 @@ class LmChatGoogleVertex {
199
199
  0 && (module.exports = {
200
200
  LmChatGoogleVertex
201
201
  });
202
+ //# sourceMappingURL=LmChatGoogleVertex.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { SafetySetting } from '@google/generative-ai';\nimport { ProjectsClient } from '@google-cloud/resource-manager';\nimport { ChatVertexAI } from '@langchain/google-vertexai';\nimport { formatPrivateKey } from 'n8n-nodes-base/dist/utils/utilities';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n\ttype ILoadOptionsFunctions,\n\ttype JsonObject,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { makeErrorFromStatus } from './error-handling';\nimport { additionalOptions } from '../gemini-common/additional-options';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatGoogleVertex implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Google Vertex Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatGoogleVertex',\n\t\ticon: 'file:google.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Chat Model Google Vertex',\n\t\tdefaults: {\n\t\t\tname: 'Google Vertex Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatgooglevertex/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'googleApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Project ID',\n\t\t\t\tname: 'projectId',\n\t\t\t\ttype: 'resourceLocator',\n\t\t\t\tdefault: { mode: 'list', value: '' },\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'Select or enter your Google Cloud project ID',\n\t\t\t\tmodes: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'From List',\n\t\t\t\t\t\tname: 'list',\n\t\t\t\t\t\ttype: 'list',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tsearchListMethod: 'gcpProjectsList',\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: 'ID',\n\t\t\t\t\t\tname: 'id',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Model Name',\n\t\t\t\tname: 'modelName',\n\t\t\t\ttype: 'string',\n\t\t\t\tdescription:\n\t\t\t\t\t'The model which will generate the completion. <a href=\"https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models\">Learn more</a>.',\n\t\t\t\tdefault: 'gemini-1.5-flash',\n\t\t\t},\n\t\t\tadditionalOptions,\n\t\t],\n\t};\n\n\tmethods = {\n\t\tlistSearch: {\n\t\t\tasync gcpProjectsList(this: ILoadOptionsFunctions) {\n\t\t\t\tconst results: Array<{ name: string; value: string }> = [];\n\n\t\t\t\tconst credentials = await this.getCredentials('googleApi');\n\t\t\t\tconst privateKey = formatPrivateKey(credentials.privateKey as string);\n\t\t\t\tconst email = (credentials.email as string).trim();\n\n\t\t\t\tconst client = new ProjectsClient({\n\t\t\t\t\tcredentials: {\n\t\t\t\t\t\tclient_email: email,\n\t\t\t\t\t\tprivate_key: privateKey,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tconst [projects] = await client.searchProjects();\n\n\t\t\t\tfor (const project of projects) {\n\t\t\t\t\tif (project.projectId) {\n\t\t\t\t\t\tresults.push({\n\t\t\t\t\t\t\tname: project.displayName ?? project.projectId,\n\t\t\t\t\t\t\tvalue: project.projectId,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn { results };\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('googleApi');\n\t\tconst privateKey = formatPrivateKey(credentials.privateKey as string);\n\t\tconst email = (credentials.email as string).trim();\n\t\tconst region = credentials.region as string;\n\n\t\tconst modelName = this.getNodeParameter('modelName', itemIndex) as string;\n\n\t\tconst projectId = this.getNodeParameter('projectId', itemIndex, '', {\n\t\t\textractValue: true,\n\t\t}) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {\n\t\t\tmaxOutputTokens: 2048,\n\t\t\ttemperature: 0.4,\n\t\t\ttopK: 40,\n\t\t\ttopP: 0.9,\n\t\t}) as {\n\t\t\tmaxOutputTokens: number;\n\t\t\ttemperature: number;\n\t\t\ttopK: number;\n\t\t\ttopP: number;\n\t\t};\n\n\t\tconst safetySettings = this.getNodeParameter(\n\t\t\t'options.safetySettings.values',\n\t\t\titemIndex,\n\t\t\tnull,\n\t\t) as SafetySetting[];\n\n\t\ttry {\n\t\t\tconst model = new ChatVertexAI({\n\t\t\t\tauthOptions: {\n\t\t\t\t\tprojectId,\n\t\t\t\t\tcredentials: {\n\t\t\t\t\t\tclient_email: email,\n\t\t\t\t\t\tprivate_key: privateKey,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlocation: region,\n\t\t\t\tmodel: modelName,\n\t\t\t\ttopK: options.topK,\n\t\t\t\ttopP: options.topP,\n\t\t\t\ttemperature: options.temperature,\n\t\t\t\tmaxOutputTokens: options.maxOutputTokens,\n\t\t\t\tsafetySettings,\n\t\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\t\t// Handle ChatVertexAI invocation errors to provide better error messages\n\t\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this, (error: any) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\t\tconst customError = makeErrorFromStatus(Number(error?.response?.status), {\n\t\t\t\t\t\tmodelName,\n\t\t\t\t\t});\n\n\t\t\t\t\tif (customError) {\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error as JsonObject, customError);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow error;\n\t\t\t\t}),\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tresponse: model,\n\t\t\t};\n\t\t} catch (e) {\n\t\t\t// Catch model name validation error from LangChain (https://github.com/langchain-ai/langchainjs/blob/ef201d0ee85ee4049078270a0cfd7a1767e624f8/libs/langchain-google-common/src/utils/common.ts#L124)\n\t\t\t// to show more helpful error message\n\t\t\tif (e?.message?.startsWith('Unable to verify model params')) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), e as JsonObject, {\n\t\t\t\t\tmessage: 'Unsupported model',\n\t\t\t\t\tdescription: \"Only models starting with 'gemini' are supported.\",\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Assume all other exceptions while creating a new ChatVertexAI instance are parameter validation errors\n\t\t\tthrow new NodeOperationError(this.getNode(), e as JsonObject, {\n\t\t\t\tmessage: 'Invalid options',\n\t\t\t\tdescription: e.message,\n\t\t\t});\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,8BAA+B;AAC/B,6BAA6B;AAC7B,uBAAiC;AACjC,0BASO;AAEP,0BAA6C;AAE7C,4BAAoC;AACpC,gCAAkC;AAClC,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,mBAAwC;AAAA,EAA9C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,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,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,YAAY;AAAA,YACX,kD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AAG,GAAiB;AAAA,UAC7D,SAAS;AAAA,UACT,aAAa;AAAA,QACd,CAAC;AAAA,MACF;AAGA,YAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,GAAiB;AAAA,QAC7D,SAAS;AAAA,QACT,aAAa,EAAE;AAAA,MAChB,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":[]}
@@ -37,3 +37,4 @@ function makeErrorFromStatus(statusCode, context) {
37
37
  0 && (module.exports = {
38
38
  makeErrorFromStatus
39
39
  });
40
+ //# sourceMappingURL=error-handling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatGoogleVertex/error-handling.ts"],"sourcesContent":["export interface ErrorLike {\n\tmessage?: string;\n\tdescription?: string;\n}\n\nexport interface ErrorContext {\n\tmodelName?: string;\n}\n\nexport function makeErrorFromStatus(statusCode: number, context?: ErrorContext): ErrorLike {\n\tconst errorMessages: Record<number, ErrorLike> = {\n\t\t403: {\n\t\t\tmessage: 'Unauthorized for this project',\n\t\t\tdescription:\n\t\t\t\t'Check your Google Cloud project ID, and that your credential has access to that project',\n\t\t},\n\t\t404: {\n\t\t\tmessage: context?.modelName\n\t\t\t\t? `No model found called '${context.modelName}'`\n\t\t\t\t: 'No model found',\n\t\t},\n\t};\n\n\treturn errorMessages[statusCode];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASO,SAAS,oBAAoB,YAAoB,SAAmC;AAC1F,QAAM,gBAA2C;AAAA,IAChD,KAAK;AAAA,MACJ,SAAS;AAAA,MACT,aACC;AAAA,IACF;AAAA,IACA,KAAK;AAAA,MACJ,SAAS,SAAS,YACf,0BAA0B,QAAQ,SAAS,MAC3C;AAAA,IACJ;AAAA,EACD;AAEA,SAAO,cAAc,UAAU;AAChC;","names":[]}
@@ -164,3 +164,4 @@ class LmChatGroq {
164
164
  0 && (module.exports = {
165
165
  LmChatGroq
166
166
  });
167
+ //# sourceMappingURL=LmChatGroq.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatGroq/LmChatGroq.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { ChatGroq } from '@langchain/groq';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatGroq implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Groq Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatGroq',\n\t\ticon: 'file:groq.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Language Model Groq',\n\t\tdefaults: {\n\t\t\tname: 'Groq Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatgroq/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'groqApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tbaseURL: 'https://api.groq.com/openai/v1',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiChain]),\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\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: '/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: 'data',\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.active === true && $responseItem.object === \"model\" }}',\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.id}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.id}}',\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\tdescription:\n\t\t\t\t\t'The model which will generate the completion. <a href=\"https://console.groq.com/docs/models\">Learn more</a>.',\n\t\t\t\tdefault: 'llama3-8b-8192',\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokensToSample',\n\t\t\t\t\t\tdefault: 4096,\n\t\t\t\t\t\tdescription: 'The maximum number of tokens to generate in the completion',\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\n\t\t\t\t\t\ttype: 'number',\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 credentials = await this.getCredentials('groqApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tmaxTokensToSample?: number;\n\t\t\ttemperature: number;\n\t\t};\n\n\t\tconst model = new ChatGroq({\n\t\t\tapiKey: credentials.apiKey as string,\n\t\t\tmodelName,\n\t\t\tmaxTokens: options.maxTokensToSample,\n\t\t\ttemperature: options.temperature,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAyB;AACzB,0BAMO;AAEP,0BAA6C;AAE7C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,WAAgC;AAAA,EAAtC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,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,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,iBAAiB;AAAA,QAChB,SAAS;AAAA,MACV;AAAA,MACA,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,SAAS,wCAAoB,OAAO,CAAC;AAAA,QACvF;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aAAa;AAAA,YACZ,aAAa;AAAA,cACZ,SAAS;AAAA,gBACR,SAAS;AA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;AAAA,MAC1B,QAAQ,YAAY;AAAA,MACpB;AAAA,MACA,WAAW,QAAQ;AAAA,MACnB,aAAa,QAAQ;AAAA,MACrB,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,qBAAiB,kEAA+B,IAAI;AAAA,IACrD,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -209,3 +209,4 @@ class LmChatMistralCloud {
209
209
  0 && (module.exports = {
210
210
  LmChatMistralCloud
211
211
  });
212
+ //# sourceMappingURL=LmChatMistralCloud.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport type { ChatMistralAIInput } from '@langchain/mistralai';\nimport { ChatMistralAI } from '@langchain/mistralai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatMistralCloud implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Mistral Cloud Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatMistralCloud',\n\t\ticon: 'file:mistral.svg',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'For advanced usage with an AI chain',\n\t\tdefaults: {\n\t\t\tname: 'Mistral Cloud Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatmistralcloud/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'mistralCloudApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: 'https://api.mistral.ai/v1',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\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.mistral.ai/platform/endpoints/\">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: '/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: 'data',\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.id.includes('embed') }}\",\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.id }}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{ $responseItem.id }}',\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: 'mistral-small',\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\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: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\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: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Enable Safe Mode',\n\t\t\t\t\t\tname: 'safeMode',\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\tdescription: 'Whether to inject a safety prompt before all conversations',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Random Seed',\n\t\t\t\t\t\tname: 'randomSeed',\n\t\t\t\t\t\tdefault: undefined,\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The seed to use for random sampling. If set, different calls will generate deterministic results.',\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 credentials = await this.getCredentials('mistralCloudApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\t\tconst options = this.getNodeParameter('options', itemIndex, {\n\t\t\tmaxRetries: 2,\n\t\t\ttopP: 1,\n\t\t\ttemperature: 0.7,\n\t\t\tmaxTokens: -1,\n\t\t\tsafeMode: false,\n\t\t\trandomSeed: undefined,\n\t\t}) as Partial<ChatMistralAIInput>;\n\n\t\tconst model = new ChatMistralAI({\n\t\t\tapiKey: credentials.apiKey as string,\n\t\t\tmodelName,\n\t\t\t...options,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAA8B;AAC9B,0BAMO;AAEP,0BAA6C;AAE7C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,mBAAwC;AAAA,EAA9C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,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,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AA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IACb,CAAC;AAED,UAAM,QAAQ,IAAI,+BAAc;AAAA,MAC/B,QAAQ,YAAY;AAAA,MACpB;AAAA,MACA,GAAG;AAAA,MACH,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,qBAAiB,kEAA+B,IAAI;AAAA,IACrD,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -243,3 +243,4 @@ class LmChatOpenRouter {
243
243
  0 && (module.exports = {
244
244
  LmChatOpenRouter
245
245
  });
246
+ //# sourceMappingURL=LmChatOpenRouter.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport { ChatOpenAI, type ClientOptions } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { openAiFailedAttemptHandler } from '../../vendors/OpenAi/helpers/error-handling';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatOpenRouter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'OpenRouter Chat Model',\n\t\tname: 'lmChatOpenRouter',\n\t\ticon: { light: 'file:openrouter.svg', dark: 'file:openrouter.dark.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription: 'For advanced usage with an AI chain',\n\t\tdefaults: {\n\t\t\tname: 'OpenRouter Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatopenrouter/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'openRouterApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials?.url }}',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',\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\t'/options.responseFormat': ['json_object'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\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://openrouter.ai/docs/models\">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: '/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: 'data',\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.id}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.id}}',\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: 'openai/gpt-4o-mini',\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: 'Frequency Penalty',\n\t\t\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Response Format',\n\t\t\t\t\t\tname: 'responseFormat',\n\t\t\t\t\t\tdefault: 'text',\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: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Regular text response',\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: 'JSON',\n\t\t\t\t\t\t\t\tvalue: 'json_object',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Enables JSON mode, which should guarantee the message the model generates is valid JSON',\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: 'Presence Penalty',\n\t\t\t\t\t\tname: 'presencePenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\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: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: 360000,\n\t\t\t\t\t\tdescription: 'Maximum amount of time a request is allowed to take in milliseconds',\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: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\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: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\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 credentials = await this.getCredentials<OpenAICompatibleCredential>('openRouterApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tfrequencyPenalty?: number;\n\t\t\tmaxTokens?: number;\n\t\t\tmaxRetries: number;\n\t\t\ttimeout: number;\n\t\t\tpresencePenalty?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopP?: number;\n\t\t\tresponseFormat?: 'text' | 'json_object';\n\t\t};\n\n\t\tconst configuration: ClientOptions = {\n\t\t\tbaseURL: credentials.url,\n\t\t};\n\n\t\tconst model = new ChatOpenAI({\n\t\t\topenAIApiKey: credentials.apiKey,\n\t\t\tmodelName,\n\t\t\t...options,\n\t\t\ttimeout: options.timeout ?? 60000,\n\t\t\tmaxRetries: options.maxRetries ?? 2,\n\t\t\tconfiguration,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tmodelKwargs: options.responseFormat\n\t\t\t\t? {\n\t\t\t\t\t\tresponse_format: { type: options.responseFormat },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this, openAiFailedAttemptHandler),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA+C;AAC/C,0BAMO;AAEP,0BAA6C;AAE7C,4BAA2C;AAC3C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,iBAAsC;AAAA,EAA5C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAE,OAAO,uBAAuB,MAAM,2BAA2B;AAAA,MACvE,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,CAAC;AAAA,MACX,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACj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AAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,EAAE;AAAA,cAC5D,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAA2C,eAAe;AAEzF,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAW9D,UAAM,gBAA+B;AAAA,MACpC,SAAS,YAAY;AAAA,IACtB;AAEA,UAAM,QAAQ,IAAI,yBAAW;AAAA,MAC5B,cAAc,YAAY;AAAA,MAC1B;AAAA,MACA,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW;AAAA,MAC5B,YAAY,QAAQ,cAAc;AAAA,MAClC;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,aAAa,QAAQ,iBAClB;AAAA,QACA,iBAAiB,EAAE,MAAM,QAAQ,eAAe;AAAA,MACjD,IACC;AAAA,MACH,qBAAiB,kEAA+B,MAAM,gDAA0B;AAAA,IACjF,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -244,3 +244,4 @@ class LmChatXAiGrok {
244
244
  0 && (module.exports = {
245
245
  LmChatXAiGrok
246
246
  });
247
+ //# sourceMappingURL=LmChatXAiGrok.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport { ChatOpenAI, type ClientOptions } from '@langchain/openai';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { openAiFailedAttemptHandler } from '../../vendors/OpenAi/helpers/error-handling';\nimport { makeN8nLlmFailedAttemptHandler } from '../n8nLlmFailedAttemptHandler';\nimport { N8nLlmTracing } from '../N8nLlmTracing';\n\nexport class LmChatXAiGrok implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'xAI Grok Chat Model',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-name-miscased\n\t\tname: 'lmChatXAiGrok',\n\t\ticon: { light: 'file:logo.dark.svg', dark: 'file:logo.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: [1],\n\t\tdescription: 'For advanced usage with an AI chain',\n\t\tdefaults: {\n\t\t\tname: 'xAI Grok Chat Model',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Language Models', 'Root Nodes'],\n\t\t\t\t'Language Models': ['Chat Models (Recommended)'],\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.lmchatxaigrok/',\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.AiLanguageModel],\n\t\toutputNames: ['Model'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'xAiApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials?.url }}',\n\t\t},\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.',\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\t'/options.responseFormat': ['json_object'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\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.x.ai/docs/models\">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: '/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: 'data',\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.id}}',\n\t\t\t\t\t\t\t\t\t\t\tvalue: '={{$responseItem.id}}',\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: 'grok-2-vision-1212',\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: 'Frequency Penalty',\n\t\t\t\t\t\tname: 'frequencyPenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\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: 'Maximum Number of Tokens',\n\t\t\t\t\t\tname: 'maxTokens',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\tmaxValue: 32768,\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: 'Response Format',\n\t\t\t\t\t\tname: 'responseFormat',\n\t\t\t\t\t\tdefault: 'text',\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: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Regular text response',\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: 'JSON',\n\t\t\t\t\t\t\t\tvalue: 'json_object',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Enables JSON mode, which should guarantee the message the model generates is valid JSON',\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: 'Presence Penalty',\n\t\t\t\t\t\tname: 'presencePenalty',\n\t\t\t\t\t\tdefault: 0,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\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: 'Sampling Temperature',\n\t\t\t\t\t\tname: 'temperature',\n\t\t\t\t\t\tdefault: 0.7,\n\t\t\t\t\t\ttypeOptions: { maxValue: 2, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\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: 'Timeout',\n\t\t\t\t\t\tname: 'timeout',\n\t\t\t\t\t\tdefault: 360000,\n\t\t\t\t\t\tdescription: 'Maximum amount of time a request is allowed to take in milliseconds',\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: 'Max Retries',\n\t\t\t\t\t\tname: 'maxRetries',\n\t\t\t\t\t\tdefault: 2,\n\t\t\t\t\t\tdescription: 'Maximum number of retries to attempt',\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: 'Top P',\n\t\t\t\t\t\tname: 'topP',\n\t\t\t\t\t\tdefault: 1,\n\t\t\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\t\t\ttype: 'number',\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 credentials = await this.getCredentials<OpenAICompatibleCredential>('xAiApi');\n\n\t\tconst modelName = this.getNodeParameter('model', itemIndex) as string;\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tfrequencyPenalty?: number;\n\t\t\tmaxTokens?: number;\n\t\t\tmaxRetries: number;\n\t\t\ttimeout: number;\n\t\t\tpresencePenalty?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopP?: number;\n\t\t\tresponseFormat?: 'text' | 'json_object';\n\t\t};\n\n\t\tconst configuration: ClientOptions = {\n\t\t\tbaseURL: credentials.url,\n\t\t};\n\n\t\tconst model = new ChatOpenAI({\n\t\t\topenAIApiKey: credentials.apiKey,\n\t\t\tmodelName,\n\t\t\t...options,\n\t\t\ttimeout: options.timeout ?? 60000,\n\t\t\tmaxRetries: options.maxRetries ?? 2,\n\t\t\tconfiguration,\n\t\t\tcallbacks: [new N8nLlmTracing(this)],\n\t\t\tmodelKwargs: options.responseFormat\n\t\t\t\t? {\n\t\t\t\t\t\tresponse_format: { type: options.responseFormat },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tonFailedAttempt: makeN8nLlmFailedAttemptHandler(this, openAiFailedAttemptHandler),\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: model,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA+C;AAC/C,0BAMO;AAEP,0BAA6C;AAE7C,4BAA2C;AAC3C,wCAA+C;AAC/C,2BAA8B;AAEvB,MAAM,cAAmC;AAAA,EAAzC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA;AAAA,MAEb,MAAM;AAAA,MACN,MAAM,EAAE,OAAO,sBAAsB,MAAM,gBAAgB;AAAA,MAC3D,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,CAAC;AAAA,MACX,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,mBAAmB,YAAY;AAAA,UACpC,mBAAmB,CAAC,2BAA2B;AAAA,QAChD;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,MAET,SAAS,CAAC,wCAAoB,eAAe;AAAA,MAC7C,aAAa,CAAC,OAAO;AAAA,MACrB,aAAa;AAAA,QACZ;AAA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iB,EAAE;AAAA,cAC5D,aACC;AAAA,cACD,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,cAAc,MAAM,KAAK,eAA2C,QAAQ;AAElF,UAAM,YAAY,KAAK,iBAAiB,SAAS,SAAS;AAE1D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAW9D,UAAM,gBAA+B;AAAA,MACpC,SAAS,YAAY;AAAA,IACtB;AAEA,UAAM,QAAQ,IAAI,yBAAW;AAAA,MAC5B,cAAc,YAAY;AAAA,MAC1B;AAAA,MACA,GAAG;AAAA,MACH,SAAS,QAAQ,WAAW;AAAA,MAC5B,YAAY,QAAQ,cAAc;AAAA,MAClC;AAAA,MACA,WAAW,CAAC,IAAI,mCAAc,IAAI,CAAC;AAAA,MACnC,aAAa,QAAQ,iBAClB;AAAA,QACA,iBAAiB,EAAE,MAAM,QAAQ,eAAe;AAAA,MACjD,IACC;AAAA,MACH,qBAAiB,kEAA+B,MAAM,gDAA0B;AAAA,IACjF,CAAC;AAED,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -169,3 +169,4 @@ class N8nLlmTracing extends import_base.BaseCallbackHandler {
169
169
  0 && (module.exports = {
170
170
  N8nLlmTracing
171
171
  });
172
+ //# sourceMappingURL=N8nLlmTracing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/llms/N8nLlmTracing.ts"],"sourcesContent":["import { BaseCallbackHandler } from '@langchain/core/callbacks/base';\nimport type { SerializedFields } from '@langchain/core/dist/load/map_keys';\nimport { getModelNameForTiktoken } from '@langchain/core/language_models/base';\nimport type {\n\tSerialized,\n\tSerializedNotImplemented,\n\tSerializedSecret,\n} from '@langchain/core/load/serializable';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport type { LLMResult } from '@langchain/core/outputs';\nimport { encodingForModel } from '@langchain/core/utils/tiktoken';\nimport { pick } from 'lodash';\nimport type { IDataObject, ISupplyDataFunctions, JsonObject } from 'n8n-workflow';\nimport { NodeConnectionTypes, NodeError, NodeOperationError } from 'n8n-workflow';\n\nimport { logAiEvent } from '@utils/helpers';\n\ntype TokensUsageParser = (llmOutput: LLMResult['llmOutput']) => {\n\tcompletionTokens: number;\n\tpromptTokens: number;\n\ttotalTokens: number;\n};\n\ntype RunDetail = {\n\tindex: number;\n\tmessages: BaseMessage[] | string[] | string;\n\toptions: SerializedSecret | SerializedNotImplemented | SerializedFields;\n};\n\nconst TIKTOKEN_ESTIMATE_MODEL = 'gpt-4o';\nexport class N8nLlmTracing extends BaseCallbackHandler {\n\tname = 'N8nLlmTracing';\n\n\t// This flag makes sure that LangChain will wait for the handlers to finish before continuing\n\t// This is crucial for the handleLLMError handler to work correctly (it should be called before the error is propagated to the root node)\n\tawaitHandlers = true;\n\n\tconnectionType = NodeConnectionTypes.AiLanguageModel;\n\n\tpromptTokensEstimate = 0;\n\n\tcompletionTokensEstimate = 0;\n\n\t/**\n\t * A map to associate LLM run IDs to run details.\n\t * Key: Unique identifier for each LLM run (run ID)\n\t * Value: RunDetails object\n\t *\n\t */\n\trunsMap: Record<string, RunDetail> = {};\n\n\toptions = {\n\t\t// Default(OpenAI format) parser\n\t\ttokensUsageParser: (llmOutput: LLMResult['llmOutput']) => {\n\t\t\tconst completionTokens = (llmOutput?.tokenUsage?.completionTokens as number) ?? 0;\n\t\t\tconst promptTokens = (llmOutput?.tokenUsage?.promptTokens as number) ?? 0;\n\n\t\t\treturn {\n\t\t\t\tcompletionTokens,\n\t\t\t\tpromptTokens,\n\t\t\t\ttotalTokens: completionTokens + promptTokens,\n\t\t\t};\n\t\t},\n\t\terrorDescriptionMapper: (error: NodeError) => error.description,\n\t};\n\n\tconstructor(\n\t\tprivate executionFunctions: ISupplyDataFunctions,\n\t\toptions?: {\n\t\t\ttokensUsageParser?: TokensUsageParser;\n\t\t\terrorDescriptionMapper?: (error: NodeError) => string;\n\t\t},\n\t) {\n\t\tsuper();\n\t\tthis.options = { ...this.options, ...options };\n\t}\n\n\tasync estimateTokensFromGeneration(generations: LLMResult['generations']) {\n\t\tconst messages = generations.flatMap((gen) => gen.map((g) => g.text));\n\t\treturn await this.estimateTokensFromStringList(messages);\n\t}\n\n\tasync estimateTokensFromStringList(list: string[]) {\n\t\tconst embeddingModel = getModelNameForTiktoken(TIKTOKEN_ESTIMATE_MODEL);\n\t\tconst encoder = await encodingForModel(embeddingModel);\n\n\t\tconst encodedListLength = await Promise.all(\n\t\t\tlist.map(async (text) => encoder.encode(text).length),\n\t\t);\n\n\t\treturn encodedListLength.reduce((acc, curr) => acc + curr, 0);\n\t}\n\n\tasync handleLLMEnd(output: LLMResult, runId: string) {\n\t\t// The fallback should never happen since handleLLMStart should always set the run details\n\t\t// but just in case, we set the index to the length of the runsMap\n\t\tconst runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };\n\n\t\toutput.generations = output.generations.map((gen) =>\n\t\t\tgen.map((g) => pick(g, ['text', 'generationInfo'])),\n\t\t);\n\n\t\tconst tokenUsageEstimate = {\n\t\t\tcompletionTokens: 0,\n\t\t\tpromptTokens: 0,\n\t\t\ttotalTokens: 0,\n\t\t};\n\t\tconst tokenUsage = this.options.tokensUsageParser(output.llmOutput);\n\n\t\tif (output.generations.length > 0) {\n\t\t\ttokenUsageEstimate.completionTokens = await this.estimateTokensFromGeneration(\n\t\t\t\toutput.generations,\n\t\t\t);\n\n\t\t\ttokenUsageEstimate.promptTokens = this.promptTokensEstimate;\n\t\t\ttokenUsageEstimate.totalTokens =\n\t\t\t\ttokenUsageEstimate.completionTokens + this.promptTokensEstimate;\n\t\t}\n\t\tconst response: {\n\t\t\tresponse: { generations: LLMResult['generations'] };\n\t\t\ttokenUsageEstimate?: typeof tokenUsageEstimate;\n\t\t\ttokenUsage?: typeof tokenUsage;\n\t\t} = {\n\t\t\tresponse: { generations: output.generations },\n\t\t};\n\n\t\t// If the LLM response contains actual tokens usage, otherwise fallback to the estimate\n\t\tif (tokenUsage.completionTokens > 0) {\n\t\t\tresponse.tokenUsage = tokenUsage;\n\t\t} else {\n\t\t\tresponse.tokenUsageEstimate = tokenUsageEstimate;\n\t\t}\n\n\t\tconst parsedMessages =\n\t\t\ttypeof runDetails.messages === 'string'\n\t\t\t\t? runDetails.messages\n\t\t\t\t: runDetails.messages.map((message) => {\n\t\t\t\t\t\tif (typeof message === 'string') return message;\n\t\t\t\t\t\tif (typeof message?.toJSON === 'function') return message.toJSON();\n\n\t\t\t\t\t\treturn message;\n\t\t\t\t\t});\n\n\t\tthis.executionFunctions.addOutputData(this.connectionType, runDetails.index, [\n\t\t\t[{ json: { ...response } }],\n\t\t]);\n\n\t\tlogAiEvent(this.executionFunctions, 'ai-llm-generated-output', {\n\t\t\tmessages: parsedMessages,\n\t\t\toptions: runDetails.options,\n\t\t\tresponse,\n\t\t});\n\t}\n\n\tasync handleLLMStart(llm: Serialized, prompts: string[], runId: string) {\n\t\tconst estimatedTokens = await this.estimateTokensFromStringList(prompts);\n\n\t\tconst options = llm.type === 'constructor' ? llm.kwargs : llm;\n\t\tconst { index } = this.executionFunctions.addInputData(this.connectionType, [\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tjson: {\n\t\t\t\t\t\tmessages: prompts,\n\t\t\t\t\t\testimatedTokens,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t]);\n\n\t\t// Save the run details for later use when processing `handleLLMEnd` event\n\t\tthis.runsMap[runId] = {\n\t\t\tindex,\n\t\t\toptions,\n\t\t\tmessages: prompts,\n\t\t};\n\t\tthis.promptTokensEstimate = estimatedTokens;\n\t}\n\n\tasync handleLLMError(\n\t\terror: IDataObject | Error,\n\t\trunId: string,\n\t\tparentRunId?: string | undefined,\n\t) {\n\t\tconst runDetails = this.runsMap[runId] ?? { index: Object.keys(this.runsMap).length };\n\n\t\t// Filter out non-x- headers to avoid leaking sensitive information in logs\n\t\tif (typeof error === 'object' && error?.hasOwnProperty('headers')) {\n\t\t\tconst errorWithHeaders = error as { headers: Record<string, unknown> };\n\n\t\t\tObject.keys(errorWithHeaders.headers).forEach((key) => {\n\t\t\t\tif (!key.startsWith('x-')) {\n\t\t\t\t\tdelete errorWithHeaders.headers[key];\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (error instanceof NodeError) {\n\t\t\tif (this.options.errorDescriptionMapper) {\n\t\t\t\terror.description = this.options.errorDescriptionMapper(error);\n\t\t\t}\n\n\t\t\tthis.executionFunctions.addOutputData(this.connectionType, runDetails.index, error);\n\t\t} else {\n\t\t\t// If the error is not a NodeError, we wrap it in a NodeOperationError\n\t\t\tthis.executionFunctions.addOutputData(\n\t\t\t\tthis.connectionType,\n\t\t\t\trunDetails.index,\n\t\t\t\tnew NodeOperationError(this.executionFunctions.getNode(), error as JsonObject, {\n\t\t\t\t\tfunctionality: 'configuration-node',\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tlogAiEvent(this.executionFunctions, 'ai-llm-errored', {\n\t\t\terror: Object.keys(error).length === 0 ? error.toString() : error,\n\t\t\trunId,\n\t\t\tparentRunId,\n\t\t});\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAoC;AAEpC,IAAAA,eAAwC;AAQxC,sBAAiC;AACjC,oBAAqB;AAErB,0BAAmE;AAEnE,qBAA2B;AAc3B,MAAM,0BAA0B;AACzB,MAAM,sBAAsB,gCAAoB;AAAA,EAoCtD,YACS,oBACR,SAIC;AACD,UAAM;AANE;AApCT,gBAAO;AAIP;AAAA;AAAA,yBAAgB;AAEhB,0BAAiB,wCAAoB;AAErC,gCAAuB;AAEvB,oCAA2B;AAQ3B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC,CAAC;AAEtC,mBAAU;AAAA;AAAA,MAET,mBAAmB,CAAC,cAAsC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ACD,UAAM,aAAa,KAAK,QAAQ,KAAK,KAAK,EAAE,OAAO,OAAO,KAAK,KAAK,OAAO,EAAE,OAAO;AAGpF,QAAI,OAAO,UAAU,YAAY,OAAO,eAAe,SAAS,GAAG;AAClE,YAAM,mBAAmB;AAEzB,aAAO,KAAK,iBAAiB,OAAO,EAAE,QAAQ,CAAC,QAAQ;AACtD,YAAI,CAAC,IAAI,WAAW,IAAI,GAAG;AAC1B,iBAAO,iBAAiB,QAAQ,GAAG;AAAA,QACpC;AAAA,MACD,CAAC;AAAA,IACF;AAEA,QAAI,iBAAiB,+BAAW;AAC/B,UAAI,KAAK,QAAQ,wBAAwB;AACxC,cAAM,cAAc,KAAK,QAAQ,uBAAuB,KAAK;AAAA,MAC9D;AAEA,WAAK,mBAAmB,cAAc,KAAK,gBAAgB,WAAW,OAAO,KAAK;AAAA,IACnF,OAAO;AAEN,WAAK,mBAAmB;AAAA,QACvB,KAAK;AAAA,QACL,WAAW;AAAA,QACX,IAAI,uCAAmB,KAAK,mBAAmB,QAAQ,GAAG,OAAqB;AAAA,UAC9E,eAAe;AAAA,QAChB,CAAC;AAAA,MACF;AAAA,IACD;AAEA,mCAAW,KAAK,oBAAoB,kBAAkB;AAAA,MACrD,OAAO,OAAO,KAAK,KAAK,EAAE,WAAW,IAAI,MAAM,SAAS,IAAI;AAAA,MAC5D;AAAA,MACA;AAAA,IACD,CAAC;AAAA,EACF;AACD;","names":["import_base"]}
@@ -105,3 +105,4 @@ const additionalOptions = {
105
105
  0 && (module.exports = {
106
106
  additionalOptions
107
107
  });
108
+ //# sourceMappingURL=additional-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/gemini-common/additional-options.ts"],"sourcesContent":["import type { HarmBlockThreshold, HarmCategory } from '@google/generative-ai';\nimport type { INodeProperties } from 'n8n-workflow';\n\nimport { harmCategories, harmThresholds } from './safety-options';\n\nexport const additionalOptions: INodeProperties = {\n\tdisplayName: 'Options',\n\tname: 'options',\n\tplaceholder: 'Add Option',\n\tdescription: 'Additional options to add',\n\ttype: 'collection',\n\tdefault: {},\n\toptions: [\n\t\t{\n\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\tname: 'maxOutputTokens',\n\t\t\tdefault: 2048,\n\t\t\tdescription: 'The maximum number of tokens to generate in the completion',\n\t\t\ttype: 'number',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Sampling Temperature',\n\t\t\tname: 'temperature',\n\t\t\tdefault: 0.4,\n\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\tdescription:\n\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.',\n\t\t\ttype: 'number',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Top K',\n\t\t\tname: 'topK',\n\t\t\tdefault: 32,\n\t\t\ttypeOptions: { maxValue: 40, minValue: -1, numberPrecision: 1 },\n\t\t\tdescription:\n\t\t\t\t'Used to remove \"long tail\" low probability responses. Defaults to -1, which disables it.',\n\t\t\ttype: 'number',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Top P',\n\t\t\tname: 'topP',\n\t\t\tdefault: 1,\n\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\tdescription:\n\t\t\t\t'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\ttype: 'number',\n\t\t},\n\n\t\t// Safety Settings\n\t\t{\n\t\t\tdisplayName: 'Safety Settings',\n\t\t\tname: 'safetySettings',\n\t\t\ttype: 'fixedCollection',\n\t\t\ttypeOptions: { multipleValues: true },\n\t\t\tdefault: {\n\t\t\t\tvalues: {\n\t\t\t\t\tcategory: harmCategories[0].name as HarmCategory,\n\t\t\t\t\tthreshold: harmThresholds[0].name as HarmBlockThreshold,\n\t\t\t\t},\n\t\t\t},\n\t\t\tplaceholder: 'Add Option',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'values',\n\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\tvalues: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Safety Category',\n\t\t\t\t\t\t\tname: 'category',\n\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\tdescription: 'The category of harmful content to block',\n\t\t\t\t\t\t\tdefault: 'HARM_CATEGORY_UNSPECIFIED',\n\t\t\t\t\t\t\toptions: harmCategories,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdisplayName: 'Safety Threshold',\n\t\t\t\t\t\t\tname: 'threshold',\n\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\tdescription: 'The threshold of harmful content to block',\n\t\t\t\t\t\t\tdefault: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED',\n\t\t\t\t\t\t\toptions: harmThresholds,\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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,4BAA+C;AAExC,MAAM,oBAAqC;AAAA,EACjD,aAAa;AAAA,EACb,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,SAAS;AAAA,IACR;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,EAAE;AAAA,MAC5D,aACC;AAAA,MACD,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,EAAE,UAAU,IAAI,UAAU,IAAI,iBAAiB,EAAE;AAAA,MAC9D,aACC;AAAA,MACD,MAAM;AAAA,IACP;AAAA,IACA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,EAAE;AAAA,MAC5D,aACC;AAAA,MACD,MAAM;AAAA,IACP;AAAA;AAAA,IAGA;AAAA,MACC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,aAAa,EAAE,gBAAgB,KAAK;AAAA,MACpC,SAAS;AAAA,QACR,QAAQ;AAAA,UACP,UAAU,qCAAe,CAAC,EAAE;AAAA,UAC5B,WAAW,qCAAe,CAAC,EAAE;AAAA,QAC9B;AAAA,MACD;AAAA,MACA,aAAa;AAAA,MACb,SAAS;AAAA,QACR;AAAA,UACC,MAAM;AAAA,UACN,aAAa;AAAA,UACb,QAAQ;AAAA,YACP;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,aAAa;AAAA,cACb,SAAS;AAAA,cACT,SAAS;AAAA,YACV;AAAA,YACA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,aAAa;AAAA,cACb,SAAS;AAAA,cACT,SAAS;AAAA,YACV;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
@@ -76,3 +76,4 @@ const harmThresholds = [
76
76
  harmCategories,
77
77
  harmThresholds
78
78
  });
79
+ //# sourceMappingURL=safety-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/llms/gemini-common/safety-options.ts"],"sourcesContent":["import type { INodePropertyOptions } from 'n8n-workflow';\n\nexport const harmCategories: INodePropertyOptions[] = [\n\t{\n\t\tvalue: 'HARM_CATEGORY_HARASSMENT',\n\t\tname: 'HARM_CATEGORY_HARASSMENT',\n\t\tdescription: 'Harassment content',\n\t},\n\t{\n\t\tvalue: 'HARM_CATEGORY_HATE_SPEECH',\n\t\tname: 'HARM_CATEGORY_HATE_SPEECH',\n\t\tdescription: 'Hate speech and content',\n\t},\n\t{\n\t\tvalue: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',\n\t\tname: 'HARM_CATEGORY_SEXUALLY_EXPLICIT',\n\t\tdescription: 'Sexually explicit content',\n\t},\n\t{\n\t\tvalue: 'HARM_CATEGORY_DANGEROUS_CONTENT',\n\t\tname: 'HARM_CATEGORY_DANGEROUS_CONTENT',\n\t\tdescription: 'Dangerous content',\n\t},\n];\n\nexport const harmThresholds: INodePropertyOptions[] = [\n\t{\n\t\tvalue: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED',\n\t\tname: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED',\n\t\tdescription: 'Threshold is unspecified',\n\t},\n\t{\n\t\tvalue: 'BLOCK_LOW_AND_ABOVE',\n\t\tname: 'BLOCK_LOW_AND_ABOVE',\n\t\tdescription: 'Content with NEGLIGIBLE will be allowed',\n\t},\n\t{\n\t\tvalue: 'BLOCK_MEDIUM_AND_ABOVE',\n\t\tname: 'BLOCK_MEDIUM_AND_ABOVE',\n\t\tdescription: 'Content with NEGLIGIBLE and LOW will be allowed',\n\t},\n\t{\n\t\tvalue: 'BLOCK_ONLY_HIGH',\n\t\tname: 'BLOCK_ONLY_HIGH',\n\t\tdescription: 'Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed',\n\t},\n\t{\n\t\tvalue: 'BLOCK_NONE',\n\t\tname: 'BLOCK_NONE',\n\t\tdescription: 'All content will be allowed',\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,iBAAyC;AAAA,EACrD;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AACD;AAEO,MAAM,iBAAyC;AAAA,EACrD;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACd;AACD;","names":[]}
@@ -63,3 +63,4 @@ const n8nDefaultFailedAttemptHandler = (error) => {
63
63
  0 && (module.exports = {
64
64
  n8nDefaultFailedAttemptHandler
65
65
  });
66
+ //# sourceMappingURL=n8nDefaultFailedAttemptHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/llms/n8nDefaultFailedAttemptHandler.ts"],"sourcesContent":["const STATUS_NO_RETRY = [\n\t400, // Bad Request\n\t401, // Unauthorized\n\t402, // Payment Required\n\t403, // Forbidden\n\t404, // Not Found\n\t405, // Method Not Allowed\n\t406, // Not Acceptable\n\t407, // Proxy Authentication Required\n\t409, // Conflict\n];\n\n/**\n * This function is used as a default handler for failed attempts in all LLMs.\n * It is based on a default handler from the langchain core package.\n * It throws an error when it encounters a known error that should not be retried.\n * @param error\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const n8nDefaultFailedAttemptHandler = (error: any) => {\n\tif (\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call\n\t\terror?.message?.startsWith?.('Cancel') ||\n\t\terror?.message?.startsWith?.('AbortError') ||\n\t\terror?.name === 'AbortError'\n\t) {\n\t\tthrow error;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access\n\tif (error?.code === 'ECONNABORTED') {\n\t\tthrow error;\n\t}\n\n\tconst status =\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access\n\t\terror?.response?.status ?? error?.status;\n\tif (status && STATUS_NO_RETRY.includes(+status)) {\n\t\tthrow error;\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,kBAAkB;AAAA,EACvB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACD;AASO,MAAM,iCAAiC,CAAC,UAAe;AAC7D;AAAA;AAAA,IAEC,OAAO,SAAS,aAAa,QAAQ,KACrC,OAAO,SAAS,aAAa,YAAY,KACzC,OAAO,SAAS;AAAA,IACf;AACD,UAAM;AAAA,EACP;AAGA,MAAI,OAAO,SAAS,gBAAgB;AACnC,UAAM;AAAA,EACP;AAEA,QAAM;AAAA;AAAA,IAEL,OAAO,UAAU,UAAU,OAAO;AAAA;AACnC,MAAI,UAAU,gBAAgB,SAAS,CAAC,MAAM,GAAG;AAChD,UAAM;AAAA,EACP;AACD;","names":[]}
@@ -47,3 +47,4 @@ const makeN8nLlmFailedAttemptHandler = (ctx, handler) => {
47
47
  0 && (module.exports = {
48
48
  makeN8nLlmFailedAttemptHandler
49
49
  });
50
+ //# sourceMappingURL=n8nLlmFailedAttemptHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../nodes/llms/n8nLlmFailedAttemptHandler.ts"],"sourcesContent":["import type { FailedAttemptHandler } from '@langchain/core/dist/utils/async_caller';\nimport type { ISupplyDataFunctions, JsonObject } from 'n8n-workflow';\nimport { NodeApiError } from 'n8n-workflow';\n\nimport { n8nDefaultFailedAttemptHandler } from './n8nDefaultFailedAttemptHandler';\n\n/**\n * This function returns a custom failed attempt handler for using with LangChain models.\n * It first tries to use a custom handler passed as an argument, and if that doesn't throw an error, it uses the default handler.\n * It always wraps the error in a NodeApiError.\n * It throws an error ONLY if there are no retries left.\n */\nexport const makeN8nLlmFailedAttemptHandler = (\n\tctx: ISupplyDataFunctions,\n\thandler?: FailedAttemptHandler,\n): FailedAttemptHandler => {\n\treturn (error: any) => {\n\t\ttry {\n\t\t\t// Try custom error handler first\n\t\t\thandler?.(error);\n\n\t\t\t// If it didn't throw an error, use the default handler\n\t\t\tn8nDefaultFailedAttemptHandler(error);\n\t\t} catch (e) {\n\t\t\t// Wrap the error in a NodeApiError\n\t\t\tconst apiError = new NodeApiError(ctx.getNode(), e as unknown as JsonObject, {\n\t\t\t\tfunctionality: 'configuration-node',\n\t\t\t});\n\n\t\t\tthrow apiError;\n\t\t}\n\n\t\t// If no error was thrown, check if it is the last retry\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tif (error?.retriesLeft > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are no retries left, throw the error wrapped in a NodeApiError\n\t\tconst apiError = new NodeApiError(ctx.getNode(), error as unknown as JsonObject, {\n\t\t\tfunctionality: 'configuration-node',\n\t\t});\n\n\t\tthrow apiError;\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA6B;AAE7B,4CAA+C;AAQxC,MAAM,iCAAiC,CAC7C,KACA,YAC0B;AAC1B,SAAO,CAAC,UAAe;AACtB,QAAI;AAEH,gBAAU,KAAK;AAGf,gFAA+B,KAAK;AAAA,IACrC,SAAS,GAAG;AAEX,YAAMA,YAAW,IAAI,iCAAa,IAAI,QAAQ,GAAG,GAA4B;AAAA,QAC5E,eAAe;AAAA,MAChB,CAAC;AAED,YAAMA;AAAA,IACP;AAIA,QAAI,OAAO,cAAc,GAAG;AAC3B;AAAA,IACD;AAGA,UAAM,WAAW,IAAI,iCAAa,IAAI,QAAQ,GAAG,OAAgC;AAAA,MAChF,eAAe;AAAA,IAChB,CAAC;AAED,UAAM;AAAA,EACP;AACD;","names":["apiError"]}
@@ -161,3 +161,4 @@ class MemoryBufferWindow {
161
161
  0 && (module.exports = {
162
162
  MemoryBufferWindow
163
163
  });
164
+ //# sourceMappingURL=MemoryBufferWindow.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BufferWindowMemoryInput } from 'langchain/memory';\nimport { BufferWindowMemory } from 'langchain/memory';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { getSessionId } from '@utils/helpers';\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport {\n\tsessionIdOption,\n\tsessionKeyProperty,\n\tcontextWindowLengthProperty,\n\texpressionSessionKeyProperty,\n} from '../descriptions';\n\nclass MemoryChatBufferSingleton {\n\tprivate static instance: MemoryChatBufferSingleton;\n\n\tprivate memoryBuffer: Map<\n\t\tstring,\n\t\t{ buffer: BufferWindowMemory; created: Date; last_accessed: Date }\n\t>;\n\n\tprivate constructor() {\n\t\tthis.memoryBuffer = new Map();\n\t}\n\n\tstatic getInstance(): MemoryChatBufferSingleton {\n\t\tif (!MemoryChatBufferSingleton.instance) {\n\t\t\tMemoryChatBufferSingleton.instance = new MemoryChatBufferSingleton();\n\t\t}\n\t\treturn MemoryChatBufferSingleton.instance;\n\t}\n\n\tasync getMemory(\n\t\tsessionKey: string,\n\t\tmemoryParams: BufferWindowMemoryInput,\n\t): Promise<BufferWindowMemory> {\n\t\tawait this.cleanupStaleBuffers();\n\n\t\tlet memoryInstance = this.memoryBuffer.get(sessionKey);\n\t\tif (memoryInstance) {\n\t\t\tmemoryInstance.last_accessed = new Date();\n\t\t} else {\n\t\t\tconst newMemory = new BufferWindowMemory(memoryParams);\n\n\t\t\tmemoryInstance = {\n\t\t\t\tbuffer: newMemory,\n\t\t\t\tcreated: new Date(),\n\t\t\t\tlast_accessed: new Date(),\n\t\t\t};\n\t\t\tthis.memoryBuffer.set(sessionKey, memoryInstance);\n\t\t}\n\t\treturn memoryInstance.buffer;\n\t}\n\n\tprivate async cleanupStaleBuffers(): Promise<void> {\n\t\tconst oneHourAgo = new Date(Date.now() - 60 * 60 * 1000);\n\n\t\tfor (const [key, memoryInstance] of this.memoryBuffer.entries()) {\n\t\t\tif (memoryInstance.last_accessed < oneHourAgo) {\n\t\t\t\tawait this.memoryBuffer.get(key)?.buffer.clear();\n\t\t\t\tthis.memoryBuffer.delete(key);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class MemoryBufferWindow implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Simple Memory',\n\t\tname: 'memoryBufferWindow',\n\t\ticon: 'fa:database',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Stores in n8n memory, so no credentials required',\n\t\tdefaults: {\n\t\t\tname: 'Simple Memory',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Memory'],\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.memorybufferwindow/',\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.AiMemory],\n\t\toutputNames: ['Memory'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Session Key',\n\t\t\t\tname: 'sessionKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'chat_history',\n\t\t\t\tdescription: 'The key to use to store the memory in the workflow data',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Session ID',\n\t\t\t\tname: 'sessionKey',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '={{ $json.sessionId }}',\n\t\t\t\tdescription: 'The key to use to store the memory',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1.1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...sessionIdOption,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.2 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpressionSessionKeyProperty(1.3),\n\t\t\tsessionKeyProperty,\n\t\t\tcontextWindowLengthProperty,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst contextWindowLength = this.getNodeParameter('contextWindowLength', itemIndex) as number;\n\t\tconst workflowId = this.getWorkflow().id;\n\t\tconst memoryInstance = MemoryChatBufferSingleton.getInstance();\n\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tlet sessionId;\n\n\t\tif (nodeVersion >= 1.2) {\n\t\t\tsessionId = getSessionId(this, itemIndex);\n\t\t} else {\n\t\t\tsessionId = this.getNodeParameter('sessionKey', itemIndex) as string;\n\t\t}\n\n\t\tconst memory = await memoryInstance.getMemory(`${workflowId}__${sessionId}`, {\n\t\t\tk: contextWindowLength,\n\t\t\tinputKey: 'input',\n\t\t\tmemoryKey: 'chat_history',\n\t\t\toutputKey: 'output',\n\t\t\treturnMessages: true,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(memory, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAAmC;AACnC,0BAMO;AAEP,qBAA6B;AAC7B,wBAA2B;AAC3B,0BAA6C;AAE7C,0BAKO;AAEP,MAAM,0BAA0B;AAAA,EAQvB,cAAc;AACrB,SAAK,eAAe,oBAAI,IAAI;AAAA,EAC7B;AAAA,EAEA,OAAO,cAAyC;AAC/C,QAAI,CAAC,0BAA0B,UAAU;AACxC,gCAA0B,WAAW,IAAI,0BAA0B;AAAA,IACpE;AACA,WAAO,0BAA0B;AAAA,EAClC;AAAA,EAEA,MAAM,UACL,YACA,cAC8B;AAC9B,UAAM,KAAK,oBAAoB;AAE/B,QAAI,iBAAiB,KAAK,aAAa,IAAI,UAAU;AACrD,QAAI,gBAAgB;AACnB,qBAAe,gBAAgB,oBAAI,KAAK;AAAA,IACzC,OAAO;AACN,YAAM,YAAY,IAAI,iCAAmB,YAAY;AAErD,uBAAiB;AAAA,QAChB,QAAQ;AAAA,QACR,SAAS,oBAAI,KAAK;AAAA,QAClB,eAAe,oBAAI,KAAK;AAAA,MACzB;AACA,WAAK,aAAa,IAAI,YAAY,cAAc;AAAA,IACjD;AACA,WAAO,eAAe;AAAA,EACvB;AAAA,EAEA,MAAc,sBAAqC;AAClD,UAAM,aAAa,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,GAAI;AAEvD,eAAW,CAAC,KAAK,cAAc,KAAK,KA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GAAG;AAAA,UACH,gBAAgB;AAAA,YACf,MAAM;AAAA,cACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,YACpC;AAAA,UACD;AAAA,QACD;AAAA,YACA,kDAA6B,GAAG;AAAA,QAChC;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,sBAAsB,KAAK,iBAAiB,uBAAuB,SAAS;AAClF,UAAM,aAAa,KAAK,YAAY,EAAE;AACtC,UAAM,iBAAiB,0BAA0B,YAAY;AAE7D,UAAM,cAAc,KAAK,QAAQ,EAAE;AAEnC,QAAI;AAEJ,QAAI,eAAe,KAAK;AACvB,sBAAY,6BAAa,MAAM,SAAS;AAAA,IACzC,OAAO;AACN,kBAAY,KAAK,iBAAiB,cAAc,SAAS;AAAA,IAC1D;AAEA,UAAM,SAAS,MAAM,eAAe,UAAU,GAAG,UAAU,KAAK,SAAS,IAAI;AAAA,MAC5E,GAAG;AAAA,MACH,UAAU;AAAA,MACV,WAAW;AAAA,MACX,WAAW;AAAA,MACX,gBAAgB;AAAA,IACjB,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,QAAQ,IAAI;AAAA,IAClC;AAAA,EACD;AACD;","names":[]}
@@ -115,3 +115,4 @@ class MemoryChatRetriever {
115
115
  0 && (module.exports = {
116
116
  MemoryChatRetriever
117
117
  });
118
+ //# sourceMappingURL=MemoryChatRetriever.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BaseChatMemory } from '@langchain/community/memory/chat_memory';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport {\n\tNodeConnectionTypes,\n\ttype IDataObject,\n\ttype IExecuteFunctions,\n\ttype INodeExecutionData,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n} from 'n8n-workflow';\n\nfunction simplifyMessages(messages: BaseMessage[]) {\n\tconst chunkedMessages = [];\n\tfor (let i = 0; i < messages.length; i += 2) {\n\t\tchunkedMessages.push([messages[i], messages[i + 1]]);\n\t}\n\n\tconst transformedMessages = chunkedMessages.map((exchange) => {\n\t\tconst simplified = {\n\t\t\t[exchange[0]._getType()]: exchange[0].content,\n\t\t};\n\n\t\tif (exchange[1]) {\n\t\t\tsimplified[exchange[1]._getType()] = exchange[1].content;\n\t\t}\n\n\t\treturn {\n\t\t\tjson: simplified,\n\t\t};\n\t});\n\treturn transformedMessages;\n}\n\n// This node is deprecated. Use MemoryManager instead.\nexport class MemoryChatRetriever implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Chat Messages Retriever',\n\t\tname: 'memoryChatRetriever',\n\t\ticon: 'fa:database',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\thidden: true,\n\t\tversion: 1,\n\t\tdescription: 'Retrieve chat messages from memory and use them in the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Chat Messages Retriever',\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/sub-nodes/n8n-nodes-langchain.memorymanager/',\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\tNodeConnectionTypes.Main,\n\t\t\t{\n\t\t\t\tdisplayName: 'Memory',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiMemory,\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.Main],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: \"This node is deprecated. Use 'Chat Memory Manager' node instead.\",\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t\tname: 'deprecatedNotice',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Simplify Output',\n\t\t\t\tname: 'simplifyOutput',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Whether to simplify the output to only include the sender and the text',\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tthis.logger.debug('Executing Chat Memory Retriever');\n\n\t\tconst memory = (await this.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as\n\t\t\t| BaseChatMemory\n\t\t\t| undefined;\n\t\tconst simplifyOutput = this.getNodeParameter('simplifyOutput', 0) as boolean;\n\n\t\tconst messages = await memory?.chatHistory.getMessages();\n\n\t\tif (simplifyOutput && messages) {\n\t\t\treturn [simplifyMessages(messages)];\n\t\t}\n\n\t\tconst serializedMessages =\n\t\t\tmessages?.map((message) => {\n\t\t\t\tconst serializedMessage = message.toJSON();\n\t\t\t\treturn { json: serializedMessage as unknown as IDataObject };\n\t\t\t}) ?? [];\n\n\t\treturn [serializedMessages];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAOO;AAEP,SAAS,iBAAiB,UAAyB;AAClD,QAAM,kBAAkB,CAAC;AACzB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK,GAAG;AAC5C,oBAAgB,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,CAAC;AAAA,EACpD;AAEA,QAAM,sBAAsB,gBAAgB,IAAI,CAAC,aAAa;AAC7D,UAAM,aAAa;AAAA,MAClB,CAAC,SAAS,CAAC,E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wCAAoB,UAAU,CAAC;AAGjF,UAAM,iBAAiB,KAAK,iBAAiB,kBAAkB,CAAC;AAEhE,UAAM,WAAW,MAAM,QAAQ,YAAY,YAAY;AAEvD,QAAI,kBAAkB,UAAU;AAC/B,aAAO,CAAC,iBAAiB,QAAQ,CAAC;AAAA,IACnC;AAEA,UAAM,qBACL,UAAU,IAAI,CAAC,YAAY;AAC1B,YAAM,oBAAoB,QAAQ,OAAO;AACzC,aAAO,EAAE,MAAM,kBAA4C;AAAA,IAC5D,CAAC,KAAK,CAAC;AAER,WAAO,CAAC,kBAAkB;AAAA,EAC3B;AACD;","names":[]}
@@ -381,3 +381,4 @@ class MemoryManager {
381
381
  0 && (module.exports = {
382
382
  MemoryManager
383
383
  });
384
+ //# sourceMappingURL=MemoryManager.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/memory/MemoryManager/MemoryManager.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BaseChatMemory } from '@langchain/community/memory/chat_memory';\nimport { AIMessage, SystemMessage, HumanMessage, type BaseMessage } from '@langchain/core/messages';\nimport { NodeConnectionTypes } from 'n8n-workflow';\nimport type {\n\tIDataObject,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\n\ntype MessageRole = 'ai' | 'system' | 'user';\ninterface MessageRecord {\n\ttype: MessageRole;\n\tmessage: string;\n\thideFromUI: boolean;\n}\n\nfunction simplifyMessages(messages: BaseMessage[]) {\n\tconst chunkedMessages = [];\n\tfor (let i = 0; i < messages.length; i += 2) {\n\t\tchunkedMessages.push([messages[i], messages[i + 1]]);\n\t}\n\n\tconst transformedMessages = chunkedMessages.map((exchange) => {\n\t\tconst simplified = {\n\t\t\t[exchange[0]._getType()]: exchange[0].content,\n\t\t};\n\n\t\tif (exchange[1]) {\n\t\t\tsimplified[exchange[1]._getType()] = exchange[1].content;\n\t\t}\n\n\t\treturn simplified;\n\t});\n\treturn transformedMessages;\n}\n\nconst prepareOutputSetup = (ctx: IExecuteFunctions, version: number, memory: BaseChatMemory) => {\n\tif (version === 1) {\n\t\t//legacy behavior of insert and delete for version 1\n\t\treturn async (i: number) => {\n\t\t\tconst messages = await memory.chatHistory.getMessages();\n\n\t\t\tconst serializedMessages = messages?.map((message) => message.toJSON()) ?? [];\n\n\t\t\tconst executionData = ctx.helpers.constructExecutionMetaData(\n\t\t\t\tctx.helpers.returnJsonArray(serializedMessages as unknown as IDataObject[]),\n\t\t\t\t{ itemData: { item: i } },\n\t\t\t);\n\n\t\t\treturn executionData;\n\t\t};\n\t}\n\treturn async (i: number) => {\n\t\treturn [\n\t\t\t{\n\t\t\t\tjson: { success: true },\n\t\t\t\tpairedItem: { item: i },\n\t\t\t},\n\t\t];\n\t};\n};\n\nexport class MemoryManager implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Chat Memory Manager',\n\t\tname: 'memoryManager',\n\t\ticon: 'fa:database',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1],\n\t\tdescription: 'Manage chat messages memory and use it in the workflow',\n\t\tdefaults: {\n\t\t\tname: 'Chat Memory Manager',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Miscellaneous', '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/sub-nodes/n8n-nodes-langchain.memorymanager/',\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: '',\n\t\t\t\ttype: NodeConnectionTypes.Main,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Memory',\n\t\t\t\ttype: NodeConnectionTypes.AiMemory,\n\t\t\t\trequired: true,\n\t\t\t\tmaxConnections: 1,\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: [\n\t\t\t{\n\t\t\t\tdisplayName: '',\n\t\t\t\ttype: NodeConnectionTypes.Main,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Operation Mode',\n\t\t\t\tname: 'mode',\n\t\t\t\ttype: 'options',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: 'load',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Get Many Messages',\n\t\t\t\t\t\tdescription: 'Retrieve chat messages from connected memory',\n\t\t\t\t\t\tvalue: 'load',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Insert Messages',\n\t\t\t\t\t\tdescription: 'Insert chat messages into connected memory',\n\t\t\t\t\t\tvalue: 'insert',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Delete Messages',\n\t\t\t\t\t\tdescription: 'Delete chat messages from connected memory',\n\t\t\t\t\t\tvalue: 'delete',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Insert Mode',\n\t\t\t\tname: 'insertMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'Choose how new messages are inserted into the memory',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: 'insert',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Insert Messages',\n\t\t\t\t\t\tvalue: 'insert',\n\t\t\t\t\t\tdescription: 'Add messages alongside existing ones',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Override All Messages',\n\t\t\t\t\t\tvalue: 'override',\n\t\t\t\t\t\tdescription: 'Replace the current memory with new messages',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Delete Mode',\n\t\t\t\tname: 'deleteMode',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription: 'How messages are deleted from memory',\n\t\t\t\tnoDataExpression: true,\n\t\t\t\tdefault: 'lastN',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Last N',\n\t\t\t\t\t\tvalue: 'lastN',\n\t\t\t\t\t\tdescription: 'Delete the last N messages',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'All Messages',\n\t\t\t\t\t\tvalue: 'all',\n\t\t\t\t\t\tdescription: 'Clear all messages from memory',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['delete'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chat Messages',\n\t\t\t\tname: 'messages',\n\t\t\t\tdescription: 'Chat messages to insert into memory',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\tplaceholder: 'Add message',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'messageValues',\n\t\t\t\t\t\tdisplayName: 'Message',\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 Name or ID',\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: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'AI',\n\t\t\t\t\t\t\t\t\t\tvalue: 'ai',\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: 'System',\n\t\t\t\t\t\t\t\t\t\tvalue: 'system',\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: 'User',\n\t\t\t\t\t\t\t\t\t\tvalue: 'user',\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: 'system',\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: 'Message',\n\t\t\t\t\t\t\t\tname: 'message',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: '',\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: 'Hide Message in Chat',\n\t\t\t\t\t\t\t\tname: 'hideFromUI',\n\t\t\t\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t\t\t\tdescription: 'Whether to hide the message from the chat UI',\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\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Messages Count',\n\t\t\t\tname: 'lastMessagesCount',\n\t\t\t\ttype: 'number',\n\t\t\t\tdescription: 'The amount of last messages to delete',\n\t\t\t\tdefault: 2,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['delete'],\n\t\t\t\t\t\tdeleteMode: ['lastN'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Simplify Output',\n\t\t\t\tname: 'simplifyOutput',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdescription: 'Whether to simplify the output to only include the sender and the text',\n\t\t\t\tdefault: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['load'],\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\tplaceholder: 'Add Option',\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: 'Group Messages',\n\t\t\t\t\t\tname: 'groupMessages',\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 group messages into a single item or return each message as a separate item',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tmode: ['load'],\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 nodeVersion = this.getNode().typeVersion;\n\t\tconst items = this.getInputData();\n\t\tconst mode = this.getNodeParameter('mode', 0, 'load') as 'load' | 'insert' | 'delete';\n\t\tconst memory = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiMemory,\n\t\t\t0,\n\t\t)) as BaseChatMemory;\n\n\t\tconst prepareOutput = prepareOutputSetup(this, nodeVersion, memory);\n\n\t\tconst returnData: INodeExecutionData[] = [];\n\n\t\tfor (let i = 0; i < items.length; i++) {\n\t\t\tconst messages = await memory.chatHistory.getMessages();\n\n\t\t\tif (mode === 'delete') {\n\t\t\t\tconst deleteMode = this.getNodeParameter('deleteMode', i) as 'lastN' | 'all';\n\n\t\t\t\tif (deleteMode === 'lastN') {\n\t\t\t\t\tconst lastMessagesCount = this.getNodeParameter('lastMessagesCount', i) as number;\n\t\t\t\t\tif (messages.length >= lastMessagesCount) {\n\t\t\t\t\t\tconst newMessages = messages.slice(0, messages.length - lastMessagesCount);\n\n\t\t\t\t\t\tawait memory.chatHistory.clear();\n\t\t\t\t\t\tfor (const message of newMessages) {\n\t\t\t\t\t\t\tawait memory.chatHistory.addMessage(message);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tawait memory.chatHistory.clear();\n\t\t\t\t}\n\n\t\t\t\treturnData.push(...(await prepareOutput(i)));\n\t\t\t}\n\n\t\t\tif (mode === 'insert') {\n\t\t\t\tconst insertMode = this.getNodeParameter('insertMode', i) as 'insert' | 'override';\n\t\t\t\tconst messagesToInsert = this.getNodeParameter(\n\t\t\t\t\t'messages.messageValues',\n\t\t\t\t\ti,\n\t\t\t\t\t[],\n\t\t\t\t) as MessageRecord[];\n\n\t\t\t\tconst templateMapper = {\n\t\t\t\t\tai: AIMessage,\n\t\t\t\t\tsystem: SystemMessage,\n\t\t\t\t\tuser: HumanMessage,\n\t\t\t\t};\n\n\t\t\t\tif (insertMode === 'override') {\n\t\t\t\t\tawait memory.chatHistory.clear();\n\t\t\t\t}\n\n\t\t\t\tfor (const message of messagesToInsert) {\n\t\t\t\t\tconst MessageClass = new templateMapper[message.type](message.message);\n\n\t\t\t\t\tif (message.hideFromUI) {\n\t\t\t\t\t\tMessageClass.additional_kwargs.hideFromUI = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tawait memory.chatHistory.addMessage(MessageClass);\n\t\t\t\t}\n\n\t\t\t\treturnData.push(...(await prepareOutput(i)));\n\t\t\t}\n\n\t\t\tif (mode === 'load') {\n\t\t\t\tconst simplifyOutput = this.getNodeParameter('simplifyOutput', i, false) as boolean;\n\t\t\t\tconst options = this.getNodeParameter('options', i);\n\n\t\t\t\t//Load mode, legacy behavior for version 1, buggy - outputs only for single input item\n\t\t\t\tif (simplifyOutput && messages.length && nodeVersion === 1) {\n\t\t\t\t\tconst groupMessages = options.groupMessages as boolean;\n\t\t\t\t\tconst output = simplifyMessages(messages);\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\tthis.helpers.constructExecutionMetaData(\n\t\t\t\t\t\t\tthis.helpers.returnJsonArray(\n\t\t\t\t\t\t\t\tgroupMessages ? [{ messages: output, messagesCount: output.length }] : output,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{ itemData: { item: i } },\n\t\t\t\t\t\t),\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\tlet groupMessages = true;\n\t\t\t\t//disable grouping if explicitly set to false\n\t\t\t\tif (options.groupMessages === false) {\n\t\t\t\t\tgroupMessages = false;\n\t\t\t\t}\n\t\t\t\t//disable grouping if not set and node version is 1 (legacy behavior)\n\t\t\t\tif (options.groupMessages === undefined && nodeVersion === 1) {\n\t\t\t\t\tgroupMessages = false;\n\t\t\t\t}\n\n\t\t\t\tlet output: IDataObject[] =\n\t\t\t\t\t(simplifyOutput\n\t\t\t\t\t\t? simplifyMessages(messages)\n\t\t\t\t\t\t: (messages?.map((message) => message.toJSON()) as unknown as IDataObject[])) ?? [];\n\n\t\t\t\tif (groupMessages) {\n\t\t\t\t\toutput = [{ messages: output, messagesCount: output.length }];\n\t\t\t\t}\n\n\t\t\t\tconst executionData = this.helpers.constructExecutionMetaData(\n\t\t\t\t\tthis.helpers.returnJsonArray(output),\n\t\t\t\t\t{ itemData: { item: i } },\n\t\t\t\t);\n\n\t\t\t\treturnData.push(...executionData);\n\t\t\t}\n\t\t}\n\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAAyE;AACzE,0BAAoC;AAgBpC,SAAS,iBAAiB,UAAyB;AAClD,Q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