@n8n/n8n-nodes-langchain 1.83.1 → 1.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/XAiApi.credentials.d.ts +9 -0
- package/dist/credentials/XAiApi.credentials.js +42 -0
- package/dist/credentials/XAiApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +7 -0
- package/dist/known/nodes.json +8 -0
- package/dist/nodes/agents/Agent/Agent.node.js +32 -30
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +11 -21
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +5 -9
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js +4 -8
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +4 -8
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +2 -2
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js +7 -8
- package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js.map +1 -1
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +3 -3
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +17 -389
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.d.ts +2 -0
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +50 -0
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/config.d.ts +3 -0
- package/dist/nodes/chains/ChainLLM/methods/config.js +254 -0
- package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/imageUtils.d.ts +12 -0
- package/dist/nodes/chains/ChainLLM/methods/imageUtils.js +66 -0
- package/dist/nodes/chains/ChainLLM/methods/imageUtils.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/index.d.ts +4 -0
- package/dist/nodes/chains/ChainLLM/methods/index.js +11 -0
- package/dist/nodes/chains/ChainLLM/methods/index.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/promptUtils.d.ts +3 -0
- package/dist/nodes/chains/ChainLLM/methods/promptUtils.js +69 -0
- package/dist/nodes/chains/ChainLLM/methods/promptUtils.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/responseFormatter.d.ts +2 -0
- package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js +26 -0
- package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/types.d.ts +28 -0
- package/dist/nodes/chains/ChainLLM/methods/types.js +3 -0
- package/dist/nodes/chains/ChainLLM/methods/types.js.map +1 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +74 -39
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +7 -6
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -1
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +9 -8
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -1
- package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +4 -4
- package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -1
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +4 -4
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -1
- package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +5 -5
- package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -1
- package/dist/nodes/code/Code.node.js +11 -11
- package/dist/nodes/code/Code.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +5 -4
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +4 -3
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +7 -6
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +5 -4
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +3 -2
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +3 -2
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +3 -2
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +5 -4
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +3 -1
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
- package/dist/nodes/llms/LMCohere/LmCohere.node.js +3 -2
- package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -1
- package/dist/nodes/llms/LMOllama/LmOllama.node.js +3 -2
- package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +2 -1
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +3 -2
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +3 -2
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +4 -3
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +3 -2
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +3 -2
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +2 -2
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +3 -2
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +3 -2
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +3 -2
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -1
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.d.ts +5 -0
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +223 -0
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -0
- package/dist/nodes/llms/LmChatXAiGrok/logo.dark.svg +1 -0
- package/dist/nodes/llms/LmChatXAiGrok/logo.svg +1 -0
- package/dist/nodes/llms/N8nLlmTracing.d.ts +2 -2
- package/dist/nodes/llms/N8nLlmTracing.js +1 -1
- package/dist/nodes/llms/N8nLlmTracing.js.map +1 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +3 -2
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +5 -4
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -1
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +5 -4
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +3 -2
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +3 -2
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +6 -3
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +2 -2
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +2 -2
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +6 -6
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +3 -2
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +2 -2
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +6 -5
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +6 -5
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +4 -3
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +3 -2
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +3 -2
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +3 -2
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -1
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +3 -2
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +5 -5
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +2 -2
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -1
- package/dist/nodes/tools/ToolHttpRequest/utils.js +3 -3
- package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -1
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +3 -2
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +7 -6
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +3 -2
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -1
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +3 -2
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js +3 -3
- package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +3 -2
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +2 -2
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js +3 -2
- package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +3 -3
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +2 -1
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +5 -5
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +9 -8
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +6 -5
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.d.ts +16 -0
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js +244 -0
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/mongodb.dark.svg +3 -0
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/mongodb.svg +3 -0
- package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +1 -1
- package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js +2 -2
- package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +8 -7
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +5 -4
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +2 -2
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js +2 -2
- package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +8 -7
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +5 -4
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +7 -6
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +4 -3
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.d.ts +7 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js +50 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.d.ts +32 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +173 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.d.ts +16 -0
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js +95 -0
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/config.d.ts +4 -0
- package/dist/nodes/vector_store/shared/MemoryManager/config.js +38 -0
- package/dist/nodes/vector_store/shared/MemoryManager/config.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/types.d.ts +39 -0
- package/dist/nodes/vector_store/shared/MemoryManager/types.js +3 -0
- package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.d.ts +4 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +45 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.d.ts +15 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +226 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +22 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +35 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +33 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +42 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +16 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +39 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/{createVectorStoreNode.d.ts → createVectorStoreNode/types.d.ts} +3 -16
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +3 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.d.ts +6 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +20 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +9 -8
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js +2 -1
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -1
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +17 -15
- package/dist/utils/N8nTool.js +2 -2
- package/dist/utils/N8nTool.js.map +1 -1
- package/dist/utils/helpers.d.ts +1 -0
- package/dist/utils/helpers.js +13 -1
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/logWrapper.d.ts +1 -2
- package/dist/utils/logWrapper.js +12 -12
- package/dist/utils/logWrapper.js.map +1 -1
- package/dist/utils/output_parsers/N8nOutputFixingParser.js +11 -5
- package/dist/utils/output_parsers/N8nOutputFixingParser.js.map +1 -1
- package/dist/utils/output_parsers/N8nOutputParser.d.ts +1 -1
- package/dist/utils/output_parsers/N8nOutputParser.js +6 -5
- package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -1
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js +5 -4
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -1
- package/dist/utils/sharedFields.d.ts +2 -2
- package/dist/utils/sharedFields.js +9 -8
- package/dist/utils/sharedFields.js.map +1 -1
- package/package.json +10 -5
- package/dist/nodes/chains/ChainLLM/utils.d.ts +0 -5
- package/dist/nodes/chains/ChainLLM/utils.js +0 -14
- package/dist/nodes/chains/ChainLLM/utils.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.d.ts +0 -12
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js +0 -40
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode.js +0 -369
- package/dist/nodes/vector_store/shared/createVectorStoreNode.js.map +0 -1
- package/dist/nodes/vector_store/shared/methods/listSearch.js.map +0 -1
- /package/dist/nodes/vector_store/shared/{methods → createVectorStoreNode/methods}/listSearch.d.ts +0 -0
- /package/dist/nodes/vector_store/shared/{methods → createVectorStoreNode/methods}/listSearch.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/SqlAgent/execute.ts"],"names":[],"mappings":";;AA4BA,oDA8HC;AAtJD,uDAA2E;AAC3E,6CAA+C;AAC/C,+CAMsB;AAEtB,4CAA4E;AAC5E,4CAAkD;AAElD,kDAA4D;AAC5D,wDA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AAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC7E,SAAS;YACV,CAAC;YAED,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -99,7 +99,7 @@ function handleParsedStepOutput(output, memory) {
|
|
|
99
99
|
}
|
|
100
100
|
const getAgentStepsParser = (outputParser, memory) => async (steps) => {
|
|
101
101
|
if (Array.isArray(steps)) {
|
|
102
|
-
const responseParserTool = steps.find((step) => step.tool === '
|
|
102
|
+
const responseParserTool = steps.find((step) => step.tool === 'format_final_json_response');
|
|
103
103
|
if (responseParserTool && outputParser) {
|
|
104
104
|
const toolInput = responseParserTool.toolInput;
|
|
105
105
|
const parserInput = toolInput instanceof Object ? JSON.stringify(toolInput) : toolInput;
|
|
@@ -133,14 +133,14 @@ const getAgentStepsParser = (outputParser, memory) => async (steps) => {
|
|
|
133
133
|
};
|
|
134
134
|
exports.getAgentStepsParser = getAgentStepsParser;
|
|
135
135
|
async function getChatModel(ctx) {
|
|
136
|
-
const model = await ctx.getInputConnectionData(
|
|
136
|
+
const model = await ctx.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiLanguageModel, 0);
|
|
137
137
|
if (!(0, helpers_1.isChatInstance)(model) || !model.bindTools) {
|
|
138
138
|
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Tools Agent requires Chat Model which supports Tools calling');
|
|
139
139
|
}
|
|
140
140
|
return model;
|
|
141
141
|
}
|
|
142
142
|
async function getOptionalMemory(ctx) {
|
|
143
|
-
return (await ctx.getInputConnectionData(
|
|
143
|
+
return (await ctx.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiMemory, 0));
|
|
144
144
|
}
|
|
145
145
|
async function getTools(ctx, outputParser) {
|
|
146
146
|
const tools = (await (0, helpers_1.getConnectedTools)(ctx, true, false));
|
|
@@ -148,8 +148,8 @@ async function getTools(ctx, outputParser) {
|
|
|
148
148
|
const schema = getOutputParserSchema(outputParser);
|
|
149
149
|
const structuredOutputParserTool = new tools_1.DynamicStructuredTool({
|
|
150
150
|
schema,
|
|
151
|
-
name: '
|
|
152
|
-
description: '
|
|
151
|
+
name: 'format_final_json_response',
|
|
152
|
+
description: 'Use this tool to format your final response to the user in a structured JSON format. This tool validates your output against a schema to ensure it meets the required format. ONLY use this tool when you have completed all necessary reasoning and are ready to provide your final answer. Do not use this tool for intermediate steps or for asking questions. The output from this tool will be directly returned to the user.',
|
|
153
153
|
func: async () => '',
|
|
154
154
|
});
|
|
155
155
|
tools.push(structuredOutputParserTool);
|
|
@@ -177,8 +177,7 @@ async function toolsAgentExecute() {
|
|
|
177
177
|
this.logger.debug('Executing Tools Agent');
|
|
178
178
|
const returnData = [];
|
|
179
179
|
const items = this.getInputData();
|
|
180
|
-
const
|
|
181
|
-
const outputParser = outputParsers?.[0];
|
|
180
|
+
const outputParser = await (0, N8nOutputParser_1.getOptionalOutputParser)(this);
|
|
182
181
|
const tools = await getTools(this, outputParser);
|
|
183
182
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
184
183
|
try {
|
|
@@ -222,7 +221,7 @@ async function toolsAgentExecute() {
|
|
|
222
221
|
const response = await executor.invoke({
|
|
223
222
|
input,
|
|
224
223
|
system_message: options.systemMessage ?? prompt_1.SYSTEM_MESSAGE,
|
|
225
|
-
formatting_instructions: 'IMPORTANT:
|
|
224
|
+
formatting_instructions: 'IMPORTANT: For your response to user, you MUST use the `format_final_json_response` tool with your complete answer formatted according to the required schema. Do not attempt to format the JSON manually - always use this tool. Your response will be rejected if it is not properly formatted through this tool. Only use this tool once you are ready to provide your final answer.',
|
|
226
225
|
}, { signal: this.getExecutionCancelSignal() });
|
|
227
226
|
if (memory && outputParser) {
|
|
228
227
|
const parsedOutput = (0, n8n_workflow_1.jsonParse)(response.output);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ToolsAgent/execute.ts"],"names":[],"mappings":";;;AAiCA,sDAQC;AAaD,sDAoCC;AAgBD,wDAuBC;AAiCD,0DA6BC;AAUD,wDAQC;AAmED,oCASC;AAQD,8CAMC;AAUD,4BAoBC;AAUD,0CA0BC;AAQD,sCAEC;AAcD,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/agents/Agent/agents/ToolsAgent/execute.ts"],"names":[],"mappings":";;;AAiCA,sDAQC;AAaD,sDAoCC;AAgBD,wDAuBC;AAiCD,0DA6BC;AAUD,wDAQC;AAmED,oCASC;AAQD,8CAMC;AAUD,4BAoBC;AAUD,0CA0BC;AAQD,sCAEC;AAcD,8CAyGC;AA5eD,uDAAwD;AAGxD,qDAA6D;AAC7D,yDAA6D;AAE7D,iDAA8D;AAE9D,6CAAyE;AAEzE,mCAA8B;AAC9B,+CAAmG;AAGnG,6BAAwB;AAExB,4CAAyF;AACzF,2EAG+C;AAE/C,qCAA0C;AAS1C,SAAgB,qBAAqB,CACpC,YAA6B;IAG7B,MAAM,MAAM,GAEV,YAAY,CAAC,SAAS,EAAoC,IAAI,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,MAAM,CAAC;AACf,CAAC;AAaM,KAAK,UAAU,qBAAqB,CAC1C,GAAsB,EACtB,SAAiB;IAEjB,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC;IACjE,MAAM,cAA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AAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE;oBAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;iBAC/B,CAAC,CAAC;gBACH,SAAS;YACV,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -38,10 +38,10 @@ class OpenAiAssistant {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
inputs: [
|
|
41
|
-
{ type:
|
|
42
|
-
{ type:
|
|
41
|
+
{ type: n8n_workflow_1.NodeConnectionTypes.Main },
|
|
42
|
+
{ type: n8n_workflow_1.NodeConnectionTypes.AiTool, displayName: 'Tools' },
|
|
43
43
|
],
|
|
44
|
-
outputs: [
|
|
44
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
45
45
|
credentials: [
|
|
46
46
|
{
|
|
47
47
|
name: 'openAiApi',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAiAssistant.node.js","sourceRoot":"","sources":["../../../../nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAEjD,8EAAkF;AAClF,+
|
|
1
|
+
{"version":3,"file":"OpenAiAssistant.node.js","sourceRoot":"","sources":["../../../../nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts"],"names":[],"mappings":";;;AAAA,6CAAiD;AAEjD,8EAAkF;AAClF,+CAAuE;AAOvE,mCAAgD;AAEhD,4CAAmD;AACnD,4CAAkD;AAElD,mCAAsD;AAEtD,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,iBAAiB;YACvB,M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,EAAE,oBAAoB,CAAW,CAAC;oBAExF,KAAK,GAAG,MAAM,0CAAuB,CAAC,eAAe,CAAC;wBACrD,KAAK;wBACL,MAAM;wBACN,YAAY;wBACZ,IAAI;wBACJ,KAAK,EAAE,QAAQ;wBACf,OAAO,EAAE,IAAI;qBACb,CAAC,CAAC;gBACJ,CAAC;gBAED,MAAM,aAAa,GAAG,sBAAa,CAAC,iBAAiB,CAAC;oBACrD,KAAK;oBACL,KAAK;iBACL,CAAC,CAAC;gBAEH,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,UAAU,CAAC,IAAA,0BAAgB,EAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;oBAC9E,OAAO,EAAE,KAAK;oBACd,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE;oBACvC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;iBACjC,CAAC,CAAC;gBAEH,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;oBACrF,SAAS;gBACV,CAAC;gBAED,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA7XD,0CA6XC"}
|
|
@@ -1,144 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChainLlm = void 0;
|
|
4
|
-
const messages_1 = require("@langchain/core/messages");
|
|
5
|
-
const prompts_1 = require("@langchain/core/prompts");
|
|
6
|
-
const google_genai_1 = require("@langchain/google-genai");
|
|
7
|
-
const ollama_1 = require("@langchain/ollama");
|
|
8
|
-
const chains_1 = require("langchain/chains");
|
|
9
|
-
const output_parsers_1 = require("langchain/output_parsers");
|
|
10
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
11
|
-
const descriptions_1 = require("../../../utils/descriptions");
|
|
12
5
|
const helpers_1 = require("../../../utils/helpers");
|
|
13
6
|
const N8nOutputParser_1 = require("../../../utils/output_parsers/N8nOutputParser");
|
|
14
|
-
const
|
|
15
|
-
const tracing_1 = require("../../../utils/tracing");
|
|
16
|
-
const utils_1 = require("./utils");
|
|
7
|
+
const methods_1 = require("./methods");
|
|
17
8
|
const error_handling_1 = require("../../vendors/OpenAi/helpers/error-handling");
|
|
18
|
-
async function getImageMessage(context, itemIndex, message) {
|
|
19
|
-
if (message.messageType !== 'imageBinary' && message.messageType !== 'imageUrl') {
|
|
20
|
-
throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Invalid message type. Only imageBinary and imageUrl are supported');
|
|
21
|
-
}
|
|
22
|
-
const detail = message.imageDetail === 'auto' ? undefined : message.imageDetail;
|
|
23
|
-
if (message.messageType === 'imageUrl' && message.imageUrl) {
|
|
24
|
-
return new messages_1.HumanMessage({
|
|
25
|
-
content: [
|
|
26
|
-
{
|
|
27
|
-
type: 'image_url',
|
|
28
|
-
image_url: {
|
|
29
|
-
url: message.imageUrl,
|
|
30
|
-
detail,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const binaryDataKey = message.binaryImageDataKey ?? 'data';
|
|
37
|
-
const inputData = context.getInputData()[itemIndex];
|
|
38
|
-
const binaryData = inputData.binary?.[binaryDataKey];
|
|
39
|
-
if (!binaryData) {
|
|
40
|
-
throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'No binary data set.');
|
|
41
|
-
}
|
|
42
|
-
const bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);
|
|
43
|
-
const model = (await context.getInputConnectionData("ai_languageModel", 0));
|
|
44
|
-
try {
|
|
45
|
-
const dataURI = (0, utils_1.dataUriFromImageData)(binaryData, bufferData);
|
|
46
|
-
const directUriModels = [google_genai_1.ChatGoogleGenerativeAI, ollama_1.ChatOllama];
|
|
47
|
-
const imageUrl = directUriModels.some((i) => model instanceof i)
|
|
48
|
-
? dataURI
|
|
49
|
-
: { url: dataURI, detail };
|
|
50
|
-
return new messages_1.HumanMessage({
|
|
51
|
-
content: [
|
|
52
|
-
{
|
|
53
|
-
type: 'image_url',
|
|
54
|
-
image_url: imageUrl,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
if (error instanceof utils_1.UnsupportedMimeTypeError)
|
|
61
|
-
throw new n8n_workflow_1.NodeOperationError(context.getNode(), error.message);
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async function getChainPromptTemplate(context, itemIndex, llm, messages, formatInstructions, query) {
|
|
66
|
-
const queryTemplate = new prompts_1.PromptTemplate({
|
|
67
|
-
template: `{query}${formatInstructions ? '\n{formatInstructions}' : ''}`,
|
|
68
|
-
inputVariables: ['query'],
|
|
69
|
-
partialVariables: formatInstructions ? { formatInstructions } : undefined,
|
|
70
|
-
});
|
|
71
|
-
if ((0, helpers_1.isChatInstance)(llm)) {
|
|
72
|
-
const parsedMessages = await Promise.all((messages ?? []).map(async (message) => {
|
|
73
|
-
const messageClass = [
|
|
74
|
-
prompts_1.SystemMessagePromptTemplate,
|
|
75
|
-
prompts_1.AIMessagePromptTemplate,
|
|
76
|
-
prompts_1.HumanMessagePromptTemplate,
|
|
77
|
-
].find((m) => m.lc_name() === message.type);
|
|
78
|
-
if (!messageClass) {
|
|
79
|
-
throw new n8n_workflow_1.ApplicationError('Invalid message type', {
|
|
80
|
-
extra: { messageType: message.type },
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (messageClass === prompts_1.HumanMessagePromptTemplate && message.messageType !== 'text') {
|
|
84
|
-
const test = await getImageMessage(context, itemIndex, message);
|
|
85
|
-
return test;
|
|
86
|
-
}
|
|
87
|
-
const res = messageClass.fromTemplate((message.message || '').replace(/[{}]/g, (match) => match + match));
|
|
88
|
-
return res;
|
|
89
|
-
}));
|
|
90
|
-
const lastMessage = parsedMessages[parsedMessages.length - 1];
|
|
91
|
-
if (lastMessage instanceof messages_1.HumanMessage && Array.isArray(lastMessage.content)) {
|
|
92
|
-
const humanMessage = new prompts_1.HumanMessagePromptTemplate(queryTemplate);
|
|
93
|
-
const test = await humanMessage.format({ query });
|
|
94
|
-
lastMessage.content.push({ text: test.content.toString(), type: 'text' });
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
parsedMessages.push(new prompts_1.HumanMessagePromptTemplate(queryTemplate));
|
|
98
|
-
}
|
|
99
|
-
return prompts_1.ChatPromptTemplate.fromMessages(parsedMessages);
|
|
100
|
-
}
|
|
101
|
-
return queryTemplate;
|
|
102
|
-
}
|
|
103
|
-
async function createSimpleLLMChain(context, llm, query, prompt) {
|
|
104
|
-
const chain = new chains_1.LLMChain({
|
|
105
|
-
llm,
|
|
106
|
-
prompt,
|
|
107
|
-
}).withConfig((0, tracing_1.getTracingConfig)(context));
|
|
108
|
-
const response = (await chain.invoke({
|
|
109
|
-
query,
|
|
110
|
-
signal: context.getExecutionCancelSignal(),
|
|
111
|
-
}));
|
|
112
|
-
return Array.isArray(response) ? response : [response];
|
|
113
|
-
}
|
|
114
|
-
async function getChain(context, itemIndex, query, llm, outputParsers, messages) {
|
|
115
|
-
const chatTemplate = await getChainPromptTemplate(context, itemIndex, llm, messages, undefined, query);
|
|
116
|
-
if (!outputParsers.length) {
|
|
117
|
-
return await createSimpleLLMChain(context, llm, query, chatTemplate);
|
|
118
|
-
}
|
|
119
|
-
const combinedOutputParser = outputParsers.length === 1 ? outputParsers[0] : new output_parsers_1.CombiningOutputParser(...outputParsers);
|
|
120
|
-
const formatInstructions = combinedOutputParser.getFormatInstructions();
|
|
121
|
-
const prompt = await getChainPromptTemplate(context, itemIndex, llm, messages, formatInstructions, query);
|
|
122
|
-
const chain = prompt.pipe(llm).pipe(combinedOutputParser);
|
|
123
|
-
const response = (await chain.withConfig((0, tracing_1.getTracingConfig)(context)).invoke({ query }));
|
|
124
|
-
return Array.isArray(response) ? response : [response];
|
|
125
|
-
}
|
|
126
|
-
function getInputs(parameters) {
|
|
127
|
-
const hasOutputParser = parameters?.hasOutputParser;
|
|
128
|
-
const inputs = [
|
|
129
|
-
{ displayName: '', type: "main" },
|
|
130
|
-
{
|
|
131
|
-
displayName: 'Model',
|
|
132
|
-
maxConnections: 1,
|
|
133
|
-
type: "ai_languageModel",
|
|
134
|
-
required: true,
|
|
135
|
-
},
|
|
136
|
-
];
|
|
137
|
-
if (hasOutputParser === undefined || hasOutputParser === true) {
|
|
138
|
-
inputs.push({ displayName: 'Output Parser', type: "ai_outputParser" });
|
|
139
|
-
}
|
|
140
|
-
return inputs;
|
|
141
|
-
}
|
|
142
9
|
class ChainLlm {
|
|
143
10
|
constructor() {
|
|
144
11
|
this.description = {
|
|
@@ -167,244 +34,21 @@ class ChainLlm {
|
|
|
167
34
|
],
|
|
168
35
|
},
|
|
169
36
|
},
|
|
170
|
-
inputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
|
171
|
-
outputs: [
|
|
37
|
+
inputs: `={{ ((parameter) => { ${methods_1.getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,
|
|
38
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
172
39
|
credentials: [],
|
|
173
|
-
properties:
|
|
174
|
-
(0, sharedFields_1.getTemplateNoticeField)(1978),
|
|
175
|
-
{
|
|
176
|
-
displayName: 'Prompt',
|
|
177
|
-
name: 'prompt',
|
|
178
|
-
type: 'string',
|
|
179
|
-
required: true,
|
|
180
|
-
default: '={{ $json.input }}',
|
|
181
|
-
displayOptions: {
|
|
182
|
-
show: {
|
|
183
|
-
'@version': [1],
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
displayName: 'Prompt',
|
|
189
|
-
name: 'prompt',
|
|
190
|
-
type: 'string',
|
|
191
|
-
required: true,
|
|
192
|
-
default: '={{ $json.chat_input }}',
|
|
193
|
-
displayOptions: {
|
|
194
|
-
show: {
|
|
195
|
-
'@version': [1.1, 1.2],
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
displayName: 'Prompt',
|
|
201
|
-
name: 'prompt',
|
|
202
|
-
type: 'string',
|
|
203
|
-
required: true,
|
|
204
|
-
default: '={{ $json.chatInput }}',
|
|
205
|
-
displayOptions: {
|
|
206
|
-
show: {
|
|
207
|
-
'@version': [1.3],
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
...descriptions_1.promptTypeOptions,
|
|
213
|
-
displayOptions: {
|
|
214
|
-
hide: {
|
|
215
|
-
'@version': [1, 1.1, 1.2, 1.3],
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
...descriptions_1.textFromPreviousNode,
|
|
221
|
-
displayOptions: { show: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.5 } }] } },
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
displayName: 'Prompt (User Message)',
|
|
225
|
-
name: 'text',
|
|
226
|
-
type: 'string',
|
|
227
|
-
required: true,
|
|
228
|
-
default: '',
|
|
229
|
-
placeholder: 'e.g. Hello, how can you help me?',
|
|
230
|
-
typeOptions: {
|
|
231
|
-
rows: 2,
|
|
232
|
-
},
|
|
233
|
-
displayOptions: {
|
|
234
|
-
show: {
|
|
235
|
-
promptType: ['define'],
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
displayName: 'Require Specific Output Format',
|
|
241
|
-
name: 'hasOutputParser',
|
|
242
|
-
type: 'boolean',
|
|
243
|
-
default: false,
|
|
244
|
-
noDataExpression: true,
|
|
245
|
-
displayOptions: {
|
|
246
|
-
hide: {
|
|
247
|
-
'@version': [1, 1.1, 1.3],
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
displayName: 'Chat Messages (if Using a Chat Model)',
|
|
253
|
-
name: 'messages',
|
|
254
|
-
type: 'fixedCollection',
|
|
255
|
-
typeOptions: {
|
|
256
|
-
multipleValues: true,
|
|
257
|
-
},
|
|
258
|
-
default: {},
|
|
259
|
-
placeholder: 'Add prompt',
|
|
260
|
-
options: [
|
|
261
|
-
{
|
|
262
|
-
name: 'messageValues',
|
|
263
|
-
displayName: 'Prompt',
|
|
264
|
-
values: [
|
|
265
|
-
{
|
|
266
|
-
displayName: 'Type Name or ID',
|
|
267
|
-
name: 'type',
|
|
268
|
-
type: 'options',
|
|
269
|
-
options: [
|
|
270
|
-
{
|
|
271
|
-
name: 'AI',
|
|
272
|
-
value: prompts_1.AIMessagePromptTemplate.lc_name(),
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: 'System',
|
|
276
|
-
value: prompts_1.SystemMessagePromptTemplate.lc_name(),
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
name: 'User',
|
|
280
|
-
value: prompts_1.HumanMessagePromptTemplate.lc_name(),
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
default: prompts_1.SystemMessagePromptTemplate.lc_name(),
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
displayName: 'Message Type',
|
|
287
|
-
name: 'messageType',
|
|
288
|
-
type: 'options',
|
|
289
|
-
displayOptions: {
|
|
290
|
-
show: {
|
|
291
|
-
type: [prompts_1.HumanMessagePromptTemplate.lc_name()],
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
options: [
|
|
295
|
-
{
|
|
296
|
-
name: 'Text',
|
|
297
|
-
value: 'text',
|
|
298
|
-
description: 'Simple text message',
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
name: 'Image (Binary)',
|
|
302
|
-
value: 'imageBinary',
|
|
303
|
-
description: 'Process the binary input from the previous node',
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
name: 'Image (URL)',
|
|
307
|
-
value: 'imageUrl',
|
|
308
|
-
description: 'Process the image from the specified URL',
|
|
309
|
-
},
|
|
310
|
-
],
|
|
311
|
-
default: 'text',
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
displayName: 'Image Data Field Name',
|
|
315
|
-
name: 'binaryImageDataKey',
|
|
316
|
-
type: 'string',
|
|
317
|
-
default: 'data',
|
|
318
|
-
required: true,
|
|
319
|
-
description: 'The name of the field in the chain’s input that contains the binary image file to be processed',
|
|
320
|
-
displayOptions: {
|
|
321
|
-
show: {
|
|
322
|
-
messageType: ['imageBinary'],
|
|
323
|
-
},
|
|
324
|
-
},
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
displayName: 'Image URL',
|
|
328
|
-
name: 'imageUrl',
|
|
329
|
-
type: 'string',
|
|
330
|
-
default: '',
|
|
331
|
-
required: true,
|
|
332
|
-
description: 'URL to the image to be processed',
|
|
333
|
-
displayOptions: {
|
|
334
|
-
show: {
|
|
335
|
-
messageType: ['imageUrl'],
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
displayName: 'Image Details',
|
|
341
|
-
description: 'Control how the model processes the image and generates its textual understanding',
|
|
342
|
-
name: 'imageDetail',
|
|
343
|
-
type: 'options',
|
|
344
|
-
displayOptions: {
|
|
345
|
-
show: {
|
|
346
|
-
type: [prompts_1.HumanMessagePromptTemplate.lc_name()],
|
|
347
|
-
messageType: ['imageBinary', 'imageUrl'],
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
options: [
|
|
351
|
-
{
|
|
352
|
-
name: 'Auto',
|
|
353
|
-
value: 'auto',
|
|
354
|
-
description: 'Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting',
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
name: 'Low',
|
|
358
|
-
value: 'low',
|
|
359
|
-
description: 'The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail.',
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
name: 'High',
|
|
363
|
-
value: 'high',
|
|
364
|
-
description: 'Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens.',
|
|
365
|
-
},
|
|
366
|
-
],
|
|
367
|
-
default: 'auto',
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
displayName: 'Message',
|
|
371
|
-
name: 'message',
|
|
372
|
-
type: 'string',
|
|
373
|
-
required: true,
|
|
374
|
-
displayOptions: {
|
|
375
|
-
hide: {
|
|
376
|
-
messageType: ['imageBinary', 'imageUrl'],
|
|
377
|
-
},
|
|
378
|
-
},
|
|
379
|
-
default: '',
|
|
380
|
-
},
|
|
381
|
-
],
|
|
382
|
-
},
|
|
383
|
-
],
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${"ai_outputParser"}'>output parser</a> on the canvas to specify the output format you require`,
|
|
387
|
-
name: 'notice',
|
|
388
|
-
type: 'notice',
|
|
389
|
-
default: '',
|
|
390
|
-
displayOptions: {
|
|
391
|
-
show: {
|
|
392
|
-
hasOutputParser: [true],
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
],
|
|
40
|
+
properties: methods_1.nodeProperties,
|
|
397
41
|
};
|
|
398
42
|
}
|
|
399
43
|
async execute() {
|
|
400
|
-
this.logger.debug('Executing LLM Chain');
|
|
44
|
+
this.logger.debug('Executing Basic LLM Chain');
|
|
401
45
|
const items = this.getInputData();
|
|
402
46
|
const returnData = [];
|
|
403
47
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
404
48
|
try {
|
|
49
|
+
const llm = (await this.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiLanguageModel, 0));
|
|
50
|
+
const outputParser = await (0, N8nOutputParser_1.getOptionalOutputParser)(this);
|
|
405
51
|
let prompt;
|
|
406
|
-
const llm = (await this.getInputConnectionData("ai_languageModel", 0));
|
|
407
|
-
const outputParsers = await (0, N8nOutputParser_1.getOptionalOutputParsers)(this);
|
|
408
52
|
if (this.getNode().typeVersion <= 1.3) {
|
|
409
53
|
prompt = this.getNodeParameter('prompt', itemIndex);
|
|
410
54
|
}
|
|
@@ -416,37 +60,21 @@ class ChainLlm {
|
|
|
416
60
|
promptTypeKey: 'promptType',
|
|
417
61
|
});
|
|
418
62
|
}
|
|
419
|
-
const messages = this.getNodeParameter('messages.messageValues', itemIndex, []);
|
|
420
63
|
if (prompt === undefined) {
|
|
421
64
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), "The 'prompt' parameter is empty.");
|
|
422
65
|
}
|
|
423
|
-
const
|
|
66
|
+
const messages = this.getNodeParameter('messages.messageValues', itemIndex, []);
|
|
67
|
+
const responses = await (0, methods_1.executeChain)({
|
|
68
|
+
context: this,
|
|
69
|
+
itemIndex,
|
|
70
|
+
query: prompt,
|
|
71
|
+
llm,
|
|
72
|
+
outputParser,
|
|
73
|
+
messages,
|
|
74
|
+
});
|
|
424
75
|
responses.forEach((response) => {
|
|
425
|
-
let data;
|
|
426
|
-
if (typeof response === 'string') {
|
|
427
|
-
data = {
|
|
428
|
-
response: {
|
|
429
|
-
text: response.trim(),
|
|
430
|
-
},
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
else if (Array.isArray(response)) {
|
|
434
|
-
data = {
|
|
435
|
-
data: response,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
else if (response instanceof Object) {
|
|
439
|
-
data = response;
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
data = {
|
|
443
|
-
response: {
|
|
444
|
-
text: response,
|
|
445
|
-
},
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
76
|
returnData.push({
|
|
449
|
-
json:
|
|
77
|
+
json: (0, methods_1.formatResponse)(response),
|
|
450
78
|
});
|
|
451
79
|
});
|
|
452
80
|
}
|