@n8n/n8n-nodes-langchain 1.100.1 → 1.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/credentials/WeaviateApi.credentials.js +164 -0
  2. package/dist/credentials/WeaviateApi.credentials.js.map +1 -0
  3. package/dist/known/credentials.json +7 -0
  4. package/dist/known/nodes.json +4 -0
  5. package/dist/nodes/agents/Agent/Agent.node.js +5 -2
  6. package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
  7. package/dist/nodes/agents/Agent/V1/AgentV1.node.js +1 -4
  8. package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
  9. package/dist/nodes/agents/Agent/V2/AgentV2.node.js +23 -6
  10. package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
  11. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +0 -1
  12. package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -1
  13. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +29 -1
  14. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -1
  15. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +83 -1
  16. package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -1
  17. package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -1
  18. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +0 -1
  19. package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
  20. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +0 -1
  21. package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
  22. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +0 -1
  23. package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -1
  24. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +0 -1
  25. package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -1
  26. package/dist/nodes/code/Code.node.js.map +1 -1
  27. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +0 -2
  28. package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -1
  29. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +0 -2
  30. package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -1
  31. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +0 -2
  32. package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -1
  33. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +0 -2
  34. package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -1
  35. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +0 -2
  36. package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -1
  37. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +0 -2
  38. package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -1
  39. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +0 -2
  40. package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -1
  41. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +0 -2
  42. package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -1
  43. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js +0 -2
  44. package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js.map +1 -1
  45. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +0 -2
  46. package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -1
  47. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +0 -2
  48. package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -1
  49. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +0 -2
  50. package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -1
  51. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +0 -2
  52. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
  53. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +4 -5
  54. package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
  55. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +0 -3
  56. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
  57. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +6 -6
  58. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
  59. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +3 -1
  60. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
  61. package/dist/nodes/llms/LMCohere/LmCohere.node.js +0 -3
  62. package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -1
  63. package/dist/nodes/llms/LMOllama/LmOllama.node.js +0 -3
  64. package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
  65. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +3 -4
  66. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
  67. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +0 -3
  68. package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -1
  69. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +1 -5
  70. package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
  71. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +3 -4
  72. package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
  73. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +3 -4
  74. package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -1
  75. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +0 -3
  76. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -1
  77. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +0 -3
  78. package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -1
  79. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +1 -4
  80. package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -1
  81. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +0 -3
  82. package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
  83. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +3 -3
  84. package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -1
  85. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +3 -4
  86. package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -1
  87. package/dist/nodes/llms/N8nLlmTracing.js.map +1 -1
  88. package/dist/nodes/llms/N8nNonEstimatingTracing.js.map +1 -1
  89. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +1 -1
  90. package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +1 -1
  91. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +0 -2
  92. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
  93. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +0 -2
  94. package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -1
  95. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +0 -2
  96. package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -1
  97. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +0 -2
  98. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
  99. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +0 -2
  100. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -1
  101. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +0 -2
  102. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
  103. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +0 -2
  104. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
  105. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +0 -2
  106. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
  107. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +0 -2
  108. package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -1
  109. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +0 -2
  110. package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -1
  111. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +0 -1
  112. package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
  113. package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js.map +1 -1
  114. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +0 -1
  115. package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
  116. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +0 -1
  117. package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
  118. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +0 -2
  119. package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
  120. package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
  121. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +0 -2
  122. package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -1
  123. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +0 -2
  124. package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -1
  125. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +0 -2
  126. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -1
  127. package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js.map +1 -1
  128. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +0 -2
  129. package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -1
  130. package/dist/nodes/tools/ToolCode/ToolCode.node.js +0 -2
  131. package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
  132. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +0 -2
  133. package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -1
  134. package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -1
  135. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +0 -2
  136. package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
  137. package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -1
  138. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +0 -2
  139. package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
  140. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +0 -2
  141. package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -1
  142. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +0 -2
  143. package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -1
  144. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +0 -2
  145. package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -1
  146. package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -1
  147. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +215 -153
  148. package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
  149. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +1 -1
  150. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -1
  151. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +0 -1
  152. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -1
  153. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +0 -1
  154. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -1
  155. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +2 -2
  156. package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -1
  157. package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
  158. package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -1
  159. package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js +242 -0
  160. package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js.map +1 -0
  161. package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js +127 -0
  162. package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js.map +1 -0
  163. package/dist/nodes/vector_store/VectorStoreWeaviate/weaviate.svg +2 -0
  164. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +0 -1
  165. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -1
  166. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +15 -2
  167. package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -1
  168. package/dist/nodes/vector_store/shared/descriptions.js +26 -2
  169. package/dist/nodes/vector_store/shared/descriptions.js.map +1 -1
  170. package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js +0 -1
  171. package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +1 -1
  172. package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +1 -1
  173. package/dist/types/credentials.json +1 -0
  174. package/dist/types/nodes.json +4 -3
  175. package/dist/utils/httpProxyAgent.js +20 -6
  176. package/dist/utils/httpProxyAgent.js.map +1 -1
  177. package/dist/utils/logWrapper.js.map +1 -1
  178. package/package.json +21 -15
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { N8nItemListOutputParser } from '@utils/output_parsers/N8nItemListOutputParser';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class OutputParserItemList implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Item List Output Parser',\n\t\tname: 'outputParserItemList',\n\t\ticon: 'fa:bars',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Return the results as separate items',\n\t\tdefaults: {\n\t\t\tname: 'Item List Output Parser',\n\t\t},\n\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Output Parsers'],\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.outputparseritemlist/',\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.AiOutputParser],\n\t\toutputNames: ['Output Parser'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Number Of Items',\n\t\t\t\t\t\tname: 'numberOfItems',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Defines how many items should be returned maximally. If set to -1, there is no limit.',\n\t\t\t\t\t},\n\t\t\t\t\t// For that to be easily possible the metadata would have to be returned and be able to be read.\n\t\t\t\t\t// Would also be possible with a wrapper but that would be even more hacky and the output types\n\t\t\t\t\t// would not be correct anymore.\n\t\t\t\t\t// {\n\t\t\t\t\t// \tdisplayName: 'Parse Output',\n\t\t\t\t\t// \tname: 'parseOutput',\n\t\t\t\t\t// \ttype: 'boolean',\n\t\t\t\t\t// \tdefault: true,\n\t\t\t\t\t// \tdescription: 'Whether the output should be automatically be parsed or left RAW',\n\t\t\t\t\t// },\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Separator',\n\t\t\t\t\t\tname: 'separator',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '\\\\n',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Defines the separator that should be used to split the results into separate items. Defaults to a new line but can be changed depending on the data that should be returned.',\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 options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tnumberOfItems?: number;\n\t\t\tseparator?: string;\n\t\t};\n\n\t\tconst parser = new N8nItemListOutputParser(options);\n\n\t\treturn {\n\t\t\tresponse: parser,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAMO;AAEP,qCAAwC;AACxC,0BAA6C;AAEtC,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;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../nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts"],"sourcesContent":["import {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { N8nItemListOutputParser } from '@utils/output_parsers/N8nItemListOutputParser';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class OutputParserItemList implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Item List Output Parser',\n\t\tname: 'outputParserItemList',\n\t\ticon: 'fa:bars',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Return the results as separate items',\n\t\tdefaults: {\n\t\t\tname: 'Item List Output Parser',\n\t\t},\n\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Output Parsers'],\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.outputparseritemlist/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiOutputParser],\n\t\toutputNames: ['Output Parser'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Options',\n\t\t\t\tname: 'options',\n\t\t\t\ttype: 'collection',\n\t\t\t\tplaceholder: 'Add Option',\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Number Of Items',\n\t\t\t\t\t\tname: 'numberOfItems',\n\t\t\t\t\t\ttype: 'number',\n\t\t\t\t\t\tdefault: -1,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Defines how many items should be returned maximally. If set to -1, there is no limit.',\n\t\t\t\t\t},\n\t\t\t\t\t// For that to be easily possible the metadata would have to be returned and be able to be read.\n\t\t\t\t\t// Would also be possible with a wrapper but that would be even more hacky and the output types\n\t\t\t\t\t// would not be correct anymore.\n\t\t\t\t\t// {\n\t\t\t\t\t// \tdisplayName: 'Parse Output',\n\t\t\t\t\t// \tname: 'parseOutput',\n\t\t\t\t\t// \ttype: 'boolean',\n\t\t\t\t\t// \tdefault: true,\n\t\t\t\t\t// \tdescription: 'Whether the output should be automatically be parsed or left RAW',\n\t\t\t\t\t// },\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Separator',\n\t\t\t\t\t\tname: 'separator',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '\\\\n',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Defines the separator that should be used to split the results into separate items. Defaults to a new line but can be changed depending on the data that should be returned.',\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 options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tnumberOfItems?: number;\n\t\t\tseparator?: string;\n\t\t};\n\n\t\tconst parser = new N8nItemListOutputParser(options);\n\n\t\treturn {\n\t\t\tresponse: parser,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMO;AAEP,qCAAwC;AACxC,0BAA6C;AAEtC,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MAEA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,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,UACb,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aACC;AAAA,YACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAWA;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aACC;AAAA,YACF;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAK9D,UAAM,SAAS,IAAI,uDAAwB,OAAO;AAElD,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -67,7 +67,6 @@ class OutputParserStructured {
67
67
  return [];
68
68
  })($parameter)
