@n8n/n8n-nodes-langchain 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +85 -0
- package/README.md +13 -0
- package/dist/credentials/AnthropicApi.credentials.d.ts +9 -0
- package/dist/credentials/AnthropicApi.credentials.js +45 -0
- package/dist/credentials/AnthropicApi.credentials.js.map +1 -0
- package/dist/credentials/CohereApi.credentials.d.ts +9 -0
- package/dist/credentials/CohereApi.credentials.js +40 -0
- package/dist/credentials/CohereApi.credentials.js.map +1 -0
- package/dist/credentials/GooglePalmApi.credentials.d.ts +9 -0
- package/dist/credentials/GooglePalmApi.credentials.js +42 -0
- package/dist/credentials/GooglePalmApi.credentials.js.map +1 -0
- package/dist/credentials/HuggingFaceApi.credentials.d.ts +9 -0
- package/dist/credentials/HuggingFaceApi.credentials.js +36 -0
- package/dist/credentials/HuggingFaceApi.credentials.js.map +1 -0
- package/dist/credentials/MotorheadApi.credentials.d.ts +9 -0
- package/dist/credentials/MotorheadApi.credentials.js +49 -0
- package/dist/credentials/MotorheadApi.credentials.js.map +1 -0
- package/dist/credentials/OllamaApi.credentials.d.ts +8 -0
- package/dist/credentials/OllamaApi.credentials.js +35 -0
- package/dist/credentials/OllamaApi.credentials.js.map +1 -0
- package/dist/credentials/PineconeApi.credentials.d.ts +8 -0
- package/dist/credentials/PineconeApi.credentials.js +37 -0
- package/dist/credentials/PineconeApi.credentials.js.map +1 -0
- package/dist/credentials/SerpApi.credentials.d.ts +9 -0
- package/dist/credentials/SerpApi.credentials.js +36 -0
- package/dist/credentials/SerpApi.credentials.js.map +1 -0
- package/dist/credentials/WolframAlphaApi.credentials.d.ts +9 -0
- package/dist/credentials/WolframAlphaApi.credentials.js +40 -0
- package/dist/credentials/WolframAlphaApi.credentials.js.map +1 -0
- package/dist/credentials/XataApi.credentials.d.ts +9 -0
- package/dist/credentials/XataApi.credentials.js +50 -0
- package/dist/credentials/XataApi.credentials.js.map +1 -0
- package/dist/credentials/ZepApi.credentials.d.ts +9 -0
- package/dist/credentials/ZepApi.credentials.js +43 -0
- package/dist/credentials/ZepApi.credentials.js.map +1 -0
- package/dist/nodes/agents/Agent/Agent.node.d.ts +5 -0
- package/dist/nodes/agents/Agent/Agent.node.js +188 -0
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +41 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +58 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +17 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +53 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +17 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +46 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +113 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +64 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.d.ts +3 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js +21 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.d.ts +3 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js +21 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/postgres.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.d.ts +3 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js +53 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.d.ts +2 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js +21 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.d.ts +5 -0
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +152 -0
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.d.ts +5 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +100 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.d.ts +5 -0
- package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +140 -0
- package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -0
- package/dist/nodes/code/Code.node.d.ts +7 -0
- package/dist/nodes/code/Code.node.js +296 -0
- package/dist/nodes/code/Code.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.d.ts +5 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +148 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/binary.svg +3 -0
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.d.ts +5 -0
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +105 -0
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentGithubLoader/github.svg +1 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.d.ts +5 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +61 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/json.svg +48 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +89 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg +93 -0
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.js +121 -0
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/google.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +71 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg +8 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +94 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/openAi.svg +7 -0
- package/dist/nodes/embeddings/EmbeddingsTensorFlow/EmbeddingsTensorFlow.node.d.ts +6 -0
- package/dist/nodes/embeddings/EmbeddingsTensorFlow/EmbeddingsTensorFlow.node.js +54 -0
- package/dist/nodes/embeddings/EmbeddingsTensorFlow/EmbeddingsTensorFlow.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsTensorFlow/tensorflow.svg +49 -0
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.d.ts +5 -0
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +118 -0
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -0
- package/dist/nodes/llms/LMChatAnthropic/anthropic.png +0 -0
- package/dist/nodes/llms/LMChatAnthropic/anthropic.svg +1 -0
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.d.ts +5 -0
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +119 -0
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -0
- package/dist/nodes/llms/LMChatOllama/ollama.svg +43 -0
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.d.ts +5 -0
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +175 -0
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LMChatOpenAi/openAi.svg +7 -0
- package/dist/nodes/llms/LMCohere/LmCohere.node.d.ts +5 -0
- package/dist/nodes/llms/LMCohere/LmCohere.node.js +93 -0
- package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -0
- package/dist/nodes/llms/LMCohere/cohere.svg +93 -0
- package/dist/nodes/llms/LMOllama/LmOllama.node.d.ts +5 -0
- package/dist/nodes/llms/LMOllama/LmOllama.node.js +119 -0
- package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -0
- package/dist/nodes/llms/LMOllama/ollama.svg +43 -0
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.d.ts +5 -0
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +175 -0
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LMOpenAi/openAi.svg +7 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.d.ts +5 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +126 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/huggingface.svg +8 -0
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.d.ts +5 -0
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.js +150 -0
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.js.map +1 -0
- package/dist/nodes/llms/LmChatGooglePalm/google.svg +1 -0
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.d.ts +5 -0
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.js +157 -0
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.js.map +1 -0
- package/dist/nodes/llms/LmGooglePalm/google.svg +1 -0
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +108 -0
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -0
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +85 -0
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -0
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +70 -0
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -0
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +103 -0
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -0
- package/dist/nodes/memory/MemoryRedisChat/redis.svg +1 -0
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +84 -0
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -0
- package/dist/nodes/memory/MemoryXata/xata.svg +1 -0
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.d.ts +5 -0
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +70 -0
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -0
- package/dist/nodes/memory/MemoryZep/zep.png +0 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.d.ts +5 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +60 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserItemList/ItemListOutputParser.d.ts +12 -0
- package/dist/nodes/output_parser/OutputParserItemList/ItemListOutputParser.js +40 -0
- package/dist/nodes/output_parser/OutputParserItemList/ItemListOutputParser.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.d.ts +5 -0
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +71 -0
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.d.ts +5 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +97 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -0
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.d.ts +5 -0
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +71 -0
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -0
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.d.ts +5 -0
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +62 -0
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.d.ts +5 -0
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +75 -0
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.d.ts +5 -0
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +67 -0
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.d.ts +5 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +69 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -0
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.d.ts +5 -0
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +44 -0
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -0
- package/dist/nodes/tools/ToolCode/ToolCode.node.d.ts +5 -0
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +179 -0
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.d.ts +5 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +112 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -0
- package/dist/nodes/tools/ToolSerpApi/serpApi.svg +13 -0
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.d.ts +5 -0
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +44 -0
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -0
- package/dist/nodes/tools/ToolWikipedia/wikipedia.svg +41 -0
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.d.ts +5 -0
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +51 -0
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -0
- package/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg +23 -0
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.d.ts +5 -0
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +355 -0
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.d.ts +5 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +63 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +66 -0
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +122 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/pinecone.svg +1 -0
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +87 -0
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePineconeLoad/pinecone.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +115 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/supabase.svg +15 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +107 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/supabase.svg +15 -0
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +124 -0
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreZepInsert/zep.png +0 -0
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +93 -0
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreZepLoad/zep.png +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/EpubLoader.d.ts +16 -0
- package/dist/utils/EpubLoader.js +53 -0
- package/dist/utils/EpubLoader.js.map +1 -0
- package/dist/utils/N8nBinaryLoader.d.ts +7 -0
- package/dist/utils/N8nBinaryLoader.js +92 -0
- package/dist/utils/N8nBinaryLoader.js.map +1 -0
- package/dist/utils/N8nJsonLoader.d.ts +7 -0
- package/dist/utils/N8nJsonLoader.js +30 -0
- package/dist/utils/N8nJsonLoader.js.map +1 -0
- package/dist/utils/logWrapper.d.ts +31 -0
- package/dist/utils/logWrapper.js +321 -0
- package/dist/utils/logWrapper.js.map +1 -0
- package/index.js +0 -0
- package/package.json +135 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryRedisChat = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const memory_1 = require("langchain/memory");
|
|
6
|
+
const redis_1 = require("langchain/stores/message/redis");
|
|
7
|
+
const redis_2 = require("redis");
|
|
8
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
9
|
+
class MemoryRedisChat {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Redis Chat Memory',
|
|
13
|
+
name: 'memoryRedisChat',
|
|
14
|
+
icon: 'file:redis.svg',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
description: 'Stores the chat history in Redis.',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Redis Chat Memory',
|
|
20
|
+
},
|
|
21
|
+
credentials: [
|
|
22
|
+
{
|
|
23
|
+
name: 'redis',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
codex: {
|
|
28
|
+
categories: ['AI'],
|
|
29
|
+
subcategories: {
|
|
30
|
+
AI: ['Memory'],
|
|
31
|
+
},
|
|
32
|
+
resources: {
|
|
33
|
+
primaryDocumentation: [
|
|
34
|
+
{
|
|
35
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryredischat/',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
inputs: [],
|
|
41
|
+
outputs: ["ai_memory"],
|
|
42
|
+
outputNames: ['Memory'],
|
|
43
|
+
properties: [
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Session Key',
|
|
46
|
+
name: 'sessionKey',
|
|
47
|
+
type: 'string',
|
|
48
|
+
default: 'chat_history',
|
|
49
|
+
description: 'The key to use to store the memory in the workflow data',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Session Time To Live',
|
|
53
|
+
name: 'sessionTTL',
|
|
54
|
+
type: 'number',
|
|
55
|
+
default: 0,
|
|
56
|
+
description: 'For how long the session should be stored in seconds. If set to 0 it will not expire.',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async supplyData() {
|
|
62
|
+
const credentials = await this.getCredentials('redis');
|
|
63
|
+
const sessionKey = this.getNodeParameter('sessionKey', 0);
|
|
64
|
+
const sessionTTL = this.getNodeParameter('sessionTTL', 0, 0);
|
|
65
|
+
const redisOptions = {
|
|
66
|
+
socket: {
|
|
67
|
+
host: credentials.host,
|
|
68
|
+
port: credentials.port,
|
|
69
|
+
},
|
|
70
|
+
database: credentials.database,
|
|
71
|
+
};
|
|
72
|
+
if (credentials.password) {
|
|
73
|
+
redisOptions.password = credentials.password;
|
|
74
|
+
}
|
|
75
|
+
const client = (0, redis_2.createClient)({
|
|
76
|
+
...redisOptions,
|
|
77
|
+
});
|
|
78
|
+
client.on('error', async (error) => {
|
|
79
|
+
await client.quit();
|
|
80
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Redis Error: ' + error.message);
|
|
81
|
+
});
|
|
82
|
+
const redisChatConfig = {
|
|
83
|
+
client,
|
|
84
|
+
sessionId: sessionKey,
|
|
85
|
+
};
|
|
86
|
+
if (sessionTTL > 0) {
|
|
87
|
+
redisChatConfig.sessionTTL = sessionTTL;
|
|
88
|
+
}
|
|
89
|
+
const redisChatHistory = new redis_1.RedisChatMessageHistory(redisChatConfig);
|
|
90
|
+
const memory = new memory_1.BufferMemory({
|
|
91
|
+
memoryKey: 'chat_history',
|
|
92
|
+
chatHistory: redisChatHistory,
|
|
93
|
+
returnMessages: true,
|
|
94
|
+
inputKey: 'input',
|
|
95
|
+
outputKey: 'output',
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
response: (0, logWrapper_1.logWrapper)(memory, this),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.MemoryRedisChat = MemoryRedisChat;
|
|
103
|
+
//# sourceMappingURL=MemoryRedisChat.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryRedisChat.node.js","sourceRoot":"","sources":["../../../../nodes/memory/MemoryRedisChat/MemoryRedisChat.node.ts"],"names":[],"mappings":";;;AACA,+CAOsB;AACtB,6CAAgD;AAEhD,0DAAyE;AAEzE,iCAAqC;AACrC,0DAAuD;AAEvD,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE;gBACT,IAAI,EAAE,mBAAmB;aACzB;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,OAAO;oBACb,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,QAAQ,CAAC;iBACd;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,uGAAuG;yBAC5G;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,aAA6B;YACtC,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,cAAc;oBACvB,WAAW,EAAE,yDAAyD;iBACtE;gBACD;oBACC,WAAW,EAAE,sBAAsB;oBACnC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,CAAC;oBACV,WAAW,EACV,uFAAuF;iBACxF;aACD;SACD,CAAC;IAkDH,CAAC;IAhDA,KAAK,CAAC,UAAU;QACf,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAW,CAAC;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAW,CAAC;QAEvE,MAAM,YAAY,GAAuB;YACxC,MAAM,EAAE;gBACP,IAAI,EAAE,WAAW,CAAC,IAAc;gBAChC,IAAI,EAAE,WAAW,CAAC,IAAc;aAChC;YACD,QAAQ,EAAE,WAAW,CAAC,QAAkB;SACxC,CAAC;QAEF,IAAI,WAAW,CAAC,QAAQ,EAAE;YACzB,YAAY,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAkB,CAAC;SACvD;QAED,MAAM,MAAM,GAAG,IAAA,oBAAY,EAAC;YAC3B,GAAG,YAAY;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAY,EAAE,EAAE;YACzC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAiC;YACrD,MAAM;YACN,SAAS,EAAE,UAAU;SACrB,CAAC;QAEF,IAAI,UAAU,GAAG,CAAC,EAAE;YACnB,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;SACxC;QACD,MAAM,gBAAgB,GAAG,IAAI,+BAAuB,CAAC,eAAe,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;YAC/B,SAAS,EAAE,cAAc;YACzB,WAAW,EAAE,gBAAgB;YAC7B,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AAtGD,0CAsGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M57.656 43.99c-3.201 1.683-19.787 8.561-23.318 10.417-3.532 1.856-5.494 1.838-8.283.494-2.79-1.343-20.449-8.535-23.629-10.067C.834 44.066.002 43.422.002 42.811v-6.117s22.98-5.045 26.69-6.388c3.711-1.342 4.995-1.39 8.154-.225 3.16 1.165 22.035 4.603 25.154 5.756v6.032c0 .605-.72 1.283-2.35 2.124l.006-.003z" fill="#A41E11"/><path d="M57.656 37.872c-3.201 1.685-19.787 8.56-23.318 10.417-3.532 1.856-5.494 1.838-8.283.494-2.79-1.343-20.449-8.534-23.63-10.068-3.18-1.533-3.243-2.588-.122-3.82l24.388-9.52c3.71-1.34 4.994-1.39 8.153-.225 3.16 1.165 19.643 7.78 22.747 8.951 3.103 1.17 3.24 2.086.037 3.786l.028-.015z" fill="#D82C20"/><path d="M57.656 34.015c-3.201 1.683-19.787 8.561-23.318 10.417-3.532 1.856-5.494 1.838-8.283.495-2.79-1.344-20.449-8.536-23.629-10.067C.834 34.092.002 33.447.002 32.836V26.72s22.98-5.045 26.69-6.387c3.711-1.343 4.995-1.39 8.154-.225 3.16 1.165 22.035 4.602 25.154 5.756v6.032c0 .605-.72 1.283-2.35 2.123l.006-.003z" fill="#A41E11"/><path d="M57.656 27.898c-3.201 1.685-19.787 8.561-23.318 10.417-3.532 1.856-5.494 1.838-8.283.495-2.79-1.344-20.449-8.534-23.63-10.067-3.18-1.534-3.243-2.588-.122-3.82l24.388-9.52c3.71-1.343 4.994-1.39 8.153-.225 3.16 1.166 19.644 7.785 22.765 8.935 3.121 1.15 3.24 2.085.038 3.785h.01z" fill="#D82C20"/><path d="M57.656 23.671c-3.201 1.683-19.787 8.561-23.318 10.419-3.532 1.858-5.494 1.838-8.283.495-2.79-1.344-20.449-8.535-23.629-10.069-1.592-.765-2.424-1.411-2.424-2.02v-6.11s22.98-5.045 26.69-6.388c3.711-1.343 4.995-1.39 8.154-.225 3.16 1.165 22.035 4.591 25.154 5.745v6.032c0 .605-.72 1.283-2.35 2.123l.006-.002z" fill="#A41E11"/><path d="M57.656 17.553c-3.201 1.685-19.787 8.561-23.318 10.417-3.532 1.856-5.494 1.838-8.283.495-2.79-1.344-20.449-8.534-23.63-10.068-3.18-1.533-3.243-2.587-.122-3.82l24.388-9.52c3.71-1.343 4.994-1.39 8.153-.226 3.16 1.165 19.643 7.785 22.765 8.936 3.122 1.15 3.24 2.085.038 3.785l.01.001z" fill="#D82C20"/><path d="M31.497 15.032l-1.88-3.153-6.002-.545 4.48-1.63L26.75 7.2l4.192 1.653 3.955-1.305-1.07 2.586 4.032 1.524-5.198.546-1.164 2.827zm-10.014 6.275l13.903-2.153-4.2 6.211-9.703-4.058zm-11.17-5.167c0-1.61 3.314-2.906 7.431-2.906 4.118 0 7.432 1.296 7.432 2.906s-3.314 2.905-7.432 2.905c-4.117 0-7.431-1.295-7.431-2.905z" fill="#FFF"/><path fill="#7A0C00" d="M52.233 15.714l-8.224 3.276-.007-6.556z"/><path fill="#AD2115" d="M44.01 18.991l-.89.353-8.217-3.276 9.094-3.63z"/></g></svg>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryXata = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const xata_1 = require("langchain/stores/message/xata");
|
|
6
|
+
const memory_1 = require("langchain/memory");
|
|
7
|
+
const client_1 = require("@xata.io/client");
|
|
8
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
9
|
+
class MemoryXata {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Xata',
|
|
13
|
+
name: 'memoryXata',
|
|
14
|
+
icon: 'file:xata.svg',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
description: 'Use Xata Memory',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Xata',
|
|
20
|
+
color: '#1321A7',
|
|
21
|
+
},
|
|
22
|
+
codex: {
|
|
23
|
+
categories: ['AI'],
|
|
24
|
+
subcategories: {
|
|
25
|
+
AI: ['Memory'],
|
|
26
|
+
},
|
|
27
|
+
resources: {
|
|
28
|
+
primaryDocumentation: [
|
|
29
|
+
{
|
|
30
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryxata/',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
inputs: [],
|
|
36
|
+
outputs: ["ai_memory"],
|
|
37
|
+
outputNames: ['Memory'],
|
|
38
|
+
credentials: [
|
|
39
|
+
{
|
|
40
|
+
name: 'xataApi',
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
properties: [
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Session ID',
|
|
47
|
+
name: 'sessionId',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: true,
|
|
50
|
+
default: '',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async supplyData() {
|
|
56
|
+
const credentials = await this.getCredentials('xataApi');
|
|
57
|
+
const itemIndex = 0;
|
|
58
|
+
const xataClient = new client_1.BaseClient({
|
|
59
|
+
apiKey: credentials.apiKey,
|
|
60
|
+
branch: credentials.branch || 'main',
|
|
61
|
+
databaseURL: credentials.databaseEndpoint,
|
|
62
|
+
});
|
|
63
|
+
const sessionId = this.getNodeParameter('sessionId', itemIndex);
|
|
64
|
+
const table = credentials.databaseEndpoint.match(/https:\/\/[^.]+\.[^.]+\.xata\.sh\/db\/([^\/:]+)/);
|
|
65
|
+
if (table === null) {
|
|
66
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'It was not possible to extract the table from the Database Endpoint.');
|
|
67
|
+
}
|
|
68
|
+
const memory = new memory_1.BufferMemory({
|
|
69
|
+
chatHistory: new xata_1.XataChatMessageHistory({
|
|
70
|
+
table: table[1],
|
|
71
|
+
sessionId,
|
|
72
|
+
client: xataClient,
|
|
73
|
+
apiKey: credentials.apiKey,
|
|
74
|
+
}),
|
|
75
|
+
memoryKey: 'chat_history',
|
|
76
|
+
returnMessages: true,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
response: (0, logWrapper_1.logWrapper)(memory, this),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.MemoryXata = MemoryXata;
|
|
84
|
+
//# sourceMappingURL=MemoryXata.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryXata.node.js","sourceRoot":"","sources":["../../../../nodes/memory/MemoryXata/MemoryXata.node.ts"],"names":[],"mappings":";;;AACA,+CAAsE;AAEtE,wDAAuE;AACvE,6CAAgD;AAChD,4CAA6C;AAC7C,0DAAuD;AACvD,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE;gBACT,IAAI,EAAE,MAAM;gBAEZ,KAAK,EAAE,SAAS;aAChB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,QAAQ,CAAC;iBACd;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,kGAAkG;yBACvG;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,aAA6B;YACtC,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;IAyCH,CAAC;IAvCA,KAAK,CAAC,UAAU;QACf,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAEzD,MAAM,SAAS,GAAG,CAAC,CAAC;QAEpB,MAAM,UAAU,GAAG,IAAI,mBAAU,CAAC;YACjC,MAAM,EAAE,WAAW,CAAC,MAAgB;YACpC,MAAM,EAAG,WAAW,CAAC,MAAiB,IAAI,MAAM;YAChD,WAAW,EAAE,WAAW,CAAC,gBAA0B;SACnD,CAAC,CAAC;QAGH,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAW,CAAC;QAE1E,MAAM,KAAK,GAAI,WAAW,CAAC,gBAA2B,CAAC,KAAK,CAC3D,iDAAiD,CACjD,CAAC;QAEF,IAAI,KAAK,KAAK,IAAI,EAAE;YACnB,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,sEAAsE,CACtE,CAAC;SACF;QAED,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;YAC/B,WAAW,EAAE,IAAI,6BAAsB,CAAC;gBACvC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBACf,SAAS;gBACT,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,WAAW,CAAC,MAAgB;aACpC,CAAC;YACF,SAAS,EAAE,cAAc;YACzB,cAAc,EAAE,IAAI;SACpB,CAAC,CAAC;QACH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AAvFD,gCAuFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="1600" height="1600" viewBox="0 0 1600 1600" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1250.12 576.498c-.11 89.997-36 176.267-99.79 239.83l-.01-.007-226.282 225.489c-7.841 7.82-20.58 7.84-27.927-.44-55.015-61.995-85.587-142.175-85.49-225.478.106-89.997 36-176.267 99.787-239.83l.007.007 206.745-206.014c18.63-18.569 49.12-18.702 64.92 2.324 43.99 58.525 68.12 130.089 68.04 204.119zM440.552 817.702c-63.787-63.563-99.682-149.833-99.787-239.83-.087-74.03 24.048-145.594 68.035-204.119 15.803-21.026 46.294-20.893 64.928-2.324l206.741 206.016.006-.007c63.787 63.564 99.681 149.833 99.787 239.831.097 83.302-30.475 163.483-85.49 225.471-7.347 8.28-20.086 8.26-27.927.45L440.558 817.696l-.006.006zM1141.82 1221.19c-16.63 20.39-47.04 20.21-65.63 1.59l-127.698-127.84c-7.836-7.85-7.821-20.56.033-28.39l212.095-211.345c7.84-7.813 20.62-7.859 27.54.784 36.81 45.996 51.29 109.566 40.34 179.551-10.01 64.06-40.65 129.19-86.68 185.65zM514.696 1224.16c-18.594 18.61-49.002 18.79-65.626-1.6-46.036-56.46-76.672-121.58-86.687-185.64-10.943-69.992 3.531-133.562 40.342-179.558 6.916-8.642 19.703-8.597 27.544-.784l212.092 211.352c7.854 7.82 7.868 20.54.033 28.38l-127.698 127.85z" fill="#7D7D87"/></svg>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryZep = void 0;
|
|
4
|
+
const zep_1 = require("langchain/memory/zep");
|
|
5
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
6
|
+
class MemoryZep {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Zep',
|
|
10
|
+
name: 'memoryZep',
|
|
11
|
+
icon: 'file:zep.png',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Use Zep Memory',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Zep',
|
|
17
|
+
},
|
|
18
|
+
codex: {
|
|
19
|
+
categories: ['AI'],
|
|
20
|
+
subcategories: {
|
|
21
|
+
AI: ['Memory'],
|
|
22
|
+
},
|
|
23
|
+
resources: {
|
|
24
|
+
primaryDocumentation: [
|
|
25
|
+
{
|
|
26
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryzep/',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
inputs: [],
|
|
32
|
+
outputs: ["ai_memory"],
|
|
33
|
+
outputNames: ['Memory'],
|
|
34
|
+
credentials: [
|
|
35
|
+
{
|
|
36
|
+
name: 'zepApi',
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
properties: [
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Session ID',
|
|
43
|
+
name: 'sessionId',
|
|
44
|
+
type: 'string',
|
|
45
|
+
required: true,
|
|
46
|
+
default: '',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async supplyData() {
|
|
52
|
+
const credentials = (await this.getCredentials('zepApi'));
|
|
53
|
+
const itemIndex = 0;
|
|
54
|
+
const sessionId = this.getNodeParameter('sessionId', itemIndex);
|
|
55
|
+
const memory = new zep_1.ZepMemory({
|
|
56
|
+
sessionId,
|
|
57
|
+
baseURL: credentials.apiUrl,
|
|
58
|
+
apiKey: credentials.apiKey,
|
|
59
|
+
memoryKey: 'chat_history',
|
|
60
|
+
returnMessages: true,
|
|
61
|
+
inputKey: 'input',
|
|
62
|
+
outputKey: 'output',
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
response: (0, logWrapper_1.logWrapper)(memory, this),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.MemoryZep = MemoryZep;
|
|
70
|
+
//# sourceMappingURL=MemoryZep.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryZep.node.js","sourceRoot":"","sources":["../../../../nodes/memory/MemoryZep/MemoryZep.node.ts"],"names":[],"mappings":";;;AAQA,8CAAiD;AACjD,0DAAuD;AAEvD,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,KAAK;YAClB,IAAI,EAAE,WAAW;YAEjB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE;gBACT,IAAI,EAAE,KAAK;aACX;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,QAAQ,CAAC;iBACd;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,iGAAiG;yBACtG;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,aAA6B;YACtC,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;IA2BH,CAAC;IAzBA,KAAK,CAAC,UAAU;QACf,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAGvD,CAAC;QAEF,MAAM,SAAS,GAAG,CAAC,CAAC;QAGpB,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAW,CAAC;QAE1E,MAAM,MAAM,GAAG,IAAI,eAAS,CAAC;YAC5B,SAAS;YACT,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,SAAS,EAAE,cAAc;YACzB,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,QAAQ;SACnB,CAAC,CAAC;QAEH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AAxED,8BAwEC"}
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class OutputParserAutofixing implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutputParserAutofixing = void 0;
|
|
4
|
+
const output_parsers_1 = require("langchain/output_parsers");
|
|
5
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
6
|
+
class OutputParserAutofixing {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Auto-fixing Output Parser',
|
|
10
|
+
name: 'outputParserAutofixing',
|
|
11
|
+
icon: 'fa:tools',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Automatically fix the output if it is not in the correct format',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Auto-fixing Output Parser',
|
|
17
|
+
},
|
|
18
|
+
codex: {
|
|
19
|
+
categories: ['AI'],
|
|
20
|
+
subcategories: {
|
|
21
|
+
AI: ['Output Parsers'],
|
|
22
|
+
},
|
|
23
|
+
resources: {
|
|
24
|
+
primaryDocumentation: [
|
|
25
|
+
{
|
|
26
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserautofixing/',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
inputs: [
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Model',
|
|
34
|
+
maxConnections: 1,
|
|
35
|
+
type: "ai_languageModel",
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Output Parser',
|
|
40
|
+
maxConnections: 1,
|
|
41
|
+
required: true,
|
|
42
|
+
type: "ai_outputParser",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
outputs: ["ai_outputParser"],
|
|
46
|
+
outputNames: ['Output Parser'],
|
|
47
|
+
properties: [],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async supplyData() {
|
|
51
|
+
const model = (await this.getInputConnectionData("ai_languageModel", 0));
|
|
52
|
+
const outputParser = (await this.getInputConnectionData("ai_outputParser", 0));
|
|
53
|
+
const parser = output_parsers_1.OutputFixingParser.fromLLM(model, outputParser);
|
|
54
|
+
return {
|
|
55
|
+
response: (0, logWrapper_1.logWrapper)(parser, this),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.OutputParserAutofixing = OutputParserAutofixing;
|
|
60
|
+
//# sourceMappingURL=OutputParserAutofixing.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputParserAutofixing.node.js","sourceRoot":"","sources":["../../../../nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.ts"],"names":[],"mappings":";;;AAQA,6DAA8D;AAG9D,0DAAuD;AAEvD,MAAa,sBAAsB;IAAnC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,iEAAiE;YAC9E,QAAQ,EAAE;gBACT,IAAI,EAAE,2BAA2B;aACjC;YAED,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,gBAAgB,CAAC;iBACtB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,8GAA8G;yBACnH;qBACD;iBACD;aACD;YAED,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,OAAO;oBACpB,cAAc,EAAE,CAAC;oBACjB,IAAI,oBAAoC;oBACxC,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,eAAe;oBAC5B,cAAc,EAAE,CAAC;oBACjB,QAAQ,EAAE,IAAI;oBACd,IAAI,mBAAmC;iBACvC;aACD;YAED,OAAO,EAAE,mBAAmC;YAC5C,WAAW,EAAE,CAAC,eAAe,CAAC;YAC9B,UAAU,EAAE,EAAE;SACd,CAAC;IAkBH,CAAC;IAhBA,KAAK,CAAC,UAAU;QACf,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAsB,CAAC;QACxB,MAAM,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEtD,CAAC,CACD,CAAqB,CAAC;QAEvB,MAAM,MAAM,GAAG,mCAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAE/D,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AA9DD,wDA8DC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseOutputParser } from 'langchain/schema/output_parser';
|
|
2
|
+
export declare class ItemListOutputParser extends BaseOutputParser<string[]> {
|
|
3
|
+
lc_namespace: string[];
|
|
4
|
+
private numberOfItems;
|
|
5
|
+
private separator;
|
|
6
|
+
constructor(options: {
|
|
7
|
+
numberOfItems?: number;
|
|
8
|
+
separator?: string;
|
|
9
|
+
});
|
|
10
|
+
parse(text: string): Promise<string[]>;
|
|
11
|
+
getFormatInstructions(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItemListOutputParser = void 0;
|
|
4
|
+
const output_parser_1 = require("langchain/schema/output_parser");
|
|
5
|
+
class ItemListOutputParser extends output_parser_1.BaseOutputParser {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
var _a;
|
|
8
|
+
super();
|
|
9
|
+
this.lc_namespace = ['langchain', 'output_parsers', 'list_items'];
|
|
10
|
+
if (options.numberOfItems && options.numberOfItems > 0) {
|
|
11
|
+
this.numberOfItems = options.numberOfItems;
|
|
12
|
+
}
|
|
13
|
+
this.separator = (_a = options.separator) !== null && _a !== void 0 ? _a : '\\n';
|
|
14
|
+
if (this.separator === '\\n') {
|
|
15
|
+
this.separator = '\n';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async parse(text) {
|
|
19
|
+
const response = text
|
|
20
|
+
.split(this.separator)
|
|
21
|
+
.map((item) => item.trim())
|
|
22
|
+
.filter((item) => item);
|
|
23
|
+
if (this.numberOfItems && response.length < this.numberOfItems) {
|
|
24
|
+
throw new output_parser_1.OutputParserException(`Wrong number of items returned. Expected ${this.numberOfItems} items but got ${response.length} items instead.`);
|
|
25
|
+
}
|
|
26
|
+
return response.slice(0, this.numberOfItems);
|
|
27
|
+
}
|
|
28
|
+
getFormatInstructions() {
|
|
29
|
+
var _a;
|
|
30
|
+
const instructions = `Your response should be a list of ${this.numberOfItems ? this.numberOfItems + ' ' : ''}items separated by`;
|
|
31
|
+
const numberOfExamples = (_a = this.numberOfItems) !== null && _a !== void 0 ? _a : 3;
|
|
32
|
+
const examples = [];
|
|
33
|
+
for (let i = 1; i <= numberOfExamples; i++) {
|
|
34
|
+
examples.push(`item${i}`);
|
|
35
|
+
}
|
|
36
|
+
return `${instructions} "${this.separator}" (for example: "${examples.join(this.separator)}")`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ItemListOutputParser = ItemListOutputParser;
|
|
40
|
+
//# sourceMappingURL=ItemListOutputParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemListOutputParser.js","sourceRoot":"","sources":["../../../../nodes/output_parser/OutputParserItemList/ItemListOutputParser.ts"],"names":[],"mappings":";;;AAAA,kEAAyF;AAEzF,MAAa,oBAAqB,SAAQ,gCAA0B;IAOnE,YAAY,OAAuD;;QAClE,KAAK,EAAE,CAAC;QAPT,iBAAY,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;QAQ5D,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,GAAG,CAAC,EAAE;YACvD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;SAC3C;QACD,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,KAAK,CAAC;QAC5C,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;YAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACtB;IACF,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QACvB,MAAM,QAAQ,GAAG,IAAI;aACnB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;aACrB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAEzB,IAAI,IAAI,CAAC,aAAa,IAAI,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE;YAE/D,MAAM,IAAI,qCAAqB,CAC9B,4CAA4C,IAAI,CAAC,aAAa,kBAAkB,QAAQ,CAAC,MAAM,iBAAiB,CAChH,CAAC;SACF;QAED,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,qBAAqB;;QACpB,MAAM,YAAY,GAAG,qCACpB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,CAAC,CAAC,EACjD,oBAAoB,CAAC;QAErB,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC;QAEjD,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,gBAAgB,EAAE,CAAC,EAAE,EAAE;YAC3C,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAC1B;QAED,OAAO,GAAG,YAAY,KAAK,IAAI,CAAC,SAAS,oBAAoB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAChG,CAAC;CACD;AAhDD,oDAgDC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class OutputParserItemList implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutputParserItemList = void 0;
|
|
4
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
5
|
+
const ItemListOutputParser_1 = require("./ItemListOutputParser");
|
|
6
|
+
class OutputParserItemList {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Item List Output Parser',
|
|
10
|
+
name: 'outputParserItemList',
|
|
11
|
+
icon: 'fa:bars',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Return the results as separate items',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Item List Output Parser',
|
|
17
|
+
},
|
|
18
|
+
codex: {
|
|
19
|
+
categories: ['AI'],
|
|
20
|
+
subcategories: {
|
|
21
|
+
AI: ['Output Parsers'],
|
|
22
|
+
},
|
|
23
|
+
resources: {
|
|
24
|
+
primaryDocumentation: [
|
|
25
|
+
{
|
|
26
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparseritemlist/',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
inputs: [],
|
|
32
|
+
outputs: ["ai_outputParser"],
|
|
33
|
+
outputNames: ['Output Parser'],
|
|
34
|
+
properties: [
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Options',
|
|
37
|
+
name: 'options',
|
|
38
|
+
type: 'collection',
|
|
39
|
+
placeholder: 'Add Option',
|
|
40
|
+
default: {},
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Number Of Items',
|
|
44
|
+
name: 'numberOfItems',
|
|
45
|
+
type: 'number',
|
|
46
|
+
default: -1,
|
|
47
|
+
description: 'Defines many many items should be returned maximally. If set to -1, there is no limit.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Separator',
|
|
51
|
+
name: 'separator',
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: '\\n',
|
|
54
|
+
description: '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.',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async supplyData() {
|
|
62
|
+
const itemIndex = 0;
|
|
63
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
64
|
+
const parser = new ItemListOutputParser_1.ItemListOutputParser(options);
|
|
65
|
+
return {
|
|
66
|
+
response: (0, logWrapper_1.logWrapper)(parser, this),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.OutputParserItemList = OutputParserItemList;
|
|
71
|
+
//# sourceMappingURL=OutputParserItemList.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputParserItemList.node.js","sourceRoot":"","sources":["../../../../nodes/output_parser/OutputParserItemList/OutputParserItemList.node.ts"],"names":[],"mappings":";;;AAQA,0DAAuD;AACvD,iEAA8D;AAE9D,MAAa,oBAAoB;IAAjC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE;gBACT,IAAI,EAAE,yBAAyB;aAC/B;YAED,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,gBAAgB,CAAC;iBACtB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4GAA4G;yBACjH;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,mBAAmC;YAC5C,WAAW,EAAE,CAAC,eAAe,CAAC;YAC9B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,SAAS;oBACtB,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,YAAY;oBAClB,WAAW,EAAE,YAAY;oBACzB,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE;wBACR;4BACC,WAAW,EAAE,iBAAiB;4BAC9B,IAAI,EAAE,eAAe;4BACrB,IAAI,EAAE,QAAQ;4BACd,OAAO,EAAE,CAAC,CAAC;4BACX,WAAW,EACV,wFAAwF;yBACzF;wBAWD;4BACC,WAAW,EAAE,WAAW;4BACxB,IAAI,EAAE,WAAW;4BACjB,IAAI,EAAE,QAAQ;4BACd,OAAO,EAAE,KAAK;4BACd,WAAW,EACV,8KAA8K;yBAC/K;qBACD;iBACD;aACD;SACD,CAAC;IAgBH,CAAC;IAdA,KAAK,CAAC,UAAU;QACf,MAAM,SAAS,GAAG,CAAC,CAAC;QAEpB,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAG7D,CAAC;QAEF,MAAM,MAAM,GAAG,IAAI,2CAAoB,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AAnFD,oDAmFC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class OutputParserStructured implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutputParserStructured = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const output_parsers_1 = require("langchain/output_parsers");
|
|
6
|
+
const json_schema_to_zod_1 = require("json-schema-to-zod");
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
9
|
+
class OutputParserStructured {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Structured Output Parser',
|
|
13
|
+
name: 'outputParserStructured',
|
|
14
|
+
icon: 'fa:code',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
description: 'Return data in a defined JSON format',
|
|
18
|
+
defaults: {
|
|
19
|
+
name: 'Structured Output Parser',
|
|
20
|
+
},
|
|
21
|
+
codex: {
|
|
22
|
+
alias: ['json', 'zod'],
|
|
23
|
+
categories: ['AI'],
|
|
24
|
+
subcategories: {
|
|
25
|
+
AI: ['Output Parsers'],
|
|
26
|
+
},
|
|
27
|
+
resources: {
|
|
28
|
+
primaryDocumentation: [
|
|
29
|
+
{
|
|
30
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured/',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
inputs: [],
|
|
36
|
+
outputs: ["ai_outputParser"],
|
|
37
|
+
outputNames: ['Output Parser'],
|
|
38
|
+
properties: [
|
|
39
|
+
{
|
|
40
|
+
displayName: 'JSON Schema',
|
|
41
|
+
name: 'jsonSchema',
|
|
42
|
+
type: 'json',
|
|
43
|
+
description: 'JSON Schema to structure and validate the output against',
|
|
44
|
+
default: `{
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"state": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"cities": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}`,
|
|
58
|
+
typeOptions: {
|
|
59
|
+
rows: 10,
|
|
60
|
+
editor: 'json',
|
|
61
|
+
editorLanguage: 'json',
|
|
62
|
+
},
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: 'The schema has to be defined in the <a target="_blank" href="https://json-schema.org/">JSON Schema</a> format. Look at <a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html">this</a> page for examples.',
|
|
67
|
+
name: 'notice',
|
|
68
|
+
type: 'notice',
|
|
69
|
+
default: '',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async supplyData() {
|
|
75
|
+
const itemIndex = 0;
|
|
76
|
+
const schema = this.getNodeParameter('jsonSchema', itemIndex);
|
|
77
|
+
let itemSchema;
|
|
78
|
+
try {
|
|
79
|
+
itemSchema = (0, n8n_workflow_1.jsonParse)(schema);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Error during parsing of JSON Schema.');
|
|
83
|
+
}
|
|
84
|
+
const returnSchema = {
|
|
85
|
+
type: 'array',
|
|
86
|
+
items: itemSchema,
|
|
87
|
+
};
|
|
88
|
+
const zodSchemaString = (0, json_schema_to_zod_1.parseSchema)(returnSchema);
|
|
89
|
+
const zodSchema = new Function('z', `return (${zodSchemaString})`)(zod_1.z);
|
|
90
|
+
const parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zodSchema);
|
|
91
|
+
return {
|
|
92
|
+
response: (0, logWrapper_1.logWrapper)(parser, this),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.OutputParserStructured = OutputParserStructured;
|
|
97
|
+
//# sourceMappingURL=OutputParserStructured.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutputParserStructured.node.js","sourceRoot":"","sources":["../../../../nodes/output_parser/OutputParserStructured/OutputParserStructured.node.ts"],"names":[],"mappings":";;;AACA,+CAQsB;AAEtB,6DAAkE;AAClE,2DAAiD;AACjD,6BAAwB;AAExB,0DAAuD;AAEvD,MAAa,sBAAsB;IAAnC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE;gBACT,IAAI,EAAE,0BAA0B;aAChC;YAED,KAAK,EAAE;gBACN,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;gBACtB,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,gBAAgB,CAAC;iBACtB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,8GAA8G;yBACnH;qBACD;iBACD;aACD;YAED,MAAM,EAAE,EAAE;YAEV,OAAO,EAAE,mBAAmC;YAC5C,WAAW,EAAE,CAAC,eAAe,CAAC;YAC9B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,MAAM;oBACZ,WAAW,EAAE,0DAA0D;oBACvE,OAAO,EAAE;;;;;;;;;;;;;EAaX;oBACE,WAAW,EAAE;wBACZ,IAAI,EAAE,EAAE;wBACR,MAAM,EAAE,MAAM;wBACd,cAAc,EAAE,MAAM;qBACtB;oBACD,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EACV,wOAAwO;oBACzO,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;IAkCH,CAAC;IAhCA,KAAK,CAAC,UAAU;QACf,MAAM,SAAS,GAAG,CAAC,CAAC;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAW,CAAC;QAExE,IAAI,UAAkB,CAAC;QACvB,IAAI;YACH,UAAU,GAAG,IAAA,wBAAS,EAAC,MAAM,CAAC,CAAC;SAC/B;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,sCAAsC,CAAC,CAAC;SACrF;QAGD,MAAM,YAAY,GAAgB;YACjC,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,UAAU;SACjB,CAAC;QAEF,MAAM,eAAe,GAAG,IAAA,gCAAW,EAAC,YAAY,CAAC,CAAC;QAMlD,MAAM,SAAS,GAAG,IAAI,QAAQ,CAAC,GAAG,EAAE,WAAW,eAAe,GAAG,CAAC,CAAC,OAAC,CAAwB,CAAC;QAE7F,MAAM,MAAM,GAAG,uCAAsB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAE/D,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,MAAM,EAAE,IAAI,CAAC;SAClC,CAAC;IACH,CAAC;CACD;AApGD,wDAoGC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
|
+
export declare class RetrieverContextualCompression implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
5
|
+
}
|