@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,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XataApi = void 0;
|
|
4
|
+
class XataApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'xataApi';
|
|
7
|
+
this.displayName = 'Xata Api';
|
|
8
|
+
this.documentationUrl = 'xata';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Database Endpoint',
|
|
12
|
+
name: 'databaseEndpoint',
|
|
13
|
+
required: true,
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
placeholder: 'https://{workspace}.{region}.xata.sh/db/{database}',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Branch',
|
|
20
|
+
name: 'branch',
|
|
21
|
+
required: true,
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: 'main',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'API Key',
|
|
27
|
+
name: 'apiKey',
|
|
28
|
+
type: 'string',
|
|
29
|
+
typeOptions: { password: true },
|
|
30
|
+
required: true,
|
|
31
|
+
default: '',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
this.authenticate = {
|
|
35
|
+
type: 'generic',
|
|
36
|
+
properties: {
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
this.test = {
|
|
43
|
+
request: {
|
|
44
|
+
baseURL: '={{$credentials.databaseEndpoint}}:{{$credentials.branch}}',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.XataApi = XataApi;
|
|
50
|
+
//# sourceMappingURL=XataApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XataApi.credentials.js","sourceRoot":"","sources":["../../credentials/XataApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,OAAO;IAApB;QACC,SAAI,GAAG,SAAS,CAAC;QAEjB,gBAAW,GAAG,UAAU,CAAC;QAEzB,qBAAgB,GAAG,MAAM,CAAC;QAE1B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,oDAAoD;aACjE;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,4DAA4D;aACrE;SACD,CAAC;IACH,CAAC;CAAA;AA/CD,0BA+CC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class ZepApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZepApi = void 0;
|
|
4
|
+
class ZepApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'zepApi';
|
|
7
|
+
this.displayName = 'Zep Api';
|
|
8
|
+
this.documentationUrl = 'zep';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API URL',
|
|
12
|
+
name: 'apiUrl',
|
|
13
|
+
required: true,
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'http://localhost:8000',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'API Key',
|
|
19
|
+
name: 'apiKey',
|
|
20
|
+
type: 'string',
|
|
21
|
+
typeOptions: { password: true },
|
|
22
|
+
required: false,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
this.authenticate = {
|
|
27
|
+
type: 'generic',
|
|
28
|
+
properties: {
|
|
29
|
+
headers: {
|
|
30
|
+
Authorization: '={{$credentials.apiKey ? "Bearer " + $credentials.apiKey : undefined }}',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
this.test = {
|
|
35
|
+
request: {
|
|
36
|
+
baseURL: '={{$credentials.apiUrl}}',
|
|
37
|
+
url: '/api/v1/collection',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.ZepApi = ZepApi;
|
|
43
|
+
//# sourceMappingURL=ZepApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZepApi.credentials.js","sourceRoot":"","sources":["../../credentials/ZepApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,MAAM;IAAnB;QACC,SAAI,GAAG,QAAQ,CAAC;QAEhB,gBAAW,GAAG,SAAS,CAAC;QAExB,qBAAgB,GAAG,KAAK,CAAC;QAEzB,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uBAAuB;aAChC;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,EAAE;aACX;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,yEAAyE;iBACxF;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,oBAAoB;aACzB;SACD,CAAC;IACH,CAAC;CAAA;AAxCD,wBAwCC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Agent = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const description_1 = require("./agents/ConversationalAgent/description");
|
|
6
|
+
const execute_1 = require("./agents/ConversationalAgent/execute");
|
|
7
|
+
const description_2 = require("./agents/OpenAiFunctionsAgent/description");
|
|
8
|
+
const execute_2 = require("./agents/OpenAiFunctionsAgent/execute");
|
|
9
|
+
const description_3 = require("./agents/ReActAgent/description");
|
|
10
|
+
const execute_3 = require("./agents/ReActAgent/execute");
|
|
11
|
+
const description_4 = require("./agents/SqlAgent/description");
|
|
12
|
+
const execute_4 = require("./agents/SqlAgent/execute");
|
|
13
|
+
function getInputs(agent) {
|
|
14
|
+
const getInputData = (inputs) => {
|
|
15
|
+
const displayNames = {
|
|
16
|
+
["ai_languageModel"]: 'Model',
|
|
17
|
+
["ai_memory"]: 'Memory',
|
|
18
|
+
["ai_tool"]: 'Tool',
|
|
19
|
+
["ai_outputParser"]: 'Output Parser',
|
|
20
|
+
};
|
|
21
|
+
return inputs.map(({ type, filter }) => {
|
|
22
|
+
const input = {
|
|
23
|
+
type,
|
|
24
|
+
displayName: type in displayNames ? displayNames[type] : undefined,
|
|
25
|
+
required: type === "ai_languageModel",
|
|
26
|
+
maxConnections: ["ai_languageModel", "ai_memory"].includes(type)
|
|
27
|
+
? 1
|
|
28
|
+
: undefined,
|
|
29
|
+
};
|
|
30
|
+
if (filter) {
|
|
31
|
+
input.filter = filter;
|
|
32
|
+
}
|
|
33
|
+
return input;
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
let specialInputs = [];
|
|
37
|
+
if (agent === 'conversationalAgent') {
|
|
38
|
+
specialInputs = [
|
|
39
|
+
{
|
|
40
|
+
type: "ai_languageModel",
|
|
41
|
+
filter: {
|
|
42
|
+
nodes: [
|
|
43
|
+
'@n8n/n8n-nodes-langchain.lmChatAnthropic',
|
|
44
|
+
'@n8n/n8n-nodes-langchain.lmChatOllama',
|
|
45
|
+
'@n8n/n8n-nodes-langchain.lmChatOpenAi',
|
|
46
|
+
'@n8n/n8n-nodes-langchain.lmChatGooglePalm',
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "ai_memory",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "ai_tool",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "ai_outputParser",
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
else if (agent === 'openAiFunctionsAgent') {
|
|
62
|
+
specialInputs = [
|
|
63
|
+
{
|
|
64
|
+
type: "ai_languageModel",
|
|
65
|
+
filter: {
|
|
66
|
+
nodes: ['@n8n/n8n-nodes-langchain.lmChatOpenAi'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "ai_memory",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "ai_tool",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: "ai_outputParser",
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
else if (agent === 'reActAgent') {
|
|
81
|
+
specialInputs = [
|
|
82
|
+
{
|
|
83
|
+
type: "ai_languageModel",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: "ai_tool",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "ai_outputParser",
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
else if (agent === 'sqlAgent') {
|
|
94
|
+
specialInputs = [
|
|
95
|
+
{
|
|
96
|
+
type: "ai_languageModel",
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
return ["main", ...getInputData(specialInputs)];
|
|
101
|
+
}
|
|
102
|
+
class Agent {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.description = {
|
|
105
|
+
displayName: 'Agent',
|
|
106
|
+
name: 'agent',
|
|
107
|
+
icon: 'fa:robot',
|
|
108
|
+
group: ['transform'],
|
|
109
|
+
version: 1,
|
|
110
|
+
description: 'Seamlessly coordinates LLMs & tools per user input',
|
|
111
|
+
subtitle: "={{ { conversationalAgent: 'Conversational Agent', openAiFunctionsAgent: 'OpenAI Functions Agent', reactAgent: 'ReAct Agent', sqlAgent: 'SQL Agent' }[$parameter.agent] }}",
|
|
112
|
+
defaults: {
|
|
113
|
+
name: 'Agent',
|
|
114
|
+
color: '#404040',
|
|
115
|
+
},
|
|
116
|
+
codex: {
|
|
117
|
+
alias: ['LangChain'],
|
|
118
|
+
categories: ['AI'],
|
|
119
|
+
subcategories: {
|
|
120
|
+
AI: ['Agents'],
|
|
121
|
+
},
|
|
122
|
+
resources: {
|
|
123
|
+
primaryDocumentation: [
|
|
124
|
+
{
|
|
125
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
inputs: `={{ ((agent) => { ${getInputs.toString()}; return getInputs(agent) })($parameter.agent) }}`,
|
|
131
|
+
outputs: ["main"],
|
|
132
|
+
credentials: [],
|
|
133
|
+
properties: [
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Agent',
|
|
136
|
+
name: 'agent',
|
|
137
|
+
type: 'options',
|
|
138
|
+
noDataExpression: true,
|
|
139
|
+
options: [
|
|
140
|
+
{
|
|
141
|
+
name: 'Conversational Agent',
|
|
142
|
+
value: 'conversationalAgent',
|
|
143
|
+
description: 'Selects tools to accomplish its task and uses memory to recall previous conversations',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'OpenAI Functions Agent',
|
|
147
|
+
value: 'openAiFunctionsAgent',
|
|
148
|
+
description: "Utilizes OpenAI's Function Calling feature to select the appropriate tool and arguments for execution",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'ReAct Agent',
|
|
152
|
+
value: 'reActAgent',
|
|
153
|
+
description: 'Strategically select tools to accomplish a given task',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'SQL Agent',
|
|
157
|
+
value: 'sqlAgent',
|
|
158
|
+
description: 'Answers questions about data in an SQL database',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
default: 'conversationalAgent',
|
|
162
|
+
},
|
|
163
|
+
...description_1.conversationalAgentProperties,
|
|
164
|
+
...description_2.openAiFunctionsAgentProperties,
|
|
165
|
+
...description_3.reActAgentAgentProperties,
|
|
166
|
+
...description_4.sqlAgentAgentProperties,
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
async execute() {
|
|
171
|
+
const agentType = this.getNodeParameter('agent', 0, '');
|
|
172
|
+
if (agentType === 'conversationalAgent') {
|
|
173
|
+
return execute_1.conversationalAgentExecute.call(this);
|
|
174
|
+
}
|
|
175
|
+
else if (agentType === 'openAiFunctionsAgent') {
|
|
176
|
+
return execute_2.openAiFunctionsAgentExecute.call(this);
|
|
177
|
+
}
|
|
178
|
+
else if (agentType === 'reActAgent') {
|
|
179
|
+
return execute_3.reActAgentAgentExecute.call(this);
|
|
180
|
+
}
|
|
181
|
+
else if (agentType === 'sqlAgent') {
|
|
182
|
+
return execute_4.sqlAgentAgentExecute.call(this);
|
|
183
|
+
}
|
|
184
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The agent type "${agentType}" is not supported`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.Agent = Agent;
|
|
188
|
+
//# sourceMappingURL=Agent.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Agent.node.js","sourceRoot":"","sources":["../../../../nodes/agents/Agent/Agent.node.ts"],"names":[],"mappings":";;;AAAA,+CAAsE;AAUtE,0EAAyF;AACzF,kEAAkF;AAElF,2EAA2F;AAC3F,mEAAoF;AACpF,iEAA4E;AAC5E,yDAAqE;AACrE,+DAAwE;AACxE,uDAAiE;AAIjE,SAAS,SAAS,CACjB,KAAiF;IAOjF,MAAM,YAAY,GAAG,CACpB,MAAsB,EAC6B,EAAE;QACrD,MAAM,YAAY,GAAG;YACpB,oBAAoC,EAAE,OAAO;YAC7C,aAA6B,EAAE,QAAQ;YACvC,WAA2B,EAAE,MAAM;YACnC,mBAAmC,EAAE,eAAe;SACpD,CAAC;QAEF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;YACtC,MAAM,KAAK,GAA4B;gBACtC,IAAI;gBAEJ,WAAW,EAAE,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;gBAClE,QAAQ,EAAE,IAAI,uBAAuC;gBACrD,cAAc,EAAE,iCAAiE,CAAC,QAAQ,CACzF,IAA0B,CAC1B;oBACA,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,SAAS;aACZ,CAAC;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AAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAW,CAAC;QAElE,IAAI,SAAS,KAAK,qBAAqB,EAAE;YACxC,OAAO,oCAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7C;aAAM,IAAI,SAAS,KAAK,sBAAsB,EAAE;YAChD,OAAO,qCAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC9C;aAAM,IAAI,SAAS,KAAK,YAAY,EAAE;YACtC,OAAO,gCAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACzC;aAAM,IAAI,SAAS,KAAK,UAAU,EAAE;YACpC,OAAO,8BAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACvC;QAED,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,mBAAmB,SAAS,oBAAoB,CAAC,CAAC;IAChG,CAAC;CACD;AAtFD,sBAsFC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conversationalAgentProperties = void 0;
|
|
4
|
+
exports.conversationalAgentProperties = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Text',
|
|
7
|
+
name: 'text',
|
|
8
|
+
type: 'string',
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
agent: ['conversationalAgent'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
default: '={{ $json.input }}',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Options',
|
|
18
|
+
name: 'options',
|
|
19
|
+
type: 'collection',
|
|
20
|
+
displayOptions: {
|
|
21
|
+
show: {
|
|
22
|
+
agent: ['conversationalAgent'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
default: {},
|
|
26
|
+
placeholder: 'Add Option',
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
displayName: 'System Message',
|
|
30
|
+
name: 'systemMessage',
|
|
31
|
+
type: 'string',
|
|
32
|
+
default: 'Do your best to answer the questions. Feel free to use any tools available to look up relevant information, only if necessary.',
|
|
33
|
+
description: 'The message that will be sent to the agent before the conversation starts',
|
|
34
|
+
typeOptions: {
|
|
35
|
+
rows: 3,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ConversationalAgent/description.ts"],"names":[],"mappings":";;;AAEa,QAAA,6BAA6B,GAAsB;IAC/D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;aAC9B;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,qBAAqB,CAAC;aAC9B;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,OAAO,EACN,gIAAgI;gBACjI,WAAW,EAAE,2EAA2E;gBACxF,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conversationalAgentExecute = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const agents_1 = require("langchain/agents");
|
|
6
|
+
const base_1 = require("langchain/chat_models/base");
|
|
7
|
+
const prompts_1 = require("langchain/prompts");
|
|
8
|
+
const output_parsers_1 = require("langchain/output_parsers");
|
|
9
|
+
async function conversationalAgentExecute() {
|
|
10
|
+
this.logger.verbose('Executing Conversational Agent');
|
|
11
|
+
const model = (await this.getInputConnectionData("ai_languageModel", 0));
|
|
12
|
+
if (!(model instanceof base_1.BaseChatModel)) {
|
|
13
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Conversational Agent requires Chat Model');
|
|
14
|
+
}
|
|
15
|
+
const memory = (await this.getInputConnectionData("ai_memory", 0));
|
|
16
|
+
const tools = (await this.getInputConnectionData("ai_tool", 0));
|
|
17
|
+
const outputParsers = (await this.getInputConnectionData("ai_outputParser", 0));
|
|
18
|
+
const options = this.getNodeParameter('options', 0, {});
|
|
19
|
+
const agentExecutor = await (0, agents_1.initializeAgentExecutorWithOptions)(tools, model, {
|
|
20
|
+
agentType: 'chat-conversational-react-description',
|
|
21
|
+
memory,
|
|
22
|
+
agentArgs: {
|
|
23
|
+
systemMessage: options.systemMessage,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const returnData = [];
|
|
27
|
+
let outputParser;
|
|
28
|
+
let prompt;
|
|
29
|
+
if (outputParsers.length) {
|
|
30
|
+
if (outputParsers.length === 1) {
|
|
31
|
+
outputParser = outputParsers[0];
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
outputParser = new output_parsers_1.CombiningOutputParser(...outputParsers);
|
|
35
|
+
}
|
|
36
|
+
const formatInstructions = outputParser.getFormatInstructions();
|
|
37
|
+
prompt = new prompts_1.PromptTemplate({
|
|
38
|
+
template: '{input}\n{formatInstructions}',
|
|
39
|
+
inputVariables: ['input'],
|
|
40
|
+
partialVariables: { formatInstructions },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const items = this.getInputData();
|
|
44
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
45
|
+
let input = this.getNodeParameter('text', itemIndex);
|
|
46
|
+
if (prompt) {
|
|
47
|
+
input = (await prompt.invoke({ input })).value;
|
|
48
|
+
}
|
|
49
|
+
let response = await agentExecutor.call({ input, outputParsers });
|
|
50
|
+
if (outputParser) {
|
|
51
|
+
response = { output: await outputParser.parse(response.output) };
|
|
52
|
+
}
|
|
53
|
+
returnData.push({ json: response });
|
|
54
|
+
}
|
|
55
|
+
return this.prepareOutputData(returnData);
|
|
56
|
+
}
|
|
57
|
+
exports.conversationalAgentExecute = conversationalAgentExecute;
|
|
58
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ConversationalAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAEtB,6CAAsE;AACtE,qDAA2D;AAI3D,+CAAmD;AACnD,6DAAiE;AAE1D,KAAK,UAAU,0BAA0B;IAG/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAEtD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAkB,CAAC;IAEpB,IAAI,CAAC,CAAC,KAAK,YAAY,oBAAa,CAAC,EAAE;QACtC,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,0CAA0C,CAAC,CAAC;KACzF;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,cAA8B,CAAC,CAAC,CAErE,CAAC;IACb,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,YAA4B,CAAC,CAAC,CAAW,CAAC;IAC1F,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEvD,CAAC,CACD,CA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IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC;QAElE,IAAI,YAAY,EAAE;YACjB,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAgB,CAAC,EAAE,CAAC;SAC3E;QAED,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;KACpC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AA3ED,gEA2EC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openAiFunctionsAgentProperties = void 0;
|
|
4
|
+
exports.openAiFunctionsAgentProperties = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Text',
|
|
7
|
+
name: 'text',
|
|
8
|
+
type: 'string',
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
agent: ['openAiFunctionsAgent'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
default: '={{ $json.input }}',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.ts"],"names":[],"mappings":";;;AAEa,QAAA,8BAA8B,GAAsB;IAChE;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,sBAAsB,CAAC;aAC/B;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;CACD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openAiFunctionsAgentExecute = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const agents_1 = require("langchain/agents");
|
|
6
|
+
const prompts_1 = require("langchain/prompts");
|
|
7
|
+
const output_parsers_1 = require("langchain/output_parsers");
|
|
8
|
+
const openai_1 = require("langchain/chat_models/openai");
|
|
9
|
+
async function openAiFunctionsAgentExecute() {
|
|
10
|
+
this.logger.verbose('Executing OpenAi Functions Agent');
|
|
11
|
+
const model = (await this.getInputConnectionData("ai_languageModel", 0));
|
|
12
|
+
if (!(model instanceof openai_1.ChatOpenAI)) {
|
|
13
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'OpenAI Functions Agent requires OpenAI Chat Model');
|
|
14
|
+
}
|
|
15
|
+
const memory = (await this.getInputConnectionData("ai_memory", 0));
|
|
16
|
+
const tools = (await this.getInputConnectionData("ai_tool", 0));
|
|
17
|
+
const outputParsers = (await this.getInputConnectionData("ai_outputParser", 0));
|
|
18
|
+
const agentExecutor = await (0, agents_1.initializeAgentExecutorWithOptions)(tools, model, {
|
|
19
|
+
agentType: 'openai-functions',
|
|
20
|
+
});
|
|
21
|
+
if (memory) {
|
|
22
|
+
agentExecutor.memory = memory;
|
|
23
|
+
}
|
|
24
|
+
const returnData = [];
|
|
25
|
+
let outputParser;
|
|
26
|
+
let prompt;
|
|
27
|
+
if (outputParsers.length) {
|
|
28
|
+
outputParser =
|
|
29
|
+
outputParsers.length === 1 ? outputParsers[0] : new output_parsers_1.CombiningOutputParser(...outputParsers);
|
|
30
|
+
const formatInstructions = outputParser.getFormatInstructions();
|
|
31
|
+
prompt = new prompts_1.PromptTemplate({
|
|
32
|
+
template: '{input}\n{formatInstructions}',
|
|
33
|
+
inputVariables: ['input'],
|
|
34
|
+
partialVariables: { formatInstructions },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const items = this.getInputData();
|
|
38
|
+
const itemCount = items.length;
|
|
39
|
+
for (let itemIndex = 0; itemIndex < itemCount; itemIndex++) {
|
|
40
|
+
let input = this.getNodeParameter('text', itemIndex);
|
|
41
|
+
if (prompt) {
|
|
42
|
+
input = (await prompt.invoke({ input })).value;
|
|
43
|
+
}
|
|
44
|
+
let response = await agentExecutor.call({ input, outputParsers });
|
|
45
|
+
if (outputParser) {
|
|
46
|
+
response = { output: await outputParser.parse(response.output) };
|
|
47
|
+
}
|
|
48
|
+
returnData.push({ json: response });
|
|
49
|
+
}
|
|
50
|
+
return this.prepareOutputData(returnData);
|
|
51
|
+
}
|
|
52
|
+
exports.openAiFunctionsAgentExecute = openAiFunctionsAgentExecute;
|
|
53
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts"],"names":[],"mappings":";;;AAAA,+CAKsB;AAEtB,6CAAsE;AAGtE,+CAAmD;AACnD,6DAAiE;AAEjE,yDAA0D;AAEnD,KAAK,UAAU,2BAA2B;IAGhD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAE/C,CAAC,CACD,CAAe,CAAC;IAEjB,IAAI,CAAC,CAAC,KAAK,YAAY,mBAAU,CAAC,EAAE;QACnC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,mDAAmD,CACnD,CAAC;KACF;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,cAA8B,CAAC,CAAC,CAErE,CAAC;IACb,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,YAA4B,CAAC,CAAC,CAAW,CAAC;IAC1F,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEvD,CAAC,CACD,CAAuB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B,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAgB,CAAC,EAAE,CAAC;SAC3E;QAED,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;KACpC;IAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC;AAvED,kEAuEC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reActAgentAgentProperties = void 0;
|
|
4
|
+
exports.reActAgentAgentProperties = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Text',
|
|
7
|
+
name: 'text',
|
|
8
|
+
type: 'string',
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
agent: ['reActAgent'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
default: '={{ $json.input }}',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ReActAgent/description.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAsB;IAC3D;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,KAAK,EAAE,CAAC,YAAY,CAAC;aACrB;SACD;QACD,OAAO,EAAE,oBAAoB;KAC7B;CACD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reActAgentAgentExecute = void 0;
|
|
4
|
+
const agents_1 = require("langchain/agents");
|
|
5
|
+
const prompts_1 = require("langchain/prompts");
|
|
6
|
+
const output_parsers_1 = require("langchain/output_parsers");
|
|
7
|
+
const base_1 = require("langchain/chat_models/base");
|
|
8
|
+
async function reActAgentAgentExecute() {
|
|
9
|
+
this.logger.verbose('Executing ReAct Agent');
|
|
10
|
+
const model = (await this.getInputConnectionData("ai_languageModel", 0));
|
|
11
|
+
const tools = (await this.getInputConnectionData("ai_tool", 0));
|
|
12
|
+
const outputParsers = (await this.getInputConnectionData("ai_outputParser", 0));
|
|
13
|
+
const agentExecutor = await (0, agents_1.initializeAgentExecutorWithOptions)(tools, model, {
|
|
14
|
+
agentType: model instanceof base_1.BaseChatModel
|
|
15
|
+
? 'chat-zero-shot-react-description'
|
|
16
|
+
: 'zero-shot-react-description',
|
|
17
|
+
});
|
|
18
|
+
const returnData = [];
|
|
19
|
+
let outputParser;
|
|
20
|
+
let prompt;
|
|
21
|
+
if (outputParsers.length) {
|
|
22
|
+
outputParser =
|
|
23
|
+
outputParsers.length === 1 ? outputParsers[0] : new output_parsers_1.CombiningOutputParser(...outputParsers);
|
|
24
|
+
const formatInstructions = outputParser.getFormatInstructions();
|
|
25
|
+
prompt = new prompts_1.PromptTemplate({
|
|
26
|
+
template: '{input}\n{formatInstructions}',
|
|
27
|
+
inputVariables: ['input'],
|
|
28
|
+
partialVariables: { formatInstructions },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const items = this.getInputData();
|
|
32
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
33
|
+
let input = this.getNodeParameter('text', itemIndex);
|
|
34
|
+
if (prompt) {
|
|
35
|
+
input = (await prompt.invoke({ input })).value;
|
|
36
|
+
}
|
|
37
|
+
let response = await agentExecutor.call({ input, outputParsers });
|
|
38
|
+
if (outputParser) {
|
|
39
|
+
response = { output: await outputParser.parse(response.output) };
|
|
40
|
+
}
|
|
41
|
+
returnData.push({ json: response });
|
|
42
|
+
}
|
|
43
|
+
return this.prepareOutputData(returnData);
|
|
44
|
+
}
|
|
45
|
+
exports.reActAgentAgentExecute = reActAgentAgentExecute;
|
|
46
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ReActAgent/execute.ts"],"names":[],"mappings":";;;AAEA,6CAAsE;AAItE,+CAAmD;AACnD,6DAAiE;AACjE,qDAA2D;AAEpD,KAAK,UAAU,sBAAsB;IAG3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE7C,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,qBAAqC,CAAC,CAAC,CAEvE,CAAC;IAEjB,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,YAA4B,CAAC,CAAC,CAAW,CAAC;IAC1F,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,oBAEvD,CAAC,CACD,CAAuB,CAAC;IAEzB,MAAM,aAAa,GAAG,MAAM,IAAA,2CAAkC,EAAC,KAAK,EAAE,KAAK,EAAE;QAC5E,SAAS,EACR,KAAK,YAAY,oBAAa;YAC7B,CAAC,CAAC,kCAAkC;YACpC,CAAC,CAAC,6BAA6B;KACjC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,IAAI,YAA0C,CAAC;IAC/C,IAAI,MAAkC,CAAC;IACvC,IAAI,aAAa,CAAC,MAAM,EAAE;QACzB,YAAY;YACX,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,sCAAqB,CAAC,GAAG,aAAa,CAAC,CAAC;QAE7F,MAAM,kBAAkB,GAAG,YAAY,CAAC,qBAAqB,EAAE,CAAC;QAEhE,MAAM,GAAG,IAAI,wBAAc,CAAC;YAC3B,QAAQ,EAAE,+BAA+B;YACzC,cAAc,EAAE,CAAC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