69
69
  }}`,
70
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
71
70
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiOutputParser],
72
71
  outputNames: ["Output Parser"],
73
72
  properties: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { PromptTemplate } from '@langchain/core/prompts';\nimport type { JSONSchema7 } from 'json-schema';\nimport {\n\tjsonParse,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n\tNodeOperationError,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\nimport type { z } from 'zod';\n\nimport {\n\tbuildJsonSchemaExampleNotice,\n\tinputSchemaField,\n\tjsonSchemaExampleField,\n\tschemaTypeField,\n} from '@utils/descriptions';\nimport {\n\tN8nOutputFixingParser,\n\tN8nStructuredOutputParser,\n} from '@utils/output_parsers/N8nOutputParser';\nimport { convertJsonSchemaToZod, generateSchemaFromExample } from '@utils/schemaParsing';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { NAIVE_FIX_PROMPT } from './prompt';\n\nexport class OutputParserStructured implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Structured Output Parser',\n\t\tname: 'outputParserStructured',\n\t\ticon: 'fa:code',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdefaultVersion: 1.3,\n\t\tdescription: 'Return data in a defined JSON format',\n\t\tdefaults: {\n\t\t\tname: 'Structured Output Parser',\n\t\t},\n\n\t\tcodex: {\n\t\t\talias: ['json', 'zod'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Output Parsers'],\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.outputparserstructured/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tif (parameters?.autoFix) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{ displayName: 'Model', maxConnections: 1, type: \"${NodeConnectionTypes.AiLanguageModel}\", required: true }\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiOutputParser],\n\t\toutputNames: ['Output Parser'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{ ...schemaTypeField, displayOptions: { show: { '@version': [{ _cnd: { gte: 1.2 } }] } } },\n\t\t\t{\n\t\t\t\t...jsonSchemaExampleField,\n\t\t\t\tdefault: `{\n\t\"state\": \"California\",\n\t\"cities\": [\"Los Angeles\", \"San Francisco\", \"San Diego\"]\n}`,\n\t\t\t},\n\t\t\tbuildJsonSchemaExampleNotice({\n\t\t\t\tshowExtraProps: {\n\t\t\t\t\t'@version': [{ _cnd: { gte: 1.3 } }],\n\t\t\t\t},\n\t\t\t}),\n\t\t\t{\n\t\t\t\t...inputSchemaField,\n\t\t\t\tdefault: `{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"state\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"cities\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JSON Schema',\n\t\t\t\tname: 'jsonSchema',\n\t\t\t\ttype: 'json',\n\t\t\t\tdescription: 'JSON Schema to structure and validate the output against',\n\t\t\t\tdefault: `{\n \"type\": \"object\",\n \"properties\": {\n \"state\": {\n \"type\": \"string\"\n },\n \"cities\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n}`,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { lte: 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\tdisplayName: 'Auto-Fix Format',\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to automatically fix the output when it is not in the correct format. Will cause another LLM call.',\n\t\t\t\tname: 'autoFix',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Customize Retry Prompt',\n\t\t\t\tname: 'customizeRetryPrompt',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tautoFix: [true],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to customize the prompt used for retrying the output parsing. If disabled, a default prompt will be used.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Custom Prompt',\n\t\t\t\tname: 'prompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tautoFix: [true],\n\t\t\t\t\t\tcustomizeRetryPrompt: [true],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: NAIVE_FIX_PROMPT,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\thint: 'Should include \"{error}\", \"{instructions}\", and \"{completion}\" placeholders',\n\t\t\t\tdescription:\n\t\t\t\t\t'Prompt template used for fixing the output. Uses placeholders: \"{instructions}\" for parsing rules, \"{completion}\" for the failed attempt, and \"{error}\" for the validation error message.',\n\t\t\t},\n\t\t],\n\t\thints: [\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t'Fields that use $refs might have the wrong type, since this syntax is not currently supported',\n\t\t\t\ttype: 'warning',\n\t\t\t\tlocation: 'outputPane',\n\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\tdisplayCondition:\n\t\t\t\t\t'={{ $parameter[\"schemaType\"] === \"manual\" && $parameter[\"inputSchema\"]?.includes(\"$ref\") }}',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst schemaType = this.getNodeParameter('schemaType', itemIndex, '') as 'fromJson' | 'manual';\n\t\t// We initialize these even though one of them will always be empty\n\t\t// it makes it easer to navigate the ternary operator\n\t\tconst jsonExample = this.getNodeParameter('jsonSchemaExample', itemIndex, '') as string;\n\n\t\tlet inputSchema: string;\n\n\t\t// Enforce all fields to be required in the generated schema if the node version is 1.3 or higher\n\t\tconst jsonExampleAllFieldsRequired = this.getNode().typeVersion >= 1.3;\n\n\t\tif (this.getNode().typeVersion <= 1.1) {\n\t\t\tinputSchema = this.getNodeParameter('jsonSchema', itemIndex, '') as string;\n\t\t} else {\n\t\t\tinputSchema = this.getNodeParameter('inputSchema', itemIndex, '') as string;\n\t\t}\n\n\t\tconst jsonSchema =\n\t\t\tschemaType === 'fromJson'\n\t\t\t\t? generateSchemaFromExample(jsonExample, jsonExampleAllFieldsRequired)\n\t\t\t\t: jsonParse<JSONSchema7>(inputSchema);\n\n\t\tconst zodSchema = convertJsonSchemaToZod<z.ZodSchema<object>>(jsonSchema);\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tconst autoFix = this.getNodeParameter('autoFix', itemIndex, false) as boolean;\n\n\t\tlet outputParser;\n\t\ttry {\n\t\t\toutputParser = await N8nStructuredOutputParser.fromZodJsonSchema(\n\t\t\t\tzodSchema,\n\t\t\t\tnodeVersion,\n\t\t\t\tthis,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Error during parsing of JSON Schema. Please check the schema and try again.',\n\t\t\t);\n\t\t}\n\n\t\tif (!autoFix) {\n\t\t\treturn {\n\t\t\t\tresponse: outputParser,\n\t\t\t};\n\t\t}\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst prompt = this.getNodeParameter('prompt', itemIndex, NAIVE_FIX_PROMPT) as string;\n\n\t\tif (prompt.length === 0 || !prompt.includes('{error}')) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Auto-fixing parser prompt has to contain {error} placeholder',\n\t\t\t);\n\t\t}\n\t\tconst parser = new N8nOutputFixingParser(\n\t\t\tthis,\n\t\t\tmodel,\n\t\t\toutputParser,\n\t\t\tPromptTemplate.fromTemplate(prompt),\n\t\t);\n\n\t\treturn {\n\t\t\tresponse: parser,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAA+B;AAE/B,0BAQO;AAGP,0BAKO;AACP,6BAGO;AACP,2BAAkE;AAClE,0BAA6C;AAE7C,oBAAiC;AAE1B,MAAM,uBAA4C;AAAA,EAAlD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,GAAG,KAAK,KAAK,GAAG;AAAA,MAC1B,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MAEA,OAAO;AAAA,QACN,OAAO,CAAC,QAAQ,KAAK;AAAA,QACrB,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAA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iB,WAAW,WAAW,KAAK;AAEjE,QAAI;AACJ,QAAI;AACH,qBAAe,MAAM,iDAA0B;AAAA,QAC9C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD,SAAS,OAAO;AACf,YAAM,IAAI;AAAA,QACT,KAAK,QAAQ;AAAA,QACb;AAAA,MACD;AAAA,IACD;AAEA,QAAI,CAAC,SAAS;AACb,aAAO;AAAA,QACN,UAAU;AAAA,MACX;AAAA,IACD;AAEA,UAAM,QAAS,MAAM,KAAK;AAAA,MACzB,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,SAAS,KAAK,iBAAiB,UAAU,WAAW,8BAAgB;AAE1E,QAAI,OAAO,WAAW,KAAK,CAAC,OAAO,SAAS,SAAS,GAAG;AACvD,YAAM,IAAI;AAAA,QACT,KAAK,QAAQ;AAAA,QACb;AAAA,MACD;AAAA,IACD;AACA,UAAM,SAAS,IAAI;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,8BAAe,aAAa,MAAM;AAAA,IACnC;AAEA,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { PromptTemplate } from '@langchain/core/prompts';\nimport type { JSONSchema7 } from 'json-schema';\nimport {\n\tjsonParse,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n\tNodeOperationError,\n\tNodeConnectionTypes,\n} from 'n8n-workflow';\nimport type { z } from 'zod';\n\nimport {\n\tbuildJsonSchemaExampleNotice,\n\tinputSchemaField,\n\tjsonSchemaExampleField,\n\tschemaTypeField,\n} from '@utils/descriptions';\nimport {\n\tN8nOutputFixingParser,\n\tN8nStructuredOutputParser,\n} from '@utils/output_parsers/N8nOutputParser';\nimport { convertJsonSchemaToZod, generateSchemaFromExample } from '@utils/schemaParsing';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { NAIVE_FIX_PROMPT } from './prompt';\n\nexport class OutputParserStructured implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Structured Output Parser',\n\t\tname: 'outputParserStructured',\n\t\ticon: 'fa:code',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdefaultVersion: 1.3,\n\t\tdescription: 'Return data in a defined JSON format',\n\t\tdefaults: {\n\t\t\tname: 'Structured Output Parser',\n\t\t},\n\n\t\tcodex: {\n\t\t\talias: ['json', 'zod'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Output Parsers'],\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.outputparserstructured/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tif (parameters?.autoFix) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{ displayName: 'Model', maxConnections: 1, type: \"${NodeConnectionTypes.AiLanguageModel}\", required: true }\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t})($parameter)\n\t\t}}`,\n\n\t\toutputs: [NodeConnectionTypes.AiOutputParser],\n\t\toutputNames: ['Output Parser'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiAgent]),\n\t\t\t{ ...schemaTypeField, displayOptions: { show: { '@version': [{ _cnd: { gte: 1.2 } }] } } },\n\t\t\t{\n\t\t\t\t...jsonSchemaExampleField,\n\t\t\t\tdefault: `{\n\t\"state\": \"California\",\n\t\"cities\": [\"Los Angeles\", \"San Francisco\", \"San Diego\"]\n}`,\n\t\t\t},\n\t\t\tbuildJsonSchemaExampleNotice({\n\t\t\t\tshowExtraProps: {\n\t\t\t\t\t'@version': [{ _cnd: { gte: 1.3 } }],\n\t\t\t\t},\n\t\t\t}),\n\t\t\t{\n\t\t\t\t...inputSchemaField,\n\t\t\t\tdefault: `{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"state\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"cities\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'JSON Schema',\n\t\t\t\tname: 'jsonSchema',\n\t\t\t\ttype: 'json',\n\t\t\t\tdescription: 'JSON Schema to structure and validate the output against',\n\t\t\t\tdefault: `{\n \"type\": \"object\",\n \"properties\": {\n \"state\": {\n \"type\": \"string\"\n },\n \"cities\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n}`,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\trequired: true,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { lte: 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\tdisplayName: 'Auto-Fix Format',\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to automatically fix the output when it is not in the correct format. Will cause another LLM call.',\n\t\t\t\tname: 'autoFix',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Customize Retry Prompt',\n\t\t\t\tname: 'customizeRetryPrompt',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tautoFix: [true],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: false,\n\t\t\t\tdescription:\n\t\t\t\t\t'Whether to customize the prompt used for retrying the output parsing. If disabled, a default prompt will be used.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Custom Prompt',\n\t\t\t\tname: 'prompt',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tautoFix: [true],\n\t\t\t\t\t\tcustomizeRetryPrompt: [true],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: NAIVE_FIX_PROMPT,\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\thint: 'Should include \"{error}\", \"{instructions}\", and \"{completion}\" placeholders',\n\t\t\t\tdescription:\n\t\t\t\t\t'Prompt template used for fixing the output. Uses placeholders: \"{instructions}\" for parsing rules, \"{completion}\" for the failed attempt, and \"{error}\" for the validation error message.',\n\t\t\t},\n\t\t],\n\t\thints: [\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t'Fields that use $refs might have the wrong type, since this syntax is not currently supported',\n\t\t\t\ttype: 'warning',\n\t\t\t\tlocation: 'outputPane',\n\t\t\t\twhenToDisplay: 'afterExecution',\n\t\t\t\tdisplayCondition:\n\t\t\t\t\t'={{ $parameter[\"schemaType\"] === \"manual\" && $parameter[\"inputSchema\"]?.includes(\"$ref\") }}',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst schemaType = this.getNodeParameter('schemaType', itemIndex, '') as 'fromJson' | 'manual';\n\t\t// We initialize these even though one of them will always be empty\n\t\t// it makes it easer to navigate the ternary operator\n\t\tconst jsonExample = this.getNodeParameter('jsonSchemaExample', itemIndex, '') as string;\n\n\t\tlet inputSchema: string;\n\n\t\t// Enforce all fields to be required in the generated schema if the node version is 1.3 or higher\n\t\tconst jsonExampleAllFieldsRequired = this.getNode().typeVersion >= 1.3;\n\n\t\tif (this.getNode().typeVersion <= 1.1) {\n\t\t\tinputSchema = this.getNodeParameter('jsonSchema', itemIndex, '') as string;\n\t\t} else {\n\t\t\tinputSchema = this.getNodeParameter('inputSchema', itemIndex, '') as string;\n\t\t}\n\n\t\tconst jsonSchema =\n\t\t\tschemaType === 'fromJson'\n\t\t\t\t? generateSchemaFromExample(jsonExample, jsonExampleAllFieldsRequired)\n\t\t\t\t: jsonParse<JSONSchema7>(inputSchema);\n\n\t\tconst zodSchema = convertJsonSchemaToZod<z.ZodSchema<object>>(jsonSchema);\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tconst autoFix = this.getNodeParameter('autoFix', itemIndex, false) as boolean;\n\n\t\tlet outputParser;\n\t\ttry {\n\t\t\toutputParser = await N8nStructuredOutputParser.fromZodJsonSchema(\n\t\t\t\tzodSchema,\n\t\t\t\tnodeVersion,\n\t\t\t\tthis,\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Error during parsing of JSON Schema. Please check the schema and try again.',\n\t\t\t);\n\t\t}\n\n\t\tif (!autoFix) {\n\t\t\treturn {\n\t\t\t\tresponse: outputParser,\n\t\t\t};\n\t\t}\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst prompt = this.getNodeParameter('prompt', itemIndex, NAIVE_FIX_PROMPT) as string;\n\n\t\tif (prompt.length === 0 || !prompt.includes('{error}')) {\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Auto-fixing parser prompt has to contain {error} placeholder',\n\t\t\t);\n\t\t}\n\t\tconst parser = new N8nOutputFixingParser(\n\t\t\tthis,\n\t\t\tmodel,\n\t\t\toutputParser,\n\t\t\tPromptTemplate.fromTemplate(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,SAAS,IAAI;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA,8BAAe,aAAa,MAAM;AAAA,IACnC;AAEA,WAAO;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/rerankers/RerankerCohere/RerankerCohere.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { CohereRerank } from '@langchain/cohere';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RerankerCohere implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Reranker Cohere',\n\t\tname: 'rerankerCohere',\n\t\ticon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription:\n\t\t\t'Use Cohere Reranker to reorder documents after retrieval from a vector store by relevance to the given query.',\n\t\tdefaults: {\n\t\t\tname: 'Reranker Cohere',\n\t\t},\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials.host }}',\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'cohereApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Rerankers'],\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.rerankercohere/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.AiReranker],\n\t\toutputNames: ['Reranker'],\n\t\tproperties: [\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 that should be used to rerank the documents. <a href=\"https://docs.cohere.com/docs/models\">Learn more</a>.',\n\t\t\t\tdefault: 'rerank-v3.5',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-v3.5',\n\t\t\t\t\t\tvalue: 'rerank-v3.5',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-english-v3.0',\n\t\t\t\t\t\tvalue: 'rerank-english-v3.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-multilingual-v3.0',\n\t\t\t\t\t\tvalue: 'rerank-multilingual-v3.0',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply data for reranking Cohere');\n\t\tconst modelName = this.getNodeParameter('modelName', itemIndex, 'rerank-v3.5') as string;\n\t\tconst credentials = await this.getCredentials<{ apiKey: string }>('cohereApi');\n\t\tconst reranker = new CohereRerank({\n\t\t\tapiKey: credentials.apiKey,\n\t\t\tmodel: modelName,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(reranker, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA6B;AAC7B,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAE,OAAO,mBAAmB,MAAM,uBAAuB;AAAA,MAC/D,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aACC;AAAA,MACD,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,iBAAiB;AAAA,QAChB,wBAAwB;AAAA,QACxB,SAAS;AAAA,MACV;AAAA,MACA,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,WAAW;AAAA,QACjB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,UAAU;AAAA,MACxC,aAAa,CAAC,UAAU;AAAA,MACxB,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aACC;AAAA,UACD,SAAS;AAAA,UACT,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,kCAAkC;AACpD,UAAM,YAAY,KAAK,iBAAiB,aAAa,WAAW,aAAa;AAC7E,UAAM,cAAc,MAAM,KAAK,eAAmC,WAAW;AAC7E,UAAM,WAAW,IAAI,2BAAa;AAAA,MACjC,QAAQ,YAAY;AAAA,MACpB,OAAO;AAAA,IACR,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/rerankers/RerankerCohere/RerankerCohere.node.ts"],"sourcesContent":["import { CohereRerank } from '@langchain/cohere';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RerankerCohere implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Reranker Cohere',\n\t\tname: 'rerankerCohere',\n\t\ticon: { light: 'file:cohere.svg', dark: 'file:cohere.dark.svg' },\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription:\n\t\t\t'Use Cohere Reranker to reorder documents after retrieval from a vector store by relevance to the given query.',\n\t\tdefaults: {\n\t\t\tname: 'Reranker Cohere',\n\t\t},\n\t\trequestDefaults: {\n\t\t\tignoreHttpStatusErrors: true,\n\t\t\tbaseURL: '={{ $credentials.host }}',\n\t\t},\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'cohereApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Rerankers'],\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.rerankercohere/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [NodeConnectionTypes.AiReranker],\n\t\toutputNames: ['Reranker'],\n\t\tproperties: [\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 that should be used to rerank the documents. <a href=\"https://docs.cohere.com/docs/models\">Learn more</a>.',\n\t\t\t\tdefault: 'rerank-v3.5',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-v3.5',\n\t\t\t\t\t\tvalue: 'rerank-v3.5',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-english-v3.0',\n\t\t\t\t\t\tvalue: 'rerank-english-v3.0',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'rerank-multilingual-v3.0',\n\t\t\t\t\t\tvalue: 'rerank-multilingual-v3.0',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply data for reranking Cohere');\n\t\tconst modelName = this.getNodeParameter('modelName', itemIndex, 'rerank-v3.5') as string;\n\t\tconst credentials = await this.getCredentials<{ apiKey: string }>('cohereApi');\n\t\tconst reranker = new CohereRerank({\n\t\t\tapiKey: credentials.apiKey,\n\t\t\tmodel: modelName,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(reranker, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM,EAAE,OAAO,mBAAmB,MAAM,uBAAuB;AAAA,MAC/D,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aACC;AAAA,MACD,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,iBAAiB;AAAA,QAChB,wBAAwB;AAAA,QACxB,SAAS;AAAA,MACV;AAAA,MACA,aAAa;AAAA,QACZ;AAAA,UACC,MAAM;AAAA,UACN,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,WAAW;AAAA,QACjB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAQ,CAAC;AAAA,MACT,SAAS,CAAC,wCAAoB,UAAU;AAAA,MACxC,aAAa,CAAC,UAAU;AAAA,MACxB,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,aACC;AAAA,UACD,SAAS;AAAA,UACT,SAAS;AAAA,YACR;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,YACA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,YACR;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,kCAAkC;AACpD,UAAM,YAAY,KAAK,iBAAiB,aAAa,WAAW,aAAa;AAC7E,UAAM,cAAc,MAAM,KAAK,eAAmC,WAAW;AAC7E,UAAM,WAAW,IAAI,2BAAa;AAAA,MACjC,QAAQ,YAAY;AAAA,MACpB,OAAO;AAAA,IACR,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
@@ -51,7 +51,6 @@ class RetrieverContextualCompression {
51
51
  ]
52
52
  }
53
53
  },
54
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
55
54
  inputs: [
56
55
  {
57
56
  displayName: "Model",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseRetriever } from '@langchain/core/retrievers';\nimport { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';\nimport { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverContextualCompression implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Contextual Compression Retriever',\n\t\tname: 'retrieverContextualCompression',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Enhances document similarity search by contextual compression.',\n\t\tdefaults: {\n\t\t\tname: 'Contextual Compression Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievercontextualcompression/',\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: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supplying data for Contextual Compression Retriever');\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst baseRetriever = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiRetriever,\n\t\t\titemIndex,\n\t\t)) as BaseRetriever;\n\n\t\tconst baseCompressor = LLMChainExtractor.fromLLM(model);\n\n\t\tconst retriever = new ContextualCompressionRetriever({\n\t\t\tbaseCompressor,\n\t\t\tbaseRetriever,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oCAA+C;AAC/C,2BAAkC;AAClC,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,+BAAoD;AAAA,EAA1D;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,YAAY,CAAC;AAAA,IACd;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,qDAAqD;AAEvE,UAAM,QAAS,MAAM,KAAK;AAAA,MACzB,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,gBAAiB,MAAM,KAAK;AAAA,MACjC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,iBAAiB,uCAAkB,QAAQ,KAAK;AAEtD,UAAM,YAAY,IAAI,6DAA+B;AAAA,MACpD;AAAA,MACA;AAAA,IACD,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseRetriever } from '@langchain/core/retrievers';\nimport { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';\nimport { LLMChainExtractor } from 'langchain/retrievers/document_compressors/chain_extract';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverContextualCompression implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Contextual Compression Retriever',\n\t\tname: 'retrieverContextualCompression',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Enhances document similarity search by contextual compression.',\n\t\tdefaults: {\n\t\t\tname: 'Contextual Compression Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievercontextualcompression/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supplying data for Contextual Compression Retriever');\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst baseRetriever = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiRetriever,\n\t\t\titemIndex,\n\t\t)) as BaseRetriever;\n\n\t\tconst baseCompressor = LLMChainExtractor.fromLLM(model);\n\n\t\tconst retriever = new ContextualCompressionRetriever({\n\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ACjC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,iBAAiB,uCAAkB,QAAQ,KAAK;AAEtD,UAAM,YAAY,IAAI,6DAA+B;AAAA,MACpD;AAAA,MACA;AAAA,IACD,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -50,7 +50,6 @@ class RetrieverMultiQuery {
50
50
  ]
51
51
  }
52
52
  },
53
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
54
53
  inputs: [
55
54
  {
56
55
  displayName: "Model",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\n\nimport type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseRetriever } from '@langchain/core/retrievers';\nimport { MultiQueryRetriever } from 'langchain/retrievers/multi_query';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverMultiQuery implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'MultiQuery Retriever',\n\t\tname: 'retrieverMultiQuery',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription:\n\t\t\t'Automates prompt tuning, generates diverse queries and expands document pool for enhanced retrieval.',\n\t\tdefaults: {\n\t\t\tname: 'MultiQuery Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievermultiquery/',\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: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [\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: 'Query Count',\n\t\t\t\t\t\tname: 'queryCount',\n\t\t\t\t\t\tdefault: 3,\n\t\t\t\t\t\ttypeOptions: { minValue: 1 },\n\t\t\t\t\t\tdescription: 'Number of different versions of the given question to generate',\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\tthis.logger.debug('Supplying data for MultiQuery Retriever');\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as { queryCount?: number };\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst baseRetriever = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiRetriever,\n\t\t\titemIndex,\n\t\t)) as BaseRetriever;\n\n\t\t// TODO: Add support for parserKey\n\n\t\tconst retriever = MultiQueryRetriever.fromLLM({\n\t\t\tllm: model,\n\t\t\tretriever: baseRetriever,\n\t\t\t...options,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,yBAAoC;AACpC,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,oBAAyC;AAAA,EAA/C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aACC;AAAA,MACD,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa,EAAE,UAAU,EAAE;AAAA,cAC3B,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,yCAAyC;AAE3D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAE9D,UAAM,QAAS,MAAM,KAAK;AAAA,MACzB,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,gBAAiB,MAAM,KAAK;AAAA,MACjC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAIA,UAAM,YAAY,uCAAoB,QAAQ;AAAA,MAC7C,KAAK;AAAA,MACL,WAAW;AAAA,MACX,GAAG;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseRetriever } from '@langchain/core/retrievers';\nimport { MultiQueryRetriever } from 'langchain/retrievers/multi_query';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverMultiQuery implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'MultiQuery Retriever',\n\t\tname: 'retrieverMultiQuery',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription:\n\t\t\t'Automates prompt tuning, generates diverse queries and expands document pool for enhanced retrieval.',\n\t\tdefaults: {\n\t\t\tname: 'MultiQuery Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievermultiquery/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Model',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiLanguageModel,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [\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: 'Query Count',\n\t\t\t\t\t\tname: 'queryCount',\n\t\t\t\t\t\tdefault: 3,\n\t\t\t\t\t\ttypeOptions: { minValue: 1 },\n\t\t\t\t\t\tdescription: 'Number of different versions of the given question to generate',\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\tthis.logger.debug('Supplying data for MultiQuery Retriever');\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as { queryCount?: number };\n\n\t\tconst model = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t\titemIndex,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst baseRetriever = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiRetriever,\n\t\t\titemIndex,\n\t\t)) as BaseRetriever;\n\n\t\t// TODO: Add support for parserKey\n\n\t\tconst retriever = MultiQueryRetriever.fromLLM({\n\t\t\tllm: model,\n\t\t\tretriever: baseRetriever,\n\t\t\t...options,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,yBAAoC;AACpC,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,oBAAyC;AAAA,EAA/C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aACC;AAAA,MACD,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MACA,SAAS;AAAA,QACR;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,QAC3B;AAAA,MACD;AAAA,MACA,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,aAAa,EAAE,UAAU,EAAE;AAAA,cAC3B,aAAa;AAAA,cACb,MAAM;AAAA,YACP;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,yCAAyC;AAE3D,UAAM,UAAU,KAAK,iBAAiB,WAAW,WAAW,CAAC,CAAC;AAE9D,UAAM,QAAS,MAAM,KAAK;AAAA,MACzB,wCAAoB;AAAA,MACpB;AAAA,IACD;AAEA,UAAM,gBAAiB,MAAM,KAAK;AAAA,MACjC,wCAAoB;AAAA,MACpB;AAAA,IACD;AAIA,UAAM,YAAY,uCAAoB,QAAQ;AAAA,MAC7C,KAAK;AAAA,MACL,WAAW;AAAA,MACX,GAAG;AAAA,IACJ,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -51,7 +51,6 @@ class RetrieverVectorStore {
51
51
  ]
52
52
  }
53
53
  },
54
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
55
54
  inputs: [
56
55
  {
57
56
  displayName: "Vector Store",
@@ -60,7 +59,6 @@ class RetrieverVectorStore {
60
59
  required: true
61
60
  }
62
61
  ],
63
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
64
62
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiRetriever],
65
63
  outputNames: ["Retriever"],
66
64
  properties: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BaseDocumentCompressor } from '@langchain/core/retrievers/document_compressors';\nimport { VectorStore } from '@langchain/core/vectorstores';\nimport { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverVectorStore implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Vector Store Retriever',\n\t\tname: 'retrieverVectorStore',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use a Vector Store as Retriever',\n\t\tdefaults: {\n\t\t\tname: 'Vector Store Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievervectorstore/',\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: 'Vector Store',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiVectorStore,\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.AiRetriever],\n\t\toutputNames: ['Retriever'],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit',\n\t\t\t\tname: 'topK',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 4,\n\t\t\t\tdescription: 'The maximum number of results to return',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supplying data for Vector Store Retriever');\n\n\t\tconst topK = this.getNodeParameter('topK', itemIndex, 4) as number;\n\t\tconst vectorStore = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiVectorStore,\n\t\t\titemIndex,\n\t\t)) as\n\t\t\t| VectorStore\n\t\t\t| {\n\t\t\t\t\treranker: BaseDocumentCompressor;\n\t\t\t\t\tvectorStore: VectorStore;\n\t\t\t };\n\n\t\tlet retriever = null;\n\n\t\tif (vectorStore instanceof VectorStore) {\n\t\t\tretriever = vectorStore.asRetriever(topK);\n\t\t} else {\n\t\t\tretriever = new ContextualCompressionRetriever({\n\t\t\t\tbaseCompressor: vectorStore.reranker,\n\t\t\t\tbaseRetriever: vectorStore.vectorStore.asRetriever(topK),\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA4B;AAC5B,oCAA+C;AAC/C,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WA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orStore/RetrieverVectorStore.node.ts"],"sourcesContent":["import type { BaseDocumentCompressor } from '@langchain/core/retrievers/document_compressors';\nimport { VectorStore } from '@langchain/core/vectorstores';\nimport { ContextualCompressionRetriever } from 'langchain/retrievers/contextual_compression';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nexport class RetrieverVectorStore implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Vector Store Retriever',\n\t\tname: 'retrieverVectorStore',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Use a Vector Store as Retriever',\n\t\tdefaults: {\n\t\t\tname: 'Vector Store Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrievervectorstore/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Vector Store',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiVectorStore,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\n\t\toutputs: [NodeConnectionTypes.AiRetriever],\n\t\toutputNames: ['Retriever'],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Limit',\n\t\t\t\tname: 'topK',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 4,\n\t\t\t\tdescription: 'The maximum number of results to return',\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supplying data for Vector Store Retriever');\n\n\t\tconst topK = this.getNodeParameter('topK', itemIndex, 4) as number;\n\t\tconst vectorStore = (await this.getInputConnectionData(\n\t\t\tNodeConnectionTypes.AiVectorStore,\n\t\t\titemIndex,\n\t\t)) as\n\t\t\t| VectorStore\n\t\t\t| {\n\t\t\t\t\treranker: BaseDocumentCompressor;\n\t\t\t\t\tvectorStore: VectorStore;\n\t\t\t };\n\n\t\tlet retriever = null;\n\n\t\tif (vectorStore instanceof VectorStore) {\n\t\t\tretriever = vectorStore.asRetriever(topK);\n\t\t} else {\n\t\t\tretriever = new ContextualCompressionRetriever({\n\t\t\t\tbaseCompressor: vectorStore.reranker,\n\t\t\t\tbaseRetriever: vectorStore.vectorStore.asRetriever(topK),\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAA4B;AAC5B,oCAA+C;AAC/C,0BAMO;AAEP,wBAA2B;AAEpB,MAAM,qBAA0C;AAAA,EAAhD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ;AAAA,QACP;AAAA,UACC,aAAa;AAAA,UACb,gBAAgB;AAAA,UAChB,MAAM,wCAAoB;AAAA,UAC1B,UAAU;AAAA,QACX;AAAA,MACD;AAAA,MAEA,SAAS,CAAC,wCAAoB,WAAW;AAAA,MACzC,aAAa,CAAC,WAAW;AAAA,MACzB,YAAY;AAAA,QACX;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,UACT,aAAa;AAAA,QACd;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,2CAA2C;AAE7D,UAAM,OAAO,KAAK,iBAAiB,QAAQ,WAAW,CAAC;AACvD,UAAM,cAAe,MAAM,KAAK;AAAA,MAC/B,wCAAoB;AAAA,MACpB;AAAA,IACD;AAOA,QAAI,YAAY;AAEhB,QAAI,uBAAuB,iCAAa;AACvC,kBAAY,YAAY,YAAY,IAAI;AAAA,IACzC,OAAO;AACN,kBAAY,IAAI,6DAA+B;AAAA,QAC9C,gBAAgB,YAAY;AAAA,QAC5B,eAAe,YAAY,YAAY,YAAY,IAAI;AAAA,MACxD,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';\nimport { Document } from '@langchain/core/documents';\nimport { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers';\nimport type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces';\nimport * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIDataObject,\n\tIExecuteWorkflowInfo,\n\tINodeExecutionData,\n\tIWorkflowBase,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tSupplyData,\n\tINodeParameterResourceLocator,\n\tExecuteWorkflowData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nfunction objectToString(obj: Record<string, string> | IDataObject, level = 0) {\n\tlet result = '';\n\tfor (const key in obj) {\n\t\tconst value = obj[key];\n\t\tif (typeof value === 'object' && value !== null) {\n\t\t\tresult += `${' '.repeat(level)}- \"${key}\":\\n${objectToString(\n\t\t\t\tvalue as IDataObject,\n\t\t\t\tlevel + 1,\n\t\t\t)}`;\n\t\t} else {\n\t\t\tresult += `${' '.repeat(level)}- \"${key}\": \"${value}\"\\n`;\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class RetrieverWorkflow implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Workflow Retriever',\n\t\tname: 'retrieverWorkflow',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1],\n\t\tdescription: 'Use an n8n Workflow as Retriever',\n\t\tdefaults: {\n\t\t\tname: 'Workflow Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrieverworkflow/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'The workflow will receive \"query\" as input and the output of the last node will be returned and converted to Documents',\n\t\t\t\tname: 'executeNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Source',\n\t\t\t\tname: 'source',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Database',\n\t\t\t\t\t\tvalue: 'database',\n\t\t\t\t\t\tdescription: 'Load the workflow from the database by ID',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Parameter',\n\t\t\t\t\t\tvalue: 'parameter',\n\t\t\t\t\t\tdescription: 'Load the workflow from a parameter',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'database',\n\t\t\t\tdescription: 'Where to get the workflow to execute from',\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// source:database\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow ID',\n\t\t\t\tname: 'workflowId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['database'],\n\t\t\t\t\t\t'@version': [{ _cnd: { eq: 1 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'The workflow to execute',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow',\n\t\t\t\tname: 'workflowId',\n\t\t\t\ttype: 'workflowSelector',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['database'],\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\trequired: true,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// source:parameter\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow JSON',\n\t\t\t\tname: 'workflowJson',\n\t\t\t\ttype: 'json',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['parameter'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '\\n\\n\\n',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'The workflow JSON code to execute',\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// For all\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow Values',\n\t\t\t\tname: 'fields',\n\t\t\t\tplaceholder: 'Add Value',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdescription: 'Set the values which should be made available in the workflow',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. fieldName',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.',\n\t\t\t\t\t\t\t\trequiresDataPath: 'single',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdescription: 'The field value type',\n\t\t\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\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: 'String',\n\t\t\t\t\t\t\t\t\t\tvalue: 'stringValue',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Number',\n\t\t\t\t\t\t\t\t\t\tvalue: 'numberValue',\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: 'Boolean',\n\t\t\t\t\t\t\t\t\t\tvalue: 'booleanValue',\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: 'Array',\n\t\t\t\t\t\t\t\t\t\tvalue: 'arrayValue',\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: 'Object',\n\t\t\t\t\t\t\t\t\t\tvalue: 'objectValue',\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: 'stringValue',\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: 'Value',\n\t\t\t\t\t\t\t\tname: 'stringValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['stringValue'],\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\tvalidateType: 'string',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'numberValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['numberValue'],\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\tvalidateType: 'number',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'booleanValue',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'true',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'True',\n\t\t\t\t\t\t\t\t\t\tvalue: 'true',\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: 'False',\n\t\t\t\t\t\t\t\t\t\tvalue: 'false',\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\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['booleanValue'],\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\tvalidateType: 'boolean',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'arrayValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['arrayValue'],\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\tvalidateType: 'array',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'objectValue',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '={}',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['objectValue'],\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\tvalidateType: 'object',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst workflowProxy = this.getWorkflowDataProxy(0);\n\n\t\tclass WorkflowRetriever extends BaseRetriever {\n\t\t\tlc_namespace = ['n8n-nodes-langchain', 'retrievers', 'workflow'];\n\n\t\t\tconstructor(\n\t\t\t\tprivate executeFunctions: ISupplyDataFunctions,\n\t\t\t\tfields: BaseRetrieverInput,\n\t\t\t) {\n\t\t\t\tsuper(fields);\n\t\t\t}\n\n\t\t\tasync _getRelevantDocuments(\n\t\t\t\tquery: string,\n\t\t\t\tconfig?: CallbackManagerForRetrieverRun,\n\t\t\t): Promise<Document[]> {\n\t\t\t\tconst source = this.executeFunctions.getNodeParameter('source', itemIndex) as string;\n\n\t\t\t\tconst baseMetadata: IDataObject = {\n\t\t\t\t\tsource: 'workflow',\n\t\t\t\t\tworkflowSource: source,\n\t\t\t\t};\n\n\t\t\t\tconst workflowInfo: IExecuteWorkflowInfo = {};\n\t\t\t\tif (source === 'database') {\n\t\t\t\t\tconst nodeVersion = this.executeFunctions.getNode().typeVersion;\n\t\t\t\t\tif (nodeVersion === 1) {\n\t\t\t\t\t\tworkflowInfo.id = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t\t'workflowId',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t) as string;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst { value } = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t\t'workflowId',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t) as INodeParameterResourceLocator;\n\t\t\t\t\t\tworkflowInfo.id = value as string;\n\t\t\t\t\t}\n\n\t\t\t\t\tbaseMetadata.workflowId = workflowInfo.id;\n\t\t\t\t} else if (source === 'parameter') {\n\t\t\t\t\t// Read workflow from parameter\n\t\t\t\t\tconst workflowJson = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t'workflowJson',\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t) as string;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tworkflowInfo.code = JSON.parse(workflowJson) as IWorkflowBase;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tthis.executeFunctions.getNode(),\n\t\t\t\t\t\t\t`The provided workflow is not valid JSON: \"${(error as Error).message}\"`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// same as current workflow\n\t\t\t\t\tbaseMetadata.workflowId = workflowProxy.$workflow.id;\n\t\t\t\t}\n\n\t\t\t\tconst rawData: IDataObject = { query };\n\n\t\t\t\tconst workflowFieldsJson = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t'fields.values',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t\t{\n\t\t\t\t\t\trawExpressions: true,\n\t\t\t\t\t},\n\t\t\t\t) as SetField[];\n\n\t\t\t\t// Copied from Set Node v2\n\t\t\t\tfor (const entry of workflowFieldsJson) {\n\t\t\t\t\tif (entry.type === 'objectValue' && (entry.objectValue as string).startsWith('=')) {\n\t\t\t\t\t\trawData[entry.name] = (entry.objectValue as string).replace(/^=+/, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst options: SetNodeOptions = {\n\t\t\t\t\tinclude: 'all',\n\t\t\t\t};\n\n\t\t\t\tconst newItem = await manual.execute.call(\n\t\t\t\t\tthis.executeFunctions,\n\t\t\t\t\t{ json: { query } },\n\t\t\t\t\titemIndex,\n\t\t\t\t\toptions,\n\t\t\t\t\trawData,\n\t\t\t\t\tthis.executeFunctions.getNode(),\n\t\t\t\t);\n\n\t\t\t\tconst items = [newItem] as INodeExecutionData[];\n\n\t\t\t\tlet receivedData: ExecuteWorkflowData;\n\t\t\t\ttry {\n\t\t\t\t\treceivedData = await this.executeFunctions.executeWorkflow(\n\t\t\t\t\t\tworkflowInfo,\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tconfig?.getChild(),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparentExecution: {\n\t\t\t\t\t\t\t\texecutionId: workflowProxy.$execution.id,\n\t\t\t\t\t\t\t\tworkflowId: workflowProxy.$workflow.id,\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} catch (error) {\n\t\t\t\t\t// Make sure a valid error gets returned that can by json-serialized else it will\n\t\t\t\t\t// not show up in the frontend\n\t\t\t\t\tthrow new NodeOperationError(this.executeFunctions.getNode(), error as Error);\n\t\t\t\t}\n\n\t\t\t\tconst receivedItems = receivedData.data?.[0] ?? [];\n\n\t\t\t\tconst returnData: Document[] = [];\n\t\t\t\tfor (const [index, itemData] of receivedItems.entries()) {\n\t\t\t\t\tconst pageContent = objectToString(itemData.json);\n\t\t\t\t\treturnData.push(\n\t\t\t\t\t\tnew Document({\n\t\t\t\t\t\t\tpageContent: `### ${index + 1}. Context data:\\n${pageContent}`,\n\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\t...baseMetadata,\n\t\t\t\t\t\t\t\titemIndex: index,\n\t\t\t\t\t\t\t\texecutionId: receivedData.executionId,\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\n\t\t\t\treturn returnData;\n\t\t\t}\n\t\t}\n\n\t\tconst retriever = new WorkflowRetriever(this, {});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAyB;AACzB,wBAAuD;AAEvD,aAAwB;AACxB,0BAAwD;AAcxD,wBAA2B;AAE3B,SAAS,eAAe,KAA2C,QAAQ,GAAG;AAC7E,MAAI,SAAS;AACb,aAAW,OAAO,KAAK;AACtB,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,gBAAU,GAAG,KAAK,OAAO,KAAK,CAAC,MAAM,GAAG;AAAA,EAAO;AAAA,QAC9C;AAAA,QACA,QAAQ;AAAA,MACT,CAAC;AAAA,IACF,OAAO;AACN,gBAAU,GAAG,KAAK,OAAO,KAAK,CAAC,MAAM,GAAG,OAAO,KAAK;AAAA;AAAA,IACrD;AAAA,EACD;AACA,SAAO;AACR;AAEO,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM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Q,KAAK,cAAc,QAAQ,GAAG;AACxD,gBAAM,cAAc,eAAe,SAAS,IAAI;AAChD,qBAAW;AAAA,YACV,IAAI,0BAAS;AAAA,cACZ,aAAa,OAAO,QAAQ,CAAC;AAAA,EAAoB,WAAW;AAAA,cAC5D,UAAU;AAAA,gBACT,GAAG;AAAA,gBACH,WAAW;AAAA,gBACX,aAAa,aAAa;AAAA,cAC3B;AAAA,YACD,CAAC;AAAA,UACF;AAAA,QACD;AAEA,eAAO;AAAA,MACR;AAAA,IACD;AAEA,UAAM,YAAY,IAAI,kBAAkB,MAAM,CAAC,CAAC;AAEhD,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts"],"sourcesContent":["import type { CallbackManagerForRetrieverRun } from '@langchain/core/callbacks/manager';\nimport { Document } from '@langchain/core/documents';\nimport { BaseRetriever, type BaseRetrieverInput } from '@langchain/core/retrievers';\nimport type { SetField, SetNodeOptions } from 'n8n-nodes-base/dist/nodes/Set/v2/helpers/interfaces';\nimport * as manual from 'n8n-nodes-base/dist/nodes/Set/v2/manual.mode';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIDataObject,\n\tIExecuteWorkflowInfo,\n\tINodeExecutionData,\n\tIWorkflowBase,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeTypeDescription,\n\tSupplyData,\n\tINodeParameterResourceLocator,\n\tExecuteWorkflowData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\n\nfunction objectToString(obj: Record<string, string> | IDataObject, level = 0) {\n\tlet result = '';\n\tfor (const key in obj) {\n\t\tconst value = obj[key];\n\t\tif (typeof value === 'object' && value !== null) {\n\t\t\tresult += `${' '.repeat(level)}- \"${key}\":\\n${objectToString(\n\t\t\t\tvalue as IDataObject,\n\t\t\t\tlevel + 1,\n\t\t\t)}`;\n\t\t} else {\n\t\t\tresult += `${' '.repeat(level)}- \"${key}\": \"${value}\"\\n`;\n\t\t}\n\t}\n\treturn result;\n}\n\nexport class RetrieverWorkflow implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Workflow Retriever',\n\t\tname: 'retrieverWorkflow',\n\t\ticon: 'fa:box-open',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1],\n\t\tdescription: 'Use an n8n Workflow as Retriever',\n\t\tdefaults: {\n\t\t\tname: 'Workflow Retriever',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Retrievers'],\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.retrieverworkflow/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: [],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Retriever',\n\t\t\t\tmaxConnections: 1,\n\t\t\t\ttype: NodeConnectionTypes.AiRetriever,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\t{\n\t\t\t\tdisplayName:\n\t\t\t\t\t'The workflow will receive \"query\" as input and the output of the last node will be returned and converted to Documents',\n\t\t\t\tname: 'executeNotice',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Source',\n\t\t\t\tname: 'source',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Database',\n\t\t\t\t\t\tvalue: 'database',\n\t\t\t\t\t\tdescription: 'Load the workflow from the database by ID',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Parameter',\n\t\t\t\t\t\tvalue: 'parameter',\n\t\t\t\t\t\tdescription: 'Load the workflow from a parameter',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdefault: 'database',\n\t\t\t\tdescription: 'Where to get the workflow to execute from',\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// source:database\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow ID',\n\t\t\t\tname: 'workflowId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['database'],\n\t\t\t\t\t\t'@version': [{ _cnd: { eq: 1 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'The workflow to execute',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow',\n\t\t\t\tname: 'workflowId',\n\t\t\t\ttype: 'workflowSelector',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['database'],\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '',\n\t\t\t\trequired: true,\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// source:parameter\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow JSON',\n\t\t\t\tname: 'workflowJson',\n\t\t\t\ttype: 'json',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 10,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\tsource: ['parameter'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '\\n\\n\\n',\n\t\t\t\trequired: true,\n\t\t\t\tdescription: 'The workflow JSON code to execute',\n\t\t\t},\n\n\t\t\t// ----------------------------------\n\t\t\t// For all\n\t\t\t// ----------------------------------\n\t\t\t{\n\t\t\t\tdisplayName: 'Workflow Values',\n\t\t\t\tname: 'fields',\n\t\t\t\tplaceholder: 'Add Value',\n\t\t\t\ttype: 'fixedCollection',\n\t\t\t\tdescription: 'Set the values which should be made available in the workflow',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmultipleValues: true,\n\t\t\t\t\tsortable: true,\n\t\t\t\t},\n\t\t\t\tdefault: {},\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'values',\n\t\t\t\t\t\tdisplayName: 'Values',\n\t\t\t\t\t\tvalues: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\t\t\t\tname: 'name',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. fieldName',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Name of the field to set the value of. Supports dot-notation. Example: data.person[0].name.',\n\t\t\t\t\t\t\t\trequiresDataPath: 'single',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Type',\n\t\t\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdescription: 'The field value type',\n\t\t\t\t\t\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\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: 'String',\n\t\t\t\t\t\t\t\t\t\tvalue: 'stringValue',\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'Number',\n\t\t\t\t\t\t\t\t\t\tvalue: 'numberValue',\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: 'Boolean',\n\t\t\t\t\t\t\t\t\t\tvalue: 'booleanValue',\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: 'Array',\n\t\t\t\t\t\t\t\t\t\tvalue: 'arrayValue',\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: 'Object',\n\t\t\t\t\t\t\t\t\t\tvalue: 'objectValue',\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: 'stringValue',\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: 'Value',\n\t\t\t\t\t\t\t\tname: 'stringValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['stringValue'],\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\tvalidateType: 'string',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'numberValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['numberValue'],\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\tvalidateType: 'number',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'booleanValue',\n\t\t\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\t\t\tdefault: 'true',\n\t\t\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: 'True',\n\t\t\t\t\t\t\t\t\t\tvalue: 'true',\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: 'False',\n\t\t\t\t\t\t\t\t\t\tvalue: 'false',\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\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['booleanValue'],\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\tvalidateType: 'boolean',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'arrayValue',\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\t\t\tplaceholder: 'e.g. [ arrayItem1, arrayItem2, arrayItem3 ]',\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['arrayValue'],\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\tvalidateType: 'array',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdisplayName: 'Value',\n\t\t\t\t\t\t\t\tname: 'objectValue',\n\t\t\t\t\t\t\t\ttype: 'json',\n\t\t\t\t\t\t\t\tdefault: '={}',\n\t\t\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\t\t\ttype: ['objectValue'],\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\tvalidateType: 'object',\n\t\t\t\t\t\t\t\tignoreValidationDuringExecution: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst workflowProxy = this.getWorkflowDataProxy(0);\n\n\t\tclass WorkflowRetriever extends BaseRetriever {\n\t\t\tlc_namespace = ['n8n-nodes-langchain', 'retrievers', 'workflow'];\n\n\t\t\tconstructor(\n\t\t\t\tprivate executeFunctions: ISupplyDataFunctions,\n\t\t\t\tfields: BaseRetrieverInput,\n\t\t\t) {\n\t\t\t\tsuper(fields);\n\t\t\t}\n\n\t\t\tasync _getRelevantDocuments(\n\t\t\t\tquery: string,\n\t\t\t\tconfig?: CallbackManagerForRetrieverRun,\n\t\t\t): Promise<Document[]> {\n\t\t\t\tconst source = this.executeFunctions.getNodeParameter('source', itemIndex) as string;\n\n\t\t\t\tconst baseMetadata: IDataObject = {\n\t\t\t\t\tsource: 'workflow',\n\t\t\t\t\tworkflowSource: source,\n\t\t\t\t};\n\n\t\t\t\tconst workflowInfo: IExecuteWorkflowInfo = {};\n\t\t\t\tif (source === 'database') {\n\t\t\t\t\tconst nodeVersion = this.executeFunctions.getNode().typeVersion;\n\t\t\t\t\tif (nodeVersion === 1) {\n\t\t\t\t\t\tworkflowInfo.id = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t\t'workflowId',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t) as string;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst { value } = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t\t'workflowId',\n\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t) as INodeParameterResourceLocator;\n\t\t\t\t\t\tworkflowInfo.id = value as string;\n\t\t\t\t\t}\n\n\t\t\t\t\tbaseMetadata.workflowId = workflowInfo.id;\n\t\t\t\t} else if (source === 'parameter') {\n\t\t\t\t\t// Read workflow from parameter\n\t\t\t\t\tconst workflowJson = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t\t'workflowJson',\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t) as string;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tworkflowInfo.code = JSON.parse(workflowJson) as IWorkflowBase;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tthis.executeFunctions.getNode(),\n\t\t\t\t\t\t\t`The provided workflow is not valid JSON: \"${(error as Error).message}\"`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\titemIndex,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// same as current workflow\n\t\t\t\t\tbaseMetadata.workflowId = workflowProxy.$workflow.id;\n\t\t\t\t}\n\n\t\t\t\tconst rawData: IDataObject = { query };\n\n\t\t\t\tconst workflowFieldsJson = this.executeFunctions.getNodeParameter(\n\t\t\t\t\t'fields.values',\n\t\t\t\t\titemIndex,\n\t\t\t\t\t[],\n\t\t\t\t\t{\n\t\t\t\t\t\trawExpressions: true,\n\t\t\t\t\t},\n\t\t\t\t) as SetField[];\n\n\t\t\t\t// Copied from Set Node v2\n\t\t\t\tfor (const entry of workflowFieldsJson) {\n\t\t\t\t\tif (entry.type === 'objectValue' && (entry.objectValue as string).startsWith('=')) {\n\t\t\t\t\t\trawData[entry.name] = (entry.objectValue as string).replace(/^=+/, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst options: SetNodeOptions = {\n\t\t\t\t\tinclude: 'all',\n\t\t\t\t};\n\n\t\t\t\tconst newItem = await manual.execute.call(\n\t\t\t\t\tthis.executeFunctions,\n\t\t\t\t\t{ json: { query } },\n\t\t\t\t\titemIndex,\n\t\t\t\t\toptions,\n\t\t\t\t\trawData,\n\t\t\t\t\tthis.executeFunctions.getNode(),\n\t\t\t\t);\n\n\t\t\t\tconst items = [newItem] as INodeExecutionData[];\n\n\t\t\t\tlet receivedData: ExecuteWorkflowData;\n\t\t\t\ttry {\n\t\t\t\t\treceivedData = await this.executeFunctions.executeWorkflow(\n\t\t\t\t\t\tworkflowInfo,\n\t\t\t\t\t\titems,\n\t\t\t\t\t\tconfig?.getChild(),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparentExecution: {\n\t\t\t\t\t\t\t\texecutionId: workflowProxy.$execution.id,\n\t\t\t\t\t\t\t\tworkflowId: workflowProxy.$workflow.id,\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} catch (error) {\n\t\t\t\t\t// Make sure a valid error gets returned that can by json-serialized else it will\n\t\t\t\t\t// not show up in the frontend\n\t\t\t\t\tthrow new NodeOperationError(this.executeFunctions.getNode(), error as Error);\n\t\t\t\t}\n\n\t\t\t\tconst receivedItems = receivedData.data?.[0] ?? [];\n\n\t\t\t\tconst returnData: Document[] = [];\n\t\t\t\tfor (const [index, itemData] of receivedItems.entries()) {\n\t\t\t\t\tconst pageContent = objectToString(itemData.json);\n\t\t\t\t\treturnData.push(\n\t\t\t\t\t\tnew Document({\n\t\t\t\t\t\t\tpageContent: `### ${index + 1}. Context data:\\n${pageContent}`,\n\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\t...baseMetadata,\n\t\t\t\t\t\t\t\titemIndex: index,\n\t\t\t\t\t\t\t\texecutionId: receivedData.executionId,\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\n\t\t\t\treturn returnData;\n\t\t\t}\n\t\t}\n\n\t\tconst retriever = new WorkflowRetriever(this, {});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(retriever, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAyB;AACzB,wBAAuD;AAEvD,aAAwB;AACxB,0BAAwD;AAcxD,wBAA2B;AAE3B,SAAS,eAAe,KAA2C,QAAQ,GAAG;AAC7E,MAAI,SAAS;AACb,aAAW,OAAO,KAAK;AACtB,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,gBAAU,GAAG,KAAK,OAAO,KAAK,CAAC,MAAM,GAAG;AAAA,EAAO;AAAA,QAC9C;AAAA,QACA,QAAQ;AAAA,MACT,CAAC;AAAA,IACF,OAAO;AACN,gBAAU,GAAG,KAAK,OAAO,KAAK,CAAC,MAAM,GAAG,OAAO,KAAK;AAAA;AAAA,IACrD;AAAA,EACD;AACA,SAAO;AACR;AAEO,MAAM,kBAAuC;AAAA,EAA7C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,GAAG,GAAG;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,YAAY;AAAA,QAClB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,QAAQ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;AAEhD,WAAO;AAAA,MACN,cAAU,8BAAW,WAAW,IAAI;AAAA,IACrC;AAAA,EACD;AACD;","names":[]}
@@ -51,9 +51,7 @@ class TextSplitterCharacterTextSplitter {
51
51
  ]
52
52
  }
53
53
  },
54
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
55
54
  inputs: [],
56
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
57
55
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiTextSplitter],
58
56
  outputNames: ["Text Splitter"],
59
57
  properties: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { CharacterTextSplitterParams } from '@langchain/textsplitters';\nimport { CharacterTextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class TextSplitterCharacterTextSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Character Text Splitter',\n\t\tname: 'textSplitterCharacterTextSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by characters',\n\t\tdefaults: {\n\t\t\tname: 'Character Text Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplittercharactertextsplitter/',\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.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Separator',\n\t\t\t\tname: 'separator',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst separator = this.getNodeParameter('separator', itemIndex) as string;\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\n\t\tconst params: CharacterTextSplitterParams = {\n\t\t\tseparator,\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tkeepSeparator: false,\n\t\t};\n\n\t\tconst splitter = new CharacterTextSplitter(params);\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAAsC;AACtC,0BAMO;AAEP,wBAA2B;AAC3B,0BAA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,MAAM;AAEjD,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.ts"],"sourcesContent":["import type { CharacterTextSplitterParams } from '@langchain/textsplitters';\nimport { CharacterTextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class TextSplitterCharacterTextSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Character Text Splitter',\n\t\tname: 'textSplitterCharacterTextSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by characters',\n\t\tdefaults: {\n\t\t\tname: 'Character Text Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplittercharactertextsplitter/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Separator',\n\t\t\t\tname: 'separator',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst separator = this.getNodeParameter('separator', itemIndex) as string;\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\n\t\tconst params: CharacterTextSplitterParams = {\n\t\t\tseparator,\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tkeepSeparator: false,\n\t\t};\n\n\t\tconst splitter = new CharacterTextSplitter(params);\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAsC;AACtC,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,kCAAuD;AAAA,EAA7D;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,UAAU,CAAC;AAAA,QAC7D;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,+BAA+B;AAEjD,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,eAAe,KAAK,iBAAiB,gBAAgB,SAAS;AAEpE,UAAM,SAAsC;AAAA,MAC3C;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IAChB;AAEA,UAAM,WAAW,IAAI,2CAAsB,MAAM;AAEjD,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
@@ -68,9 +68,7 @@ class TextSplitterRecursiveCharacterTextSplitter {
68
68
  ]
69
69
  }
70
70
  },
71
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
72
71
  inputs: [],
73
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
74
72
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiTextSplitter],
75
73
  outputNames: ["Text Splitter"],
76
74
  properties: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type {\n\tRecursiveCharacterTextSplitterParams,\n\tSupportedTextSplitterLanguage,\n} from '@langchain/textsplitters';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nconst supportedLanguages: SupportedTextSplitterLanguage[] = [\n\t'cpp',\n\t'go',\n\t'java',\n\t'js',\n\t'php',\n\t'proto',\n\t'python',\n\t'rst',\n\t'ruby',\n\t'rust',\n\t'scala',\n\t'swift',\n\t'markdown',\n\t'latex',\n\t'html',\n];\nexport class TextSplitterRecursiveCharacterTextSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Recursive Character Text Splitter',\n\t\tname: 'textSplitterRecursiveCharacterTextSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by characters recursively, recommended for most use cases',\n\t\tdefaults: {\n\t\t\tname: 'Recursive Character Text Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplitterrecursivecharactertextsplitter/',\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.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\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: 'Split Code',\n\t\t\t\t\t\tname: 'splitCode',\n\t\t\t\t\t\tdefault: 'markdown',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: supportedLanguages.map((lang) => ({ name: lang, value: lang })),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\t\tconst splitCode = this.getNodeParameter(\n\t\t\t'options.splitCode',\n\t\t\titemIndex,\n\t\t\tnull,\n\t\t) as SupportedTextSplitterLanguage | null;\n\t\tconst params: RecursiveCharacterTextSplitterParams = {\n\t\t\t// TODO: These are the default values, should we allow the user to change them?\n\t\t\tseparators: ['\\n\\n', '\\n', ' ', ''],\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tkeepSeparator: false,\n\t\t};\n\t\tlet splitter: RecursiveCharacterTextSplitter;\n\n\t\tif (splitCode && supportedLanguages.includes(splitCode)) {\n\t\t\tsplitter = RecursiveCharacterTextSplitter.fromLanguage(splitCode, params);\n\t\t} else {\n\t\t\tsplitter = new RecursiveCharacterTextSplitter(params);\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,2BAA+C;AAC/C,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAE7C,MAAM,qBAAsD;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACO,MAAM,2CAAgE;AAAA,EAAtE;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;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,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,UAAU,CAAC;AAAA,QAC7D;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SAAS,mBAAmB,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,OAAO,KAAK,EAAE;AAAA,YACxE;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,+BAA+B;AAEjD,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,eAAe,KAAK,iBAAiB,gBAAgB,SAAS;AACpE,UAAM,YAAY,KAAK;AAAA,MACtB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,UAAM,SAA+C;AAAA;AAAA,MAEpD,YAAY,CAAC,QAAQ,MAAM,KAAK,EAAE;AAAA,MAClC;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IAChB;AACA,QAAI;AAEJ,QAAI,aAAa,mBAAmB,SAAS,SAAS,GAAG;AACxD,iBAAW,oDAA+B,aAAa,WAAW,MAAM;AAAA,IACzE,OAAO;AACN,iBAAW,IAAI,oDAA+B,MAAM;AAAA,IACrD;AAEA,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.ts"],"sourcesContent":["import type {\n\tRecursiveCharacterTextSplitterParams,\n\tSupportedTextSplitterLanguage,\n} from '@langchain/textsplitters';\nimport { RecursiveCharacterTextSplitter } from '@langchain/textsplitters';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nconst supportedLanguages: SupportedTextSplitterLanguage[] = [\n\t'cpp',\n\t'go',\n\t'java',\n\t'js',\n\t'php',\n\t'proto',\n\t'python',\n\t'rst',\n\t'ruby',\n\t'rust',\n\t'scala',\n\t'swift',\n\t'markdown',\n\t'latex',\n\t'html',\n];\nexport class TextSplitterRecursiveCharacterTextSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Recursive Character Text Splitter',\n\t\tname: 'textSplitterRecursiveCharacterTextSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by characters recursively, recommended for most use cases',\n\t\tdefaults: {\n\t\t\tname: 'Recursive Character Text Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplitterrecursivecharactertextsplitter/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\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: 'Split Code',\n\t\t\t\t\t\tname: 'splitCode',\n\t\t\t\t\t\tdefault: 'markdown',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: supportedLanguages.map((lang) => ({ name: lang, value: lang })),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\t\tconst splitCode = this.getNodeParameter(\n\t\t\t'options.splitCode',\n\t\t\titemIndex,\n\t\t\tnull,\n\t\t) as SupportedTextSplitterLanguage | null;\n\t\tconst params: RecursiveCharacterTextSplitterParams = {\n\t\t\t// TODO: These are the default values, should we allow the user to change them?\n\t\t\tseparators: ['\\n\\n', '\\n', ' ', ''],\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tkeepSeparator: false,\n\t\t};\n\t\tlet splitter: RecursiveCharacterTextSplitter;\n\n\t\tif (splitCode && supportedLanguages.includes(splitCode)) {\n\t\t\tsplitter = RecursiveCharacterTextSplitter.fromLanguage(splitCode, params);\n\t\t} else {\n\t\t\tsplitter = new RecursiveCharacterTextSplitter(params);\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,2BAA+C;AAC/C,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAE7C,MAAM,qBAAsD;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACO,MAAM,2CAAgE;AAAA,EAAtE;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,UAAU,CAAC;AAAA,QAC7D;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,aAAa;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,UACV,SAAS;AAAA,YACR;AAAA,cACC,aAAa;AAAA,cACb,MAAM;AAAA,cACN,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SAAS,mBAAmB,IAAI,CAAC,UAAU,EAAE,MAAM,MAAM,OAAO,KAAK,EAAE;AAAA,YACxE;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,+BAA+B;AAEjD,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,eAAe,KAAK,iBAAiB,gBAAgB,SAAS;AACpE,UAAM,YAAY,KAAK;AAAA,MACtB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AACA,UAAM,SAA+C;AAAA;AAAA,MAEpD,YAAY,CAAC,QAAQ,MAAM,KAAK,EAAE;AAAA,MAClC;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IAChB;AACA,QAAI;AAEJ,QAAI,aAAa,mBAAmB,SAAS,SAAS,GAAG;AACxD,iBAAW,oDAA+B,aAAa,WAAW,MAAM;AAAA,IACzE,OAAO;AACN,iBAAW,IAAI,oDAA+B,MAAM;AAAA,IACrD;AAEA,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
@@ -51,9 +51,7 @@ class TextSplitterTokenSplitter {
51
51
  ]
52
52
  }
53
53
  },
54
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
55
54
  inputs: [],
56
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
57
55
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiTextSplitter],
58
56
  outputNames: ["Text Splitter"],
59
57
  properties: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { TokenTextSplitter } from './TokenTextSplitter';\n\nexport class TextSplitterTokenSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Token Splitter',\n\t\tname: 'textSplitterTokenSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by tokens',\n\t\tdefaults: {\n\t\t\tname: 'Token Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplittertokensplitter/',\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.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\n\t\tconst splitter = new TokenTextSplitter({\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tallowedSpecial: 'all',\n\t\t\tdisallowedSpecial: 'all',\n\t\t\tencodingName: 'cl100k_base',\n\t\t\tkeepSeparator: false,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAE7C,+BAAkC;AAE3B,MAAM,0BAA+C;AAAA,EAArD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;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,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,UAAU,CAAC;AAAA,QAC7D;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,+BAA+B;AAEjD,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,eAAe,KAAK,iBAAiB,gBAAgB,SAAS;AAEpE,UAAM,WAAW,IAAI,2CAAkB;AAAA,MACtC;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,eAAe;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.ts"],"sourcesContent":["import {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { TokenTextSplitter } from './TokenTextSplitter';\n\nexport class TextSplitterTokenSplitter implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Token Splitter',\n\t\tname: 'textSplitterTokenSplitter',\n\t\ticon: 'fa:grip-lines-vertical',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Split text into chunks by tokens',\n\t\tdefaults: {\n\t\t\tname: 'Token Splitter',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Text Splitters'],\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.textsplittertokensplitter/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTextSplitter],\n\t\toutputNames: ['Text Splitter'],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiDocument]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Size',\n\t\t\t\tname: 'chunkSize',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 1000,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Chunk Overlap',\n\t\t\t\tname: 'chunkOverlap',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 0,\n\t\t\t},\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tthis.logger.debug('Supply Data for Text Splitter');\n\n\t\tconst chunkSize = this.getNodeParameter('chunkSize', itemIndex) as number;\n\t\tconst chunkOverlap = this.getNodeParameter('chunkOverlap', itemIndex) as number;\n\n\t\tconst splitter = new TokenTextSplitter({\n\t\t\tchunkSize,\n\t\t\tchunkOverlap,\n\t\t\tallowedSpecial: 'all',\n\t\t\tdisallowedSpecial: 'all',\n\t\t\tencodingName: 'cl100k_base',\n\t\t\tkeepSeparator: false,\n\t\t});\n\n\t\treturn {\n\t\t\tresponse: logWrapper(splitter, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAE7C,+BAAkC;AAE3B,MAAM,0BAA+C;AAAA,EAArD;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,gBAAgB;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,cAAc;AAAA,MAC5C,aAAa,CAAC,eAAe;AAAA,MAC7B,YAAY;AAAA,YACX,kDAA6B,CAAC,wCAAoB,UAAU,CAAC;AAAA,QAC7D;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,QACA;AAAA,UACC,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QACV;AAAA,MACD;AAAA,IACD;AAAA;AAAA,EAEA,MAAM,WAAuC,WAAwC;AACpF,SAAK,OAAO,MAAM,+BAA+B;AAEjD,UAAM,YAAY,KAAK,iBAAiB,aAAa,SAAS;AAC9D,UAAM,eAAe,KAAK,iBAAiB,gBAAgB,SAAS;AAEpE,UAAM,WAAW,IAAI,2CAAkB;AAAA,MACtC;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,eAAe;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,MACN,cAAU,8BAAW,UAAU,IAAI;AAAA,IACpC;AAAA,EACD;AACD;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { TokenTextSplitterParams } from '@langchain/textsplitters';\nimport { TextSplitter } from '@langchain/textsplitters';\nimport type * as tiktoken from 'js-tiktoken';\n\nimport { hasLongSequentialRepeat } from '@utils/helpers';\nimport { getEncoding } from '@utils/tokenizer/tiktoken';\nimport { estimateTextSplitsByTokens } from '@utils/tokenizer/token-estimator';\n\n/**\n * Implementation of splitter which looks at tokens.\n * This is override of the LangChain TokenTextSplitter\n * to use the n8n tokenizer utility which uses local JSON encodings\n */\nexport class TokenTextSplitter extends TextSplitter implements TokenTextSplitterParams {\n\tstatic lc_name() {\n\t\treturn 'TokenTextSplitter';\n\t}\n\n\tencodingName: tiktoken.TiktokenEncoding;\n\n\tallowedSpecial: 'all' | string[];\n\n\tdisallowedSpecial: 'all' | string[];\n\n\tprivate tokenizer: tiktoken.Tiktoken | undefined;\n\n\tconstructor(fields?: Partial<TokenTextSplitterParams>) {\n\t\tsuper(fields);\n\n\t\tthis.encodingName = fields?.encodingName ?? 'cl100k_base';\n\t\tthis.allowedSpecial = fields?.allowedSpecial ?? [];\n\t\tthis.disallowedSpecial = fields?.disallowedSpecial ?? 'all';\n\t}\n\n\tasync splitText(text: string): Promise<string[]> {\n\t\ttry {\n\t\t\t// Validate input\n\t\t\tif (!text || typeof text !== 'string') {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Check for repetitive content\n\t\t\tif (hasLongSequentialRepeat(text)) {\n\t\t\t\tconst splits = estimateTextSplitsByTokens(\n\t\t\t\t\ttext,\n\t\t\t\t\tthis.chunkSize,\n\t\t\t\t\tthis.chunkOverlap,\n\t\t\t\t\tthis.encodingName,\n\t\t\t\t);\n\t\t\t\treturn splits;\n\t\t\t}\n\n\t\t\t// Use tiktoken for normal text\n\t\t\ttry {\n\t\t\t\tif (!this.tokenizer) {\n\t\t\t\t\tthis.tokenizer = await getEncoding(this.encodingName);\n\t\t\t\t}\n\n\t\t\t\tconst splits: string[] = [];\n\t\t\t\tconst input_ids = this.tokenizer.encode(text, this.allowedSpecial, this.disallowedSpecial);\n\n\t\t\t\tlet start_idx = 0;\n\t\t\t\tlet chunkCount = 0;\n\n\t\t\t\twhile (start_idx < input_ids.length) {\n\t\t\t\t\tif (start_idx > 0) {\n\t\t\t\t\t\tstart_idx = Math.max(0, start_idx - this.chunkOverlap);\n\t\t\t\t\t}\n\t\t\t\t\tconst end_idx = Math.min(start_idx + this.chunkSize, input_ids.length);\n\t\t\t\t\tconst chunk_ids = input_ids.slice(start_idx, end_idx);\n\n\t\t\t\t\tsplits.push(this.tokenizer.decode(chunk_ids));\n\n\t\t\t\t\tchunkCount++;\n\t\t\t\t\tstart_idx = end_idx;\n\t\t\t\t}\n\n\t\t\t\treturn splits;\n\t\t\t} catch (tiktokenError) {\n\t\t\t\t// Fall back to character-based splitting if tiktoken fails\n\t\t\t\treturn estimateTextSplitsByTokens(\n\t\t\t\t\ttext,\n\t\t\t\t\tthis.chunkSize,\n\t\t\t\t\tthis.chunkOverlap,\n\t\t\t\t\tthis.encodingName,\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Return empty array on complete failure\n\t\t\treturn [];\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAG7B,qBAAwC;AACxC,sBAA4B;AAC5B,6BAA2C;AAOpC,MAAM,0BAA0B,kCAAgD;AAAA,EACtF,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EAUA,YAAY,QAA2C;AACtD,UAAM,MAAM;AAEZ,SAAK,eAAe,QAAQ,gBAAgB;AAC5C,SAAK,iBAAiB,QAAQ,kBAAkB,CAAC;AACjD,SAAK,oBAAoB,QAAQ,qBAAqB;AAAA,EACvD;AAAA,EAEA,MAAM,UAAU,MAAiC;AAChD,QAAI;AAEH,UAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACtC,eAAO,CAAC;AAAA,MACT;AAGA,cAAI,wCAAwB,IAAI,GAAG;AAClC,cAAM,aAAS;AAAA,UACd;AAAA,UACA,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,QACN;AACA,eAAO;AAAA,MACR;AAGA,UAAI;AACH,YAAI,CAAC,KAAK,WAAW;AACpB,eAAK,YAAY,UAAM,6BAAY,KAAK,YAAY;AAAA,QACrD;AAEA,cAAM,SAAmB,CAAC;AAC1B,cAAM,YAAY,KAAK,UAAU,OAAO,MAAM,KAAK,gBAAgB,KAAK,iBAAiB;AAEzF,YAAI,YAAY;AAChB,YAAI,aAAa;AAEjB,eAAO,YAAY,UAAU,QAAQ;AACpC,cAAI,YAAY,GAAG;AAClB,wBAAY,KAAK,IAAI,GAAG,YAAY,KAAK,YAAY;AAAA,UACtD;AACA,gBAAM,UAAU,KAAK,IAAI,YAAY,KAAK,WAAW,UAAU,MAAM;AACrE,gBAAM,YAAY,UAAU,MAAM,WAAW,OAAO;AAEpD,iBAAO,KAAK,KAAK,UAAU,OAAO,SAAS,CAAC;AAE5C;AACA,sBAAY;AAAA,QACb;AAEA,eAAO;AAAA,MACR,SAAS,eAAe;AAEvB,mBAAO;AAAA,UACN;AAAA,UACA,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD,SAAS,OAAO;AAEf,aAAO,CAAC;AAAA,IACT;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.ts"],"sourcesContent":["import type { TokenTextSplitterParams } from '@langchain/textsplitters';\nimport { TextSplitter } from '@langchain/textsplitters';\nimport type * as tiktoken from 'js-tiktoken';\n\nimport { hasLongSequentialRepeat } from '@utils/helpers';\nimport { getEncoding } from '@utils/tokenizer/tiktoken';\nimport { estimateTextSplitsByTokens } from '@utils/tokenizer/token-estimator';\n\n/**\n * Implementation of splitter which looks at tokens.\n * This is override of the LangChain TokenTextSplitter\n * to use the n8n tokenizer utility which uses local JSON encodings\n */\nexport class TokenTextSplitter extends TextSplitter implements TokenTextSplitterParams {\n\tstatic lc_name() {\n\t\treturn 'TokenTextSplitter';\n\t}\n\n\tencodingName: tiktoken.TiktokenEncoding;\n\n\tallowedSpecial: 'all' | string[];\n\n\tdisallowedSpecial: 'all' | string[];\n\n\tprivate tokenizer: tiktoken.Tiktoken | undefined;\n\n\tconstructor(fields?: Partial<TokenTextSplitterParams>) {\n\t\tsuper(fields);\n\n\t\tthis.encodingName = fields?.encodingName ?? 'cl100k_base';\n\t\tthis.allowedSpecial = fields?.allowedSpecial ?? [];\n\t\tthis.disallowedSpecial = fields?.disallowedSpecial ?? 'all';\n\t}\n\n\tasync splitText(text: string): Promise<string[]> {\n\t\ttry {\n\t\t\t// Validate input\n\t\t\tif (!text || typeof text !== 'string') {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Check for repetitive content\n\t\t\tif (hasLongSequentialRepeat(text)) {\n\t\t\t\tconst splits = estimateTextSplitsByTokens(\n\t\t\t\t\ttext,\n\t\t\t\t\tthis.chunkSize,\n\t\t\t\t\tthis.chunkOverlap,\n\t\t\t\t\tthis.encodingName,\n\t\t\t\t);\n\t\t\t\treturn splits;\n\t\t\t}\n\n\t\t\t// Use tiktoken for normal text\n\t\t\ttry {\n\t\t\t\tif (!this.tokenizer) {\n\t\t\t\t\tthis.tokenizer = await getEncoding(this.encodingName);\n\t\t\t\t}\n\n\t\t\t\tconst splits: string[] = [];\n\t\t\t\tconst input_ids = this.tokenizer.encode(text, this.allowedSpecial, this.disallowedSpecial);\n\n\t\t\t\tlet start_idx = 0;\n\t\t\t\tlet chunkCount = 0;\n\n\t\t\t\twhile (start_idx < input_ids.length) {\n\t\t\t\t\tif (start_idx > 0) {\n\t\t\t\t\t\tstart_idx = Math.max(0, start_idx - this.chunkOverlap);\n\t\t\t\t\t}\n\t\t\t\t\tconst end_idx = Math.min(start_idx + this.chunkSize, input_ids.length);\n\t\t\t\t\tconst chunk_ids = input_ids.slice(start_idx, end_idx);\n\n\t\t\t\t\tsplits.push(this.tokenizer.decode(chunk_ids));\n\n\t\t\t\t\tchunkCount++;\n\t\t\t\t\tstart_idx = end_idx;\n\t\t\t\t}\n\n\t\t\t\treturn splits;\n\t\t\t} catch (tiktokenError) {\n\t\t\t\t// Fall back to character-based splitting if tiktoken fails\n\t\t\t\treturn estimateTextSplitsByTokens(\n\t\t\t\t\ttext,\n\t\t\t\t\tthis.chunkSize,\n\t\t\t\t\tthis.chunkOverlap,\n\t\t\t\t\tthis.encodingName,\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Return empty array on complete failure\n\t\t\treturn [];\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAA6B;AAG7B,qBAAwC;AACxC,sBAA4B;AAC5B,6BAA2C;AAOpC,MAAM,0BAA0B,kCAAgD;AAAA,EACtF,OAAO,UAAU;AAChB,WAAO;AAAA,EACR;AAAA,EAUA,YAAY,QAA2C;AACtD,UAAM,MAAM;AAEZ,SAAK,eAAe,QAAQ,gBAAgB;AAC5C,SAAK,iBAAiB,QAAQ,kBAAkB,CAAC;AACjD,SAAK,oBAAoB,QAAQ,qBAAqB;AAAA,EACvD;AAAA,EAEA,MAAM,UAAU,MAAiC;AAChD,QAAI;AAEH,UAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACtC,eAAO,CAAC;AAAA,MACT;AAGA,cAAI,wCAAwB,IAAI,GAAG;AAClC,cAAM,aAAS;AAAA,UACd;AAAA,UACA,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,QACN;AACA,eAAO;AAAA,MACR;AAGA,UAAI;AACH,YAAI,CAAC,KAAK,WAAW;AACpB,eAAK,YAAY,UAAM,6BAAY,KAAK,YAAY;AAAA,QACrD;AAEA,cAAM,SAAmB,CAAC;AAC1B,cAAM,YAAY,KAAK,UAAU,OAAO,MAAM,KAAK,gBAAgB,KAAK,iBAAiB;AAEzF,YAAI,YAAY;AAChB,YAAI,aAAa;AAEjB,eAAO,YAAY,UAAU,QAAQ;AACpC,cAAI,YAAY,GAAG;AAClB,wBAAY,KAAK,IAAI,GAAG,YAAY,KAAK,YAAY;AAAA,UACtD;AACA,gBAAM,UAAU,KAAK,IAAI,YAAY,KAAK,WAAW,UAAU,MAAM;AACrE,gBAAM,YAAY,UAAU,MAAM,WAAW,OAAO;AAEpD,iBAAO,KAAK,KAAK,UAAU,OAAO,SAAS,CAAC;AAE5C;AACA,sBAAY;AAAA,QACb;AAEA,eAAO;AAAA,MACR,SAAS,eAAe;AAEvB,mBAAO;AAAA,UACN;AAAA,UACA,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD,SAAS,OAAO;AAEf,aAAO,CAAC;AAAA,IACT;AAAA,EACD;AACD;","names":[]}
@@ -52,9 +52,7 @@ class ToolCalculator {
52
52
  ]
53
53
  }
54
54
  },
55
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
56
55
  inputs: [],
57
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
58
56
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool],
59
57
  outputNames: ["Tool"],
60
58
  properties: [(0, import_sharedFields.getConnectionHintNoticeField)([import_n8n_workflow.NodeConnectionTypes.AiAgent])]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/tools/ToolCalculator/ToolCalculator.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport { Calculator } from '@langchain/community/tools/calculator';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class ToolCalculator implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Calculator',\n\t\tname: 'toolCalculator',\n\t\ticon: 'fa:calculator',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Make it easier for AI agents to perform arithmetic',\n\t\tdefaults: {\n\t\t\tname: 'Calculator',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Tools'],\n\t\t\t\tTools: ['Other Tools'],\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.toolcalculator/',\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.AiTool],\n\t\toutputNames: ['Tool'],\n\t\tproperties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions): Promise<SupplyData> {\n\t\treturn {\n\t\t\tresponse: logWrapper(new Calculator(), this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA2B;AAC3B,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,OAAO;AAAA,UACZ,OAAO,CAAC,aAAa;AAAA,QACtB;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,MAAM;AAAA,MACpC,aAAa,CAAC,MAAM;AAAA,MACpB,YAAY,KAAC,kDAA6B,CAAC,wCAAoB,OAAO,CAAC,CAAC;AAAA,IACzE;AAAA;AAAA,EAEA,MAAM,aAA4D;AACjE,WAAO;AAAA,MACN,cAAU,8BAAW,IAAI,6BAAW,GAAG,IAAI;AAAA,IAC5C;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/tools/ToolCalculator/ToolCalculator.node.ts"],"sourcesContent":["import { Calculator } from '@langchain/community/tools/calculator';\nimport {\n\tNodeConnectionTypes,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype ISupplyDataFunctions,\n\ttype SupplyData,\n} from 'n8n-workflow';\n\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nexport class ToolCalculator implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Calculator',\n\t\tname: 'toolCalculator',\n\t\ticon: 'fa:calculator',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: 1,\n\t\tdescription: 'Make it easier for AI agents to perform arithmetic',\n\t\tdefaults: {\n\t\t\tname: 'Calculator',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Tools'],\n\t\t\t\tTools: ['Other Tools'],\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.toolcalculator/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\n\t\tinputs: [],\n\n\t\toutputs: [NodeConnectionTypes.AiTool],\n\t\toutputNames: ['Tool'],\n\t\tproperties: [getConnectionHintNoticeField([NodeConnectionTypes.AiAgent])],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions): Promise<SupplyData> {\n\t\treturn {\n\t\t\tresponse: logWrapper(new Calculator(), this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA2B;AAC3B,0BAMO;AAEP,wBAA2B;AAC3B,0BAA6C;AAEtC,MAAM,eAAoC;AAAA,EAA1C;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,OAAO;AAAA,UACZ,OAAO,CAAC,aAAa;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MAEA,QAAQ,CAAC;AAAA,MAET,SAAS,CAAC,wCAAoB,MAAM;AAAA,MACpC,aAAa,CAAC,MAAM;AAAA,MACpB,YAAY,KAAC,kDAA6B,CAAC,wCAAoB,OAAO,CAAC,CAAC;AAAA,IACzE;AAAA;AAAA,EAEA,MAAM,aAA4D;AACjE,WAAO;AAAA,MACN,cAAU,8BAAW,IAAI,6BAAW,GAAG,IAAI;AAAA,IAC5C;AAAA,EACD;AACD;","names":[]}
@@ -67,9 +67,7 @@ class ToolCode {
67
67
  ]
68
68
  }
69
69
  },
70
- // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
71
70
  inputs: [],
72
- // eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong
73
71
  outputs: [import_n8n_workflow.NodeConnectionTypes.AiTool],
74
72
  outputNames: ["Tool"],
75
73
  properties: [