@atom8n/n8n-nodes-langchain 2.2.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/README.md +9 -0
- package/dist/credentials/AnthropicApi.credentials.js +106 -0
- package/dist/credentials/AnthropicApi.credentials.js.map +1 -0
- package/dist/credentials/AzureAiSearchApi.credentials.js +75 -0
- package/dist/credentials/AzureAiSearchApi.credentials.js.map +1 -0
- package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js +133 -0
- package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/AzureOpenAiApi.credentials.js +74 -0
- package/dist/credentials/AzureOpenAiApi.credentials.js.map +1 -0
- package/dist/credentials/CohereApi.credentials.js +65 -0
- package/dist/credentials/CohereApi.credentials.js.map +1 -0
- package/dist/credentials/DeepSeekApi.credentials.js +65 -0
- package/dist/credentials/DeepSeekApi.credentials.js.map +1 -0
- package/dist/credentials/GooglePalmApi.credentials.js +65 -0
- package/dist/credentials/GooglePalmApi.credentials.js.map +1 -0
- package/dist/credentials/GroqApi.credentials.js +59 -0
- package/dist/credentials/GroqApi.credentials.js.map +1 -0
- package/dist/credentials/HuggingFaceApi.credentials.js +59 -0
- package/dist/credentials/HuggingFaceApi.credentials.js.map +1 -0
- package/dist/credentials/LemonadeApi.credentials.js +70 -0
- package/dist/credentials/LemonadeApi.credentials.js.map +1 -0
- package/dist/credentials/McpOAuth2Api.credentials.js +44 -0
- package/dist/credentials/McpOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/MilvusApi.credentials.js +72 -0
- package/dist/credentials/MilvusApi.credentials.js.map +1 -0
- package/dist/credentials/MistralCloudApi.credentials.js +60 -0
- package/dist/credentials/MistralCloudApi.credentials.js.map +1 -0
- package/dist/credentials/MotorheadApi.credentials.js +72 -0
- package/dist/credentials/MotorheadApi.credentials.js.map +1 -0
- package/dist/credentials/OllamaApi.credentials.js +68 -0
- package/dist/credentials/OllamaApi.credentials.js.map +1 -0
- package/dist/credentials/OpenRouterApi.credentials.js +65 -0
- package/dist/credentials/OpenRouterApi.credentials.js.map +1 -0
- package/dist/credentials/PineconeApi.credentials.js +61 -0
- package/dist/credentials/PineconeApi.credentials.js.map +1 -0
- package/dist/credentials/QdrantApi.credentials.js +66 -0
- package/dist/credentials/QdrantApi.credentials.js.map +1 -0
- package/dist/credentials/SearXngApi.credentials.js +44 -0
- package/dist/credentials/SearXngApi.credentials.js.map +1 -0
- package/dist/credentials/SerpApi.credentials.js +59 -0
- package/dist/credentials/SerpApi.credentials.js.map +1 -0
- package/dist/credentials/VercelAiGatewayApi.credentials.js +81 -0
- package/dist/credentials/VercelAiGatewayApi.credentials.js.map +1 -0
- package/dist/credentials/WeaviateApi.credentials.js +164 -0
- package/dist/credentials/WeaviateApi.credentials.js.map +1 -0
- package/dist/credentials/WolframAlphaApi.credentials.js +63 -0
- package/dist/credentials/WolframAlphaApi.credentials.js.map +1 -0
- package/dist/credentials/XAiApi.credentials.js +65 -0
- package/dist/credentials/XAiApi.credentials.js.map +1 -0
- package/dist/credentials/XataApi.credentials.js +73 -0
- package/dist/credentials/XataApi.credentials.js.map +1 -0
- package/dist/credentials/ZepApi.credentials.js +84 -0
- package/dist/credentials/ZepApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +210 -0
- package/dist/known/nodes.json +426 -0
- package/dist/methods/defined.json +11 -0
- package/dist/methods/referenced.json +11 -0
- package/dist/nodes/Guardrails/Guardrails.node.js +62 -0
- package/dist/nodes/Guardrails/Guardrails.node.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/jailbreak.js +50 -0
- package/dist/nodes/Guardrails/actions/checks/jailbreak.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/keywords.js +84 -0
- package/dist/nodes/Guardrails/actions/checks/keywords.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/nsfw.js +53 -0
- package/dist/nodes/Guardrails/actions/checks/nsfw.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/pii.js +232 -0
- package/dist/nodes/Guardrails/actions/checks/pii.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/secretKeys.js +201 -0
- package/dist/nodes/Guardrails/actions/checks/secretKeys.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/topicalAlignment.js +38 -0
- package/dist/nodes/Guardrails/actions/checks/topicalAlignment.js.map +1 -0
- package/dist/nodes/Guardrails/actions/checks/urls.js +245 -0
- package/dist/nodes/Guardrails/actions/checks/urls.js.map +1 -0
- package/dist/nodes/Guardrails/actions/execute.js +68 -0
- package/dist/nodes/Guardrails/actions/execute.js.map +1 -0
- package/dist/nodes/Guardrails/actions/process.js +223 -0
- package/dist/nodes/Guardrails/actions/process.js.map +1 -0
- package/dist/nodes/Guardrails/actions/types.js +35 -0
- package/dist/nodes/Guardrails/actions/types.js.map +1 -0
- package/dist/nodes/Guardrails/description.js +415 -0
- package/dist/nodes/Guardrails/description.js.map +1 -0
- package/dist/nodes/Guardrails/guardrails.svg +11 -0
- package/dist/nodes/Guardrails/helpers/base.js +67 -0
- package/dist/nodes/Guardrails/helpers/base.js.map +1 -0
- package/dist/nodes/Guardrails/helpers/common.js +45 -0
- package/dist/nodes/Guardrails/helpers/common.js.map +1 -0
- package/dist/nodes/Guardrails/helpers/configureNodeInputs.js +84 -0
- package/dist/nodes/Guardrails/helpers/configureNodeInputs.js.map +1 -0
- package/dist/nodes/Guardrails/helpers/mappers.js +100 -0
- package/dist/nodes/Guardrails/helpers/mappers.js.map +1 -0
- package/dist/nodes/Guardrails/helpers/model.js +144 -0
- package/dist/nodes/Guardrails/helpers/model.js.map +1 -0
- package/dist/nodes/Guardrails/helpers/preflight.js +61 -0
- package/dist/nodes/Guardrails/helpers/preflight.js.map +1 -0
- package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js +59 -0
- package/dist/nodes/Guardrails/v1/GuardrailsV1.node.js.map +1 -0
- package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js +59 -0
- package/dist/nodes/Guardrails/v2/GuardrailsV2.node.js.map +1 -0
- package/dist/nodes/ModelSelector/ModelSelector.node.js +188 -0
- package/dist/nodes/ModelSelector/ModelSelector.node.js.map +1 -0
- package/dist/nodes/ModelSelector/helpers.js +85 -0
- package/dist/nodes/ModelSelector/helpers.js.map +1 -0
- package/dist/nodes/ToolExecutor/ToolExecutor.node.js +105 -0
- package/dist/nodes/ToolExecutor/ToolExecutor.node.js.map +1 -0
- package/dist/nodes/ToolExecutor/ToolExecutor.node.json +17 -0
- package/dist/nodes/ToolExecutor/utils/convertToSchema.js +64 -0
- package/dist/nodes/ToolExecutor/utils/convertToSchema.js.map +1 -0
- package/dist/nodes/ToolExecutor/utils/executeTool.js +39 -0
- package/dist/nodes/ToolExecutor/utils/executeTool.js.map +1 -0
- package/dist/nodes/agents/Agent/Agent.node.js +79 -0
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -0
- package/dist/nodes/agents/Agent/AgentTool.node.js +59 -0
- package/dist/nodes/agents/Agent/AgentTool.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js +449 -0
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js +104 -0
- package/dist/nodes/agents/Agent/V2/AgentToolV2.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js +153 -0
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V2/utils.js +92 -0
- package/dist/nodes/agents/Agent/V2/utils.js.map +1 -0
- package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js +99 -0
- package/dist/nodes/agents/Agent/V3/AgentToolV3.node.js.map +1 -0
- package/dist/nodes/agents/Agent/V3/AgentV3.node.js +141 -0
- package/dist/nodes/agents/Agent/V3/AgentV3.node.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +118 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +107 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js +50 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/prompt.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +108 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +32 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js +29 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/prompt.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js +94 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js +97 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js +35 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/prompt.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +138 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +108 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js +41 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/prompt.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +227 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +137 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/mysql.js +44 -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.js +45 -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.js +72 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/handlers/sqlite.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js +49 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/other/prompts.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/description.js +44 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js +129 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V1/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +71 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +295 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js +57 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +64 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildExecutionContext.js +74 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildExecutionContext.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildResponseMetadata.js +37 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/buildResponseMetadata.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/checkMaxIterations.js +40 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/checkMaxIterations.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js +61 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/createAgentSequence.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js +92 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/executeBatch.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/finalizeResult.js +58 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/finalizeResult.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/index.js +50 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/index.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/prepareItemContext.js +66 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/prepareItemContext.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js +91 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/helpers/runAgent.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/types.js +17 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/types.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js +265 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js +62 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/options.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js +29 -0
- package/dist/nodes/agents/Agent/agents/ToolsAgent/prompt.js.map +1 -0
- package/dist/nodes/agents/Agent/agents/utils.js +54 -0
- package/dist/nodes/agents/Agent/agents/utils.js.map +1 -0
- package/dist/nodes/agents/Agent/utils.js +92 -0
- package/dist/nodes/agents/Agent/utils.js.map +1 -0
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +397 -0
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -0
- package/dist/nodes/agents/OpenAiAssistant/utils.js +61 -0
- package/dist/nodes/agents/OpenAiAssistant/utils.js.map +1 -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/ChainLLM/methods/chainExecutor.js +148 -0
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/config.js +328 -0
- package/dist/nodes/chains/ChainLLM/methods/config.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/imageUtils.js +100 -0
- package/dist/nodes/chains/ChainLLM/methods/imageUtils.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/index.js +37 -0
- package/dist/nodes/chains/ChainLLM/methods/index.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/processItem.js +98 -0
- package/dist/nodes/chains/ChainLLM/methods/processItem.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/promptUtils.js +142 -0
- package/dist/nodes/chains/ChainLLM/methods/promptUtils.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js +53 -0
- package/dist/nodes/chains/ChainLLM/methods/responseFormatter.js.map +1 -0
- package/dist/nodes/chains/ChainLLM/methods/types.js +17 -0
- package/dist/nodes/chains/ChainLLM/methods/types.js.map +1 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +264 -0
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -0
- package/dist/nodes/chains/ChainRetrievalQA/constants.js +49 -0
- package/dist/nodes/chains/ChainRetrievalQA/constants.js.map +1 -0
- package/dist/nodes/chains/ChainRetrievalQA/processItem.js +91 -0
- package/dist/nodes/chains/ChainRetrievalQA/processItem.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js +64 -0
- package/dist/nodes/chains/ChainSummarization/ChainSummarization.node.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +242 -0
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +378 -0
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/V2/processItem.js +95 -0
- package/dist/nodes/chains/ChainSummarization/V2/processItem.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/helpers.js +74 -0
- package/dist/nodes/chains/ChainSummarization/helpers.js.map +1 -0
- package/dist/nodes/chains/ChainSummarization/prompt.js +49 -0
- package/dist/nodes/chains/ChainSummarization/prompt.js.map +1 -0
- package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js +315 -0
- package/dist/nodes/chains/InformationExtractor/InformationExtractor.node.js.map +1 -0
- package/dist/nodes/chains/InformationExtractor/constants.js +31 -0
- package/dist/nodes/chains/InformationExtractor/constants.js.map +1 -0
- package/dist/nodes/chains/InformationExtractor/helpers.js +54 -0
- package/dist/nodes/chains/InformationExtractor/helpers.js.map +1 -0
- package/dist/nodes/chains/InformationExtractor/processItem.js +56 -0
- package/dist/nodes/chains/InformationExtractor/processItem.js.map +1 -0
- package/dist/nodes/chains/InformationExtractor/types.js +17 -0
- package/dist/nodes/chains/InformationExtractor/types.js.map +1 -0
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js +366 -0
- package/dist/nodes/chains/SentimentAnalysis/SentimentAnalysis.node.js.map +1 -0
- package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +303 -0
- package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -0
- package/dist/nodes/chains/TextClassifier/constants.js +29 -0
- package/dist/nodes/chains/TextClassifier/constants.js.map +1 -0
- package/dist/nodes/chains/TextClassifier/processItem.js +65 -0
- package/dist/nodes/chains/TextClassifier/processItem.js.map +1 -0
- package/dist/nodes/code/Code.node.js +413 -0
- package/dist/nodes/code/Code.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +203 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/binary.svg +1 -0
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +348 -0
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/binary.svg +1 -0
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +182 -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.js +109 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -0
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/json.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +155 -0
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/bedrock.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +171 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/azure.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +131 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/cohere.dark.svg +5 -0
- package/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg +5 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +152 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/google.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js +164 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsGoogleVertex/google.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +134 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js +87 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/lemonade.svg +53 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +170 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/mistral.svg +262 -0
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +82 -0
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsOllama/ollama.svg +1 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +274 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/openAiLight.dark.svg +3 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/openAiLight.svg +3 -0
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +344 -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/LMChatAnthropic/methods/searchModels.js +66 -0
- package/dist/nodes/llms/LMChatAnthropic/methods/searchModels.js.map +1 -0
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js +106 -0
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMChatLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +92 -0
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -0
- package/dist/nodes/llms/LMChatOllama/ollama.svg +1 -0
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +800 -0
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LMChatOpenAi/common.js +155 -0
- package/dist/nodes/llms/LMChatOpenAi/common.js.map +1 -0
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +71 -0
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -0
- package/dist/nodes/llms/LMChatOpenAi/openAiLight.dark.svg +3 -0
- package/dist/nodes/llms/LMChatOpenAi/openAiLight.svg +3 -0
- package/dist/nodes/llms/LMChatOpenAi/types.js +17 -0
- package/dist/nodes/llms/LMChatOpenAi/types.js.map +1 -0
- package/dist/nodes/llms/LMCohere/LmCohere.node.js +122 -0
- package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -0
- package/dist/nodes/llms/LMCohere/cohere.dark.svg +5 -0
- package/dist/nodes/llms/LMCohere/cohere.svg +5 -0
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js +107 -0
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/description.js +147 -0
- package/dist/nodes/llms/LMLemonade/description.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LMOllama/LmOllama.node.js +91 -0
- package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -0
- package/dist/nodes/llms/LMOllama/description.js +242 -0
- package/dist/nodes/llms/LMOllama/description.js.map +1 -0
- package/dist/nodes/llms/LMOllama/ollama.svg +1 -0
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +255 -0
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LMOpenAi/openAiLight.dark.svg +3 -0
- package/dist/nodes/llms/LMOpenAi/openAiLight.svg +3 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +162 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -0
- package/dist/nodes/llms/LMOpenHuggingFaceInference/huggingface.svg +1 -0
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +272 -0
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -0
- package/dist/nodes/llms/LmChatAwsBedrock/bedrock.svg +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +149 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/azure.svg +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js +75 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/N8nOAuth2TokenCredential.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/api-key.js +53 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/api-key.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/oauth2.js +54 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/credentials/oauth2.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/properties.js +155 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/properties.js.map +1 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/types.js +42 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/types.js.map +1 -0
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js +181 -0
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js.map +1 -0
- package/dist/nodes/llms/LmChatCohere/cohere.dark.svg +5 -0
- package/dist/nodes/llms/LmChatCohere/cohere.svg +5 -0
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +248 -0
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -0
- package/dist/nodes/llms/LmChatDeepSeek/deepseek.svg +1 -0
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +171 -0
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -0
- package/dist/nodes/llms/LmChatGoogleGemini/google.svg +1 -0
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +214 -0
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -0
- package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js +40 -0
- package/dist/nodes/llms/LmChatGoogleVertex/error-handling.js.map +1 -0
- package/dist/nodes/llms/LmChatGoogleVertex/google.svg +1 -0
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +166 -0
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -0
- package/dist/nodes/llms/LmChatGroq/groq.svg +20 -0
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +222 -0
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -0
- package/dist/nodes/llms/LmChatMistralCloud/mistral.svg +262 -0
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +248 -0
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -0
- package/dist/nodes/llms/LmChatOpenRouter/openrouter.dark.svg +1 -0
- package/dist/nodes/llms/LmChatOpenRouter/openrouter.svg +1 -0
- package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js +248 -0
- package/dist/nodes/llms/LmChatVercelAiGateway/LmChatVercelAiGateway.node.js.map +1 -0
- package/dist/nodes/llms/LmChatVercelAiGateway/vercel.dark.svg +1 -0
- package/dist/nodes/llms/LmChatVercelAiGateway/vercel.svg +6 -0
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +251 -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.js +202 -0
- package/dist/nodes/llms/N8nLlmTracing.js.map +1 -0
- package/dist/nodes/llms/N8nNonEstimatingTracing.js +167 -0
- package/dist/nodes/llms/N8nNonEstimatingTracing.js.map +1 -0
- package/dist/nodes/llms/gemini-common/additional-options.js +126 -0
- package/dist/nodes/llms/gemini-common/additional-options.js.map +1 -0
- package/dist/nodes/llms/gemini-common/safety-options.js +79 -0
- package/dist/nodes/llms/gemini-common/safety-options.js.map +1 -0
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +66 -0
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +1 -0
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js +50 -0
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js.map +1 -0
- package/dist/nodes/mcp/McpClient/McpClient.node.js +335 -0
- package/dist/nodes/mcp/McpClient/McpClient.node.js.map +1 -0
- package/dist/nodes/mcp/McpClient/listSearch.js +58 -0
- package/dist/nodes/mcp/McpClient/listSearch.js.map +1 -0
- package/dist/nodes/mcp/McpClient/resourceMapping.js +61 -0
- package/dist/nodes/mcp/McpClient/resourceMapping.js.map +1 -0
- package/dist/nodes/mcp/McpClient/utils.js +248 -0
- package/dist/nodes/mcp/McpClient/utils.js.map +1 -0
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js +402 -0
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -0
- package/dist/nodes/mcp/McpClientTool/loadOptions.js +61 -0
- package/dist/nodes/mcp/McpClientTool/loadOptions.js.map +1 -0
- package/dist/nodes/mcp/McpClientTool/types.js +17 -0
- package/dist/nodes/mcp/McpClientTool/types.js.map +1 -0
- package/dist/nodes/mcp/McpClientTool/utils.js +120 -0
- package/dist/nodes/mcp/McpClientTool/utils.js.map +1 -0
- package/dist/nodes/mcp/McpTrigger/FlushingTransport.js +60 -0
- package/dist/nodes/mcp/McpTrigger/FlushingTransport.js.map +1 -0
- package/dist/nodes/mcp/McpTrigger/McpServer.js +255 -0
- package/dist/nodes/mcp/McpTrigger/McpServer.js.map +1 -0
- package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js +199 -0
- package/dist/nodes/mcp/McpTrigger/McpTrigger.node.js.map +1 -0
- package/dist/nodes/mcp/mcp.dark.svg +7 -0
- package/dist/nodes/mcp/mcp.svg +7 -0
- package/dist/nodes/mcp/shared/descriptions.js +89 -0
- package/dist/nodes/mcp/shared/descriptions.js.map +1 -0
- package/dist/nodes/mcp/shared/types.js +17 -0
- package/dist/nodes/mcp/shared/types.js.map +1 -0
- package/dist/nodes/mcp/shared/utils.js +231 -0
- package/dist/nodes/mcp/shared/utils.js.map +1 -0
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +163 -0
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -0
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +116 -0
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -0
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +387 -0
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -0
- package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js +156 -0
- package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js.map +1 -0
- package/dist/nodes/memory/MemoryMongoDbChat/mongodb.dark.svg +3 -0
- package/dist/nodes/memory/MemoryMongoDbChat/mongodb.svg +3 -0
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +134 -0
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -0
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +123 -0
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -0
- package/dist/nodes/memory/MemoryPostgresChat/postgres.svg +1 -0
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +179 -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.js +160 -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.js +175 -0
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -0
- package/dist/nodes/memory/MemoryZep/zep.png +0 -0
- package/dist/nodes/memory/descriptions.js +85 -0
- package/dist/nodes/memory/descriptions.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +133 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js +44 -0
- package/dist/nodes/output_parser/OutputParserAutofixing/prompt.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +106 -0
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +239 -0
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -0
- package/dist/nodes/output_parser/OutputParserStructured/prompt.js +44 -0
- package/dist/nodes/output_parser/OutputParserStructured/prompt.js.map +1 -0
- package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js +116 -0
- package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js.map +1 -0
- package/dist/nodes/rerankers/RerankerCohere/cohere.dark.svg +5 -0
- package/dist/nodes/rerankers/RerankerCohere/cohere.svg +5 -0
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +102 -0
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -0
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +121 -0
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -0
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +100 -0
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -0
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +429 -0
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +103 -0
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +139 -0
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +97 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js +86 -0
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js.map +1 -0
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +94 -0
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -0
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +325 -0
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -0
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +396 -0
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -0
- package/dist/nodes/tools/ToolHttpRequest/descriptions.js +426 -0
- package/dist/nodes/tools/ToolHttpRequest/descriptions.js.map +1 -0
- package/dist/nodes/tools/ToolHttpRequest/httprequest.dark.svg +3 -0
- package/dist/nodes/tools/ToolHttpRequest/httprequest.svg +1 -0
- package/dist/nodes/tools/ToolHttpRequest/interfaces.js +17 -0
- package/dist/nodes/tools/ToolHttpRequest/interfaces.js.map +1 -0
- package/dist/nodes/tools/ToolHttpRequest/utils.js +651 -0
- package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -0
- package/dist/nodes/tools/ToolSearXng/ToolSearXng.node.js +155 -0
- package/dist/nodes/tools/ToolSearXng/ToolSearXng.node.js.map +1 -0
- package/dist/nodes/tools/ToolSearXng/searXng.svg +1 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +163 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -0
- package/dist/nodes/tools/ToolSerpApi/serpApi.svg +1 -0
- package/dist/nodes/tools/ToolThink/ToolThink.node.js +118 -0
- package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -0
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +161 -0
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -0
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +93 -0
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -0
- package/dist/nodes/tools/ToolWikipedia/wikipedia.svg +1 -0
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +95 -0
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -0
- package/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg +1 -0
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +68 -0
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js +202 -0
- package/dist/nodes/tools/ToolWorkflow/v1/ToolWorkflowV1.node.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +347 -0
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js +87 -0
- package/dist/nodes/tools/ToolWorkflow/v2/ToolWorkflowV2.node.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js +39 -0
- package/dist/nodes/tools/ToolWorkflow/v2/methods/index.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js +47 -0
- package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +308 -0
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -0
- package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js +172 -0
- package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/Chat.node.js +277 -0
- package/dist/nodes/trigger/ChatTrigger/Chat.node.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +813 -0
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js +78 -0
- package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/constants.js +149 -0
- package/dist/nodes/trigger/ChatTrigger/constants.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/error.js +43 -0
- package/dist/nodes/trigger/ChatTrigger/error.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/templates.js +175 -0
- package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/types.js +38 -0
- package/dist/nodes/trigger/ChatTrigger/types.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/util.js +82 -0
- package/dist/nodes/trigger/ChatTrigger/util.js.map +1 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +91 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js +388 -0
- package/dist/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreAzureAISearch/azure-aisearch.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +179 -0
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +120 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +94 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreMilvus/VectorStoreMilvus.node.js +106 -0
- package/dist/nodes/vector_store/VectorStoreMilvus/VectorStoreMilvus.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-black.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreMilvus/milvus-icon-white.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreMongoDBAtlas/VectorStoreMongoDBAtlas.node.js +380 -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 +283 -0
- package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePGVector/postgres.svg +1 -0
- package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js +141 -0
- package/dist/nodes/vector_store/VectorStorePinecone/VectorStorePinecone.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePinecone/pinecone.dark.svg +21 -0
- package/dist/nodes/vector_store/VectorStorePinecone/pinecone.svg +21 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +143 -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.js +129 -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/VectorStoreQdrant/Qdrant.utils.js +54 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/Qdrant.utils.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +172 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/qdrant.svg +25 -0
- package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js +339 -0
- package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreRedis/redis.dark.svg +37 -0
- package/dist/nodes/vector_store/VectorStoreRedis/redis.svg +37 -0
- package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js +129 -0
- package/dist/nodes/vector_store/VectorStoreSupabase/VectorStoreSupabase.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabase/supabase.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +133 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/supabase.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +125 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/supabase.svg +1 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js +242 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js +127 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/weaviate.svg +2 -0
- package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js +151 -0
- package/dist/nodes/vector_store/VectorStoreZep/VectorStoreZep.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreZep/zep.png +0 -0
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +152 -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.js +132 -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/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js +78 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +237 -0
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js +128 -0
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/config.js +62 -0
- package/dist/nodes/vector_store/shared/MemoryManager/config.js.map +1 -0
- package/dist/nodes/vector_store/shared/MemoryManager/types.js +17 -0
- package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +71 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +320 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +109 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +33 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +64 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +80 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js +98 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +95 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +55 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +69 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +17 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +48 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +1 -0
- package/dist/nodes/vector_store/shared/descriptions.js +146 -0
- package/dist/nodes/vector_store/shared/descriptions.js.map +1 -0
- package/dist/nodes/vector_store/shared/processDocuments.js +65 -0
- package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/Anthropic.node.js +42 -0
- package/dist/nodes/vendors/Anthropic/Anthropic.node.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/Anthropic/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/document/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/document/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/document/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js +61 -0
- package/dist/nodes/vendors/Anthropic/actions/file/delete.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js +63 -0
- package/dist/nodes/vendors/Anthropic/actions/file/get.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/index.js +94 -0
- package/dist/nodes/vendors/Anthropic/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js +108 -0
- package/dist/nodes/vendors/Anthropic/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js +126 -0
- package/dist/nodes/vendors/Anthropic/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/image/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/node.type.js +17 -0
- package/dist/nodes/vendors/Anthropic/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js +87 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js +154 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/improve.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/index.js +95 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js +146 -0
- package/dist/nodes/vendors/Anthropic/actions/prompt/templatize.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/router.js +93 -0
- package/dist/nodes/vendors/Anthropic/actions/router.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/text/index.js +64 -0
- package/dist/nodes/vendors/Anthropic/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js +540 -0
- package/dist/nodes/vendors/Anthropic/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/actions/versionDescription.js +125 -0
- package/dist/nodes/vendors/Anthropic/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/anthropic.svg +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js +109 -0
- package/dist/nodes/vendors/Anthropic/helpers/baseAnalyze.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/Anthropic/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/helpers/utils.js +84 -0
- package/dist/nodes/vendors/Anthropic/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/methods/index.js +39 -0
- package/dist/nodes/vendors/Anthropic/methods/index.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/methods/listSearch.js +42 -0
- package/dist/nodes/vendors/Anthropic/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/Anthropic/transport/index.js +61 -0
- package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js +42 -0
- package/dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js +74 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js +184 -0
- package/dist/nodes/vendors/GoogleGemini/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/document/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js +102 -0
- package/dist/nodes/vendors/GoogleGemini/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/createStore.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js +72 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/deleteStore.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js +94 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js +75 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/listStores.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js +129 -0
- package/dist/nodes/vendors/GoogleGemini/actions/fileSearch/uploadToStore.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js +211 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/edit.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +168 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/index.js +84 -0
- package/dist/nodes/vendors/GoogleGemini/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/node.type.js +17 -0
- package/dist/nodes/vendors/GoogleGemini/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/router.js +101 -0
- package/dist/nodes/vendors/GoogleGemini/actions/router.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/index.js +64 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +547 -0
- package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +138 -0
- package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js +125 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js +88 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/download.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js +228 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/index.js +84 -0
- package/dist/nodes/vendors/GoogleGemini/actions/video/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/gemini.svg +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js +106 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/baseAnalyze.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js +29 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/utils.js +272 -0
- package/dist/nodes/vendors/GoogleGemini/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/methods/index.js +39 -0
- package/dist/nodes/vendors/GoogleGemini/methods/index.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +94 -0
- package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/GoogleGemini/transport/index.js +48 -0
- package/dist/nodes/vendors/GoogleGemini/transport/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/Ollama.node.js +42 -0
- package/dist/nodes/vendors/Ollama/Ollama.node.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/descriptions.js +52 -0
- package/dist/nodes/vendors/Ollama/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js +412 -0
- package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/image/index.js +64 -0
- package/dist/nodes/vendors/Ollama/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/node.type.js +17 -0
- package/dist/nodes/vendors/Ollama/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/router.js +78 -0
- package/dist/nodes/vendors/Ollama/actions/router.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/text/index.js +64 -0
- package/dist/nodes/vendors/Ollama/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/text/message.operation.js +440 -0
- package/dist/nodes/vendors/Ollama/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/Ollama/actions/versionDescription.js +107 -0
- package/dist/nodes/vendors/Ollama/actions/versionDescription.js.map +1 -0
- package/dist/nodes/vendors/Ollama/helpers/index.js +17 -0
- package/dist/nodes/vendors/Ollama/helpers/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/Ollama/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/Ollama/methods/index.js +39 -0
- package/dist/nodes/vendors/Ollama/methods/index.js.map +1 -0
- package/dist/nodes/vendors/Ollama/methods/listSearch.js +39 -0
- package/dist/nodes/vendors/Ollama/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/Ollama/ollama.svg +1 -0
- package/dist/nodes/vendors/Ollama/transport/index.js +56 -0
- package/dist/nodes/vendors/Ollama/transport/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js +83 -0
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js +38 -0
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/constants.js +50 -0
- package/dist/nodes/vendors/OpenAi/helpers/constants.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/description.js +75 -0
- package/dist/nodes/vendors/OpenAi/helpers/description.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/error-handling.js +52 -0
- package/dist/nodes/vendors/OpenAi/helpers/error-handling.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js +17 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js +34 -0
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js +52 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js +98 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/index.js +42 -0
- package/dist/nodes/vendors/OpenAi/methods/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js +138 -0
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/methods/loadOptions.js +40 -0
- package/dist/nodes/vendors/OpenAi/methods/loadOptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/openAi.dark.svg +3 -0
- package/dist/nodes/vendors/OpenAi/openAi.svg +3 -0
- package/dist/nodes/vendors/OpenAi/transport/index.js +55 -0
- package/dist/nodes/vendors/OpenAi/transport/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js +110 -0
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js +284 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js +55 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js +104 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js +92 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js +278 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js +230 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js +197 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js +96 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js +121 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js +111 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js +79 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js +84 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js +83 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js +122 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js +221 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js +319 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js +74 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js +17 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/router.js +107 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js +102 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js +75 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js +352 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js +116 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js +197 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js +96 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js +121 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js +120 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js +94 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js +75 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js +279 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js +92 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js +130 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js +211 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js +464 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js +319 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js +17 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js +253 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js +75 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js +701 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js +199 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js +64 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js.map +1 -0
- package/dist/types/credentials.json +28 -0
- package/dist/types/nodes.json +115 -0
- package/dist/types/types.js +17 -0
- package/dist/types/types.js.map +1 -0
- package/dist/types/zod.types.js +17 -0
- package/dist/types/zod.types.js.map +1 -0
- package/dist/utils/N8nBinaryLoader.js +203 -0
- package/dist/utils/N8nBinaryLoader.js.map +1 -0
- package/dist/utils/N8nJsonLoader.js +89 -0
- package/dist/utils/N8nJsonLoader.js.map +1 -0
- package/dist/utils/N8nTool.js +106 -0
- package/dist/utils/N8nTool.js.map +1 -0
- package/dist/utils/agent-execution/buildSteps.js +153 -0
- package/dist/utils/agent-execution/buildSteps.js.map +1 -0
- package/dist/utils/agent-execution/createEngineRequests.js +88 -0
- package/dist/utils/agent-execution/createEngineRequests.js.map +1 -0
- package/dist/utils/agent-execution/index.js +42 -0
- package/dist/utils/agent-execution/index.js.map +1 -0
- package/dist/utils/agent-execution/memoryManagement.js +67 -0
- package/dist/utils/agent-execution/memoryManagement.js.map +1 -0
- package/dist/utils/agent-execution/processEventStream.js +82 -0
- package/dist/utils/agent-execution/processEventStream.js.map +1 -0
- package/dist/utils/agent-execution/types.js +41 -0
- package/dist/utils/agent-execution/types.js.map +1 -0
- package/dist/utils/descriptions.js +212 -0
- package/dist/utils/descriptions.js.map +1 -0
- package/dist/utils/embeddings/embeddingInputValidation.js +55 -0
- package/dist/utils/embeddings/embeddingInputValidation.js.map +1 -0
- package/dist/utils/fromAIToolFactory.js +61 -0
- package/dist/utils/fromAIToolFactory.js.map +1 -0
- package/dist/utils/helpers.js +254 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/httpProxyAgent.js +69 -0
- package/dist/utils/httpProxyAgent.js.map +1 -0
- package/dist/utils/logWrapper.js +376 -0
- package/dist/utils/logWrapper.js.map +1 -0
- package/dist/utils/output_parsers/N8nItemListOutputParser.js +64 -0
- package/dist/utils/output_parsers/N8nItemListOutputParser.js.map +1 -0
- package/dist/utils/output_parsers/N8nOutputFixingParser.js +99 -0
- package/dist/utils/output_parsers/N8nOutputFixingParser.js.map +1 -0
- package/dist/utils/output_parsers/N8nOutputParser.js +48 -0
- package/dist/utils/output_parsers/N8nOutputParser.js.map +1 -0
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js +127 -0
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +1 -0
- package/dist/utils/output_parsers/prompt.js +48 -0
- package/dist/utils/output_parsers/prompt.js.map +1 -0
- package/dist/utils/schemaParsing.js +75 -0
- package/dist/utils/schemaParsing.js.map +1 -0
- package/dist/utils/sharedFields.js +176 -0
- package/dist/utils/sharedFields.js.map +1 -0
- package/dist/utils/tokenizer/cl100k_base.json +1 -0
- package/dist/utils/tokenizer/o200k_base.json +1 -0
- package/dist/utils/tokenizer/tiktoken.js +65 -0
- package/dist/utils/tokenizer/tiktoken.js.map +1 -0
- package/dist/utils/tokenizer/token-estimator.js +119 -0
- package/dist/utils/tokenizer/token-estimator.js.map +1 -0
- package/dist/utils/tracing.js +41 -0
- package/dist/utils/tracing.js.map +1 -0
- package/index.js +0 -0
- package/package.json +255 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/chains/ChainLLM/ChainLlm.node.ts"],"sourcesContent":["import type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeType,\n\tINodeTypeDescription,\n} from 'n8n-workflow';\nimport { NodeApiError, NodeConnectionTypes, NodeOperationError, sleep } from 'n8n-workflow';\n\nimport { getOptionalOutputParser } from '@utils/output_parsers/N8nOutputParser';\n\n// Import from centralized module\nimport { formatResponse, getInputs, nodeProperties } from './methods';\nimport { processItem } from './methods/processItem';\nimport {\n\tgetCustomErrorMessage as getCustomOpenAiErrorMessage,\n\tisOpenAiError,\n} from '../../vendors/OpenAi/helpers/error-handling';\n\n/**\n * Basic LLM Chain Node Implementation\n * Allows connecting to language models with optional structured output parsing\n */\nexport class ChainLlm implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Basic LLM Chain',\n\t\tname: 'chainLlm',\n\t\ticon: 'fa:link',\n\t\ticonColor: 'black',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9],\n\t\tdescription: 'A simple chain to prompt a large language model',\n\t\tdefaults: {\n\t\t\tname: 'Basic LLM Chain',\n\t\t\tcolor: '#909298',\n\t\t},\n\t\tcodex: {\n\t\t\talias: ['LangChain'],\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Chains', 'Root Nodes'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tinputs: `={{ ((parameter) => { ${getInputs.toString()}; return getInputs(parameter) })($parameter) }}`,\n\t\toutputs: [NodeConnectionTypes.Main],\n\t\tcredentials: [],\n\t\tproperties: nodeProperties,\n\t};\n\n\t/**\n\t * Main execution method for the node\n\t */\n\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\tthis.logger.debug('Executing Basic LLM Chain');\n\t\tconst items = this.getInputData();\n\t\tconst returnData: INodeExecutionData[] = [];\n\t\tconst outputParser = await getOptionalOutputParser(this);\n\t\t// If the node version is 1.6(and LLM is using `response_format: json_object`) or higher or an output parser is configured,\n\t\t// we unwrap the response and return the object directly as JSON\n\t\tconst shouldUnwrapObjects = this.getNode().typeVersion >= 1.6 || !!outputParser;\n\n\t\tconst batchSize = this.getNodeParameter('batching.batchSize', 0, 5) as number;\n\t\tconst delayBetweenBatches = this.getNodeParameter(\n\t\t\t'batching.delayBetweenBatches',\n\t\t\t0,\n\t\t\t0,\n\t\t) as number;\n\n\t\tif (this.getNode().typeVersion >= 1.7 && batchSize > 1) {\n\t\t\t// Process items in batches\n\t\t\tfor (let i = 0; i < items.length; i += batchSize) {\n\t\t\t\tconst batch = items.slice(i, i + batchSize);\n\t\t\t\tconst batchPromises = batch.map(async (_item, batchItemIndex) => {\n\t\t\t\t\treturn await processItem(this, i + batchItemIndex);\n\t\t\t\t});\n\n\t\t\t\tconst batchResults = await Promise.allSettled(batchPromises);\n\n\t\t\t\tbatchResults.forEach((promiseResult, batchItemIndex) => {\n\t\t\t\t\tconst itemIndex = i + batchItemIndex;\n\t\t\t\t\tif (promiseResult.status === 'rejected') {\n\t\t\t\t\t\tconst error = promiseResult.reason as Error;\n\t\t\t\t\t\t// Handle OpenAI specific rate limit errors\n\t\t\t\t\t\tif (error instanceof NodeApiError && isOpenAiError(error.cause)) {\n\t\t\t\t\t\t\tconst openAiErrorCode: string | undefined = (error.cause as any).error?.code;\n\t\t\t\t\t\t\tif (openAiErrorCode) {\n\t\t\t\t\t\t\t\tconst customMessage = getCustomOpenAiErrorMessage(openAiErrorCode);\n\t\t\t\t\t\t\t\tif (customMessage) {\n\t\t\t\t\t\t\t\t\terror.message = customMessage;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\t\tjson: { error: error.message },\n\t\t\t\t\t\t\t\tpairedItem: { item: itemIndex },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new NodeOperationError(this.getNode(), error);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst responses = promiseResult.value;\n\t\t\t\t\tresponses.forEach((response: unknown) => {\n\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\tjson: formatResponse(response, shouldUnwrapObjects),\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tif (i + batchSize < items.length && delayBetweenBatches > 0) {\n\t\t\t\t\tawait sleep(delayBetweenBatches);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Process each input item\n\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\ttry {\n\t\t\t\t\tconst responses = await processItem(this, itemIndex);\n\n\t\t\t\t\t// Process each response and add to return data\n\t\t\t\t\tresponses.forEach((response) => {\n\t\t\t\t\t\treturnData.push({\n\t\t\t\t\t\t\tjson: formatResponse(response, shouldUnwrapObjects),\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Handle OpenAI specific rate limit errors\n\t\t\t\t\tif (error instanceof NodeApiError && isOpenAiError(error.cause)) {\n\t\t\t\t\t\tconst openAiErrorCode: string | undefined = (error.cause as any).error?.code;\n\t\t\t\t\t\tif (openAiErrorCode) {\n\t\t\t\t\t\t\tconst customMessage = getCustomOpenAiErrorMessage(openAiErrorCode);\n\t\t\t\t\t\t\tif (customMessage) {\n\t\t\t\t\t\t\t\terror.message = customMessage;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Continue on failure if configured\n\t\t\t\t\tif (this.continueOnFail()) {\n\t\t\t\t\t\treturnData.push({ json: { error: error.message }, pairedItem: { item: itemIndex } });\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [returnData];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAA6E;AAE7E,6BAAwC;AAGxC,qBAA0D;AAC1D,yBAA4B;AAC5B,4BAGO;AAMA,MAAM,SAA8B;AAAA,EAApC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,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AAG;AAChE,kBAAM,kBAAuC,MAAM,MAAc,OAAO;AACxE,gBAAI,iBAAiB;AACpB,oBAAM,oBAAgB,sBAAAA,uBAA4B,eAAe;AACjE,kBAAI,eAAe;AAClB,sBAAM,UAAU;AAAA,cACjB;AAAA,YACD;AAAA,UACD;AAGA,cAAI,KAAK,eAAe,GAAG;AAC1B,uBAAW,KAAK,EAAE,MAAM,EAAE,OAAO,MAAM,QAAQ,GAAG,YAAY,EAAE,MAAM,UAAU,EAAE,CAAC;AACnF;AAAA,UACD;AAEA,gBAAM;AAAA,QACP;AAAA,MACD;AAAA,IACD;AAEA,WAAO,CAAC,UAAU;AAAA,EACnB;AACD;","names":["getCustomOpenAiErrorMessage"]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chainExecutor_exports = {};
|
|
20
|
+
__export(chainExecutor_exports, {
|
|
21
|
+
NaiveJsonOutputParser: () => NaiveJsonOutputParser,
|
|
22
|
+
executeChain: () => executeChain,
|
|
23
|
+
getOutputParserForLLM: () => getOutputParserForLLM,
|
|
24
|
+
isModelInThinkingMode: () => isModelInThinkingMode,
|
|
25
|
+
isModelWithFormat: () => isModelWithFormat,
|
|
26
|
+
isModelWithResponseFormat: () => isModelWithResponseFormat
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(chainExecutor_exports);
|
|
29
|
+
var import_output_parsers = require("@langchain/core/output_parsers");
|
|
30
|
+
var import_helpers = require("../../../../utils/helpers");
|
|
31
|
+
var import_tracing = require("../../../../utils/tracing");
|
|
32
|
+
var import_promptUtils = require("./promptUtils");
|
|
33
|
+
class NaiveJsonOutputParser extends import_output_parsers.JsonOutputParser {
|
|
34
|
+
async parse(text) {
|
|
35
|
+
try {
|
|
36
|
+
const directParsed = JSON.parse(text);
|
|
37
|
+
return directParsed;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
return await super.parse(text);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function isModelWithResponseFormat(llm) {
|
|
44
|
+
return "modelKwargs" in llm && !!llm.modelKwargs && typeof llm.modelKwargs === "object" && "response_format" in llm.modelKwargs;
|
|
45
|
+
}
|
|
46
|
+
function isModelInThinkingMode(llm) {
|
|
47
|
+
return "lc_kwargs" in llm && "invocationKwargs" in llm.lc_kwargs && typeof llm.lc_kwargs.invocationKwargs === "object" && "thinking" in llm.lc_kwargs.invocationKwargs && llm.lc_kwargs.invocationKwargs.thinking.type === "enabled";
|
|
48
|
+
}
|
|
49
|
+
function isModelWithFormat(llm) {
|
|
50
|
+
return "format" in llm && typeof llm.format !== "undefined";
|
|
51
|
+
}
|
|
52
|
+
function getOutputParserForLLM(llm) {
|
|
53
|
+
if (isModelWithResponseFormat(llm) && llm.modelKwargs?.response_format?.type === "json_object") {
|
|
54
|
+
return new NaiveJsonOutputParser();
|
|
55
|
+
}
|
|
56
|
+
if (isModelWithFormat(llm) && llm.format === "json") {
|
|
57
|
+
return new NaiveJsonOutputParser();
|
|
58
|
+
}
|
|
59
|
+
if (isModelInThinkingMode(llm)) {
|
|
60
|
+
return new NaiveJsonOutputParser();
|
|
61
|
+
}
|
|
62
|
+
if (llm.metadata?.output_format === "json") {
|
|
63
|
+
return new NaiveJsonOutputParser();
|
|
64
|
+
}
|
|
65
|
+
return new import_output_parsers.StringOutputParser();
|
|
66
|
+
}
|
|
67
|
+
async function executeSimpleChain({
|
|
68
|
+
context,
|
|
69
|
+
llm,
|
|
70
|
+
query,
|
|
71
|
+
prompt
|
|
72
|
+
}) {
|
|
73
|
+
const outputParser = getOutputParserForLLM(llm);
|
|
74
|
+
const chain = prompt.pipe(llm).pipe(outputParser).withConfig((0, import_tracing.getTracingConfig)(context));
|
|
75
|
+
const response = await chain.invoke({
|
|
76
|
+
query,
|
|
77
|
+
signal: context.getExecutionCancelSignal()
|
|
78
|
+
});
|
|
79
|
+
return [response];
|
|
80
|
+
}
|
|
81
|
+
function withBuiltInTools(llm) {
|
|
82
|
+
const modelTools = llm.metadata?.tools ?? [];
|
|
83
|
+
if (modelTools.length && (0, import_helpers.isChatInstance)(llm) && llm.bindTools) {
|
|
84
|
+
return llm.bindTools(modelTools);
|
|
85
|
+
}
|
|
86
|
+
return llm;
|
|
87
|
+
}
|
|
88
|
+
function prepareLlm(llm, fallbackLlm) {
|
|
89
|
+
const mainLlm = withBuiltInTools(llm);
|
|
90
|
+
if (fallbackLlm) {
|
|
91
|
+
return mainLlm.withFallbacks([withBuiltInTools(fallbackLlm)]);
|
|
92
|
+
}
|
|
93
|
+
return mainLlm;
|
|
94
|
+
}
|
|
95
|
+
async function executeChain({
|
|
96
|
+
context,
|
|
97
|
+
itemIndex,
|
|
98
|
+
query,
|
|
99
|
+
llm,
|
|
100
|
+
outputParser,
|
|
101
|
+
messages,
|
|
102
|
+
fallbackLlm
|
|
103
|
+
}) {
|
|
104
|
+
const version = context.getNode().typeVersion;
|
|
105
|
+
const model = prepareLlm(llm, fallbackLlm);
|
|
106
|
+
if (!outputParser) {
|
|
107
|
+
const promptTemplate = await (0, import_promptUtils.createPromptTemplate)({
|
|
108
|
+
context,
|
|
109
|
+
itemIndex,
|
|
110
|
+
llm,
|
|
111
|
+
messages,
|
|
112
|
+
query
|
|
113
|
+
});
|
|
114
|
+
return await executeSimpleChain({
|
|
115
|
+
context,
|
|
116
|
+
llm: model,
|
|
117
|
+
query,
|
|
118
|
+
prompt: promptTemplate
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const formatInstructions = outputParser.getFormatInstructions();
|
|
122
|
+
const promptWithInstructions = await (0, import_promptUtils.createPromptTemplate)({
|
|
123
|
+
context,
|
|
124
|
+
itemIndex,
|
|
125
|
+
llm,
|
|
126
|
+
messages,
|
|
127
|
+
formatInstructions,
|
|
128
|
+
query
|
|
129
|
+
});
|
|
130
|
+
let chain;
|
|
131
|
+
if (version >= 1.9) {
|
|
132
|
+
chain = promptWithInstructions.pipe(model).pipe((0, import_promptUtils.getAgentStepsParser)(outputParser)).withConfig((0, import_tracing.getTracingConfig)(context));
|
|
133
|
+
} else {
|
|
134
|
+
chain = promptWithInstructions.pipe(model).pipe(outputParser).withConfig((0, import_tracing.getTracingConfig)(context));
|
|
135
|
+
}
|
|
136
|
+
const response = await chain.invoke({ query }, { signal: context.getExecutionCancelSignal() });
|
|
137
|
+
return Array.isArray(response) ? response : [response];
|
|
138
|
+
}
|
|
139
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
140
|
+
0 && (module.exports = {
|
|
141
|
+
NaiveJsonOutputParser,
|
|
142
|
+
executeChain,
|
|
143
|
+
getOutputParserForLLM,
|
|
144
|
+
isModelInThinkingMode,
|
|
145
|
+
isModelWithFormat,
|
|
146
|
+
isModelWithResponseFormat
|
|
147
|
+
});
|
|
148
|
+
//# sourceMappingURL=chainExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/chainExecutor.ts"],"sourcesContent":["import type { Tool } from '@langchain/classic/tools';\nimport type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport type { BaseChatModel } from '@langchain/core/language_models/chat_models';\nimport type { BaseLLMOutputParser } from '@langchain/core/output_parsers';\nimport { JsonOutputParser, StringOutputParser } from '@langchain/core/output_parsers';\nimport type { ChatPromptTemplate, PromptTemplate } from '@langchain/core/prompts';\nimport type { Runnable } from '@langchain/core/runnables';\nimport type { IExecuteFunctions } from 'n8n-workflow';\n\nimport { isChatInstance } from '@utils/helpers';\nimport { getTracingConfig } from '@utils/tracing';\n\nimport { createPromptTemplate, getAgentStepsParser } from './promptUtils';\nimport type { ChainExecutionParams } from './types';\n\nexport class NaiveJsonOutputParser<\n\tT extends Record<string, any> = Record<string, any>,\n> extends JsonOutputParser<T> {\n\tasync parse(text: string): Promise<T> {\n\t\t// First try direct JSON parsing\n\t\ttry {\n\t\t\tconst directParsed = JSON.parse(text);\n\t\t\treturn directParsed as T;\n\t\t} catch (e) {\n\t\t\t// If fails, fall back to JsonOutputParser parser\n\t\t\treturn await super.parse(text);\n\t\t}\n\t}\n}\n\n/**\n * Type guard to check if the LLM has a modelKwargs property(OpenAI)\n */\nexport function isModelWithResponseFormat(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { modelKwargs: { response_format: { type: string } } } {\n\treturn (\n\t\t'modelKwargs' in llm &&\n\t\t!!llm.modelKwargs &&\n\t\ttypeof llm.modelKwargs === 'object' &&\n\t\t'response_format' in llm.modelKwargs\n\t);\n}\n\nexport function isModelInThinkingMode(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { lc_kwargs: { invocationKwargs: { thinking: { type: string } } } } {\n\treturn (\n\t\t'lc_kwargs' in llm &&\n\t\t'invocationKwargs' in llm.lc_kwargs &&\n\t\ttypeof llm.lc_kwargs.invocationKwargs === 'object' &&\n\t\t'thinking' in llm.lc_kwargs.invocationKwargs &&\n\t\tllm.lc_kwargs.invocationKwargs.thinking.type === 'enabled'\n\t);\n}\n\n/**\n * Type guard to check if the LLM has a format property(Ollama)\n */\nexport function isModelWithFormat(\n\tllm: BaseLanguageModel,\n): llm is BaseLanguageModel & { format: string } {\n\treturn 'format' in llm && typeof llm.format !== 'undefined';\n}\n\n/**\n * Determines if an LLM is configured to output JSON and returns the appropriate output parser\n */\nexport function getOutputParserForLLM(\n\tllm: BaseChatModel | BaseLanguageModel,\n): BaseLLMOutputParser<string | Record<string, unknown>> {\n\tif (isModelWithResponseFormat(llm) && llm.modelKwargs?.response_format?.type === 'json_object') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\tif (isModelWithFormat(llm) && llm.format === 'json') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\tif (isModelInThinkingMode(llm)) {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\t// For example Mistral's Magistral models (LmChatMistralCloud node)\n\tif (llm.metadata?.output_format === 'json') {\n\t\treturn new NaiveJsonOutputParser();\n\t}\n\n\treturn new StringOutputParser();\n}\n\n/**\n * Creates a simple chain for LLMs without output parsers\n */\nasync function executeSimpleChain({\n\tcontext,\n\tllm,\n\tquery,\n\tprompt,\n}: {\n\tcontext: IExecuteFunctions;\n\tllm: BaseChatModel | BaseLanguageModel;\n\tquery: string;\n\tprompt: ChatPromptTemplate | PromptTemplate;\n}) {\n\tconst outputParser = getOutputParserForLLM(llm);\n\n\tconst chain = prompt.pipe(llm).pipe(outputParser).withConfig(getTracingConfig(context));\n\n\t// Execute the chain\n\tconst response = await chain.invoke({\n\t\tquery,\n\t\tsignal: context.getExecutionCancelSignal(),\n\t});\n\n\t// Ensure response is always returned as an array\n\treturn [response];\n}\n\n// Some models nodes, like OpenAI, can define built-in tools in their metadata\nfunction withBuiltInTools(llm: BaseChatModel | BaseLanguageModel) {\n\tconst modelTools = (llm.metadata?.tools as Tool[]) ?? [];\n\tif (modelTools.length && isChatInstance(llm) && llm.bindTools) {\n\t\treturn llm.bindTools(modelTools);\n\t}\n\treturn llm;\n}\n\nfunction prepareLlm(\n\tllm: BaseLanguageModel | BaseChatModel,\n\tfallbackLlm?: BaseLanguageModel | BaseChatModel | null,\n) {\n\tconst mainLlm = withBuiltInTools(llm);\n\tif (fallbackLlm) {\n\t\treturn mainLlm.withFallbacks([withBuiltInTools(fallbackLlm)]);\n\t}\n\treturn mainLlm;\n}\n\n/**\n * Creates and executes an LLM chain with the given prompt and optional output parsers\n */\nexport async function executeChain({\n\tcontext,\n\titemIndex,\n\tquery,\n\tllm,\n\toutputParser,\n\tmessages,\n\tfallbackLlm,\n}: ChainExecutionParams): Promise<unknown[]> {\n\tconst version = context.getNode().typeVersion;\n\tconst model = prepareLlm(llm, fallbackLlm) as BaseChatModel | BaseLanguageModel;\n\t// If no output parsers provided, use a simple chain with basic prompt template\n\tif (!outputParser) {\n\t\tconst promptTemplate = await createPromptTemplate({\n\t\t\tcontext,\n\t\t\titemIndex,\n\t\t\tllm,\n\t\t\tmessages,\n\t\t\tquery,\n\t\t});\n\n\t\treturn await executeSimpleChain({\n\t\t\tcontext,\n\t\t\tllm: model,\n\t\t\tquery,\n\t\t\tprompt: promptTemplate,\n\t\t});\n\t}\n\n\tconst formatInstructions = outputParser.getFormatInstructions();\n\n\t// Create a prompt template with format instructions\n\tconst promptWithInstructions = await createPromptTemplate({\n\t\tcontext,\n\t\titemIndex,\n\t\tllm,\n\t\tmessages,\n\t\tformatInstructions,\n\t\tquery,\n\t});\n\n\tlet chain: Runnable<{ query: string }>;\n\tif (version >= 1.9) {\n\t\t// use getAgentStepsParser to have more robust output parsing\n\t\tchain = promptWithInstructions\n\t\t\t.pipe(model)\n\t\t\t.pipe(getAgentStepsParser(outputParser))\n\t\t\t.withConfig(getTracingConfig(context));\n\t} else {\n\t\tchain = promptWithInstructions\n\t\t\t.pipe(model)\n\t\t\t.pipe(outputParser)\n\t\t\t.withConfig(getTracingConfig(context));\n\t}\n\n\tconst response = await chain.invoke({ query }, { signal: context.getExecutionCancelSignal() });\n\n\t// Ensure response is always returned as an array\n\t// eslint-disable-next-line @typescript-eslint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AAEnB,YAAQ,uBACN,KAAK,KAAK,EACV,SAAK,wCAAoB,YAAY,CAAC,EACtC,eAAW,iCAAiB,OAAO,CAAC;AAAA,EACvC,OAAO;AACN,YAAQ,uBACN,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,eAAW,iCAAiB,OAAO,CAAC;AAAA,EACvC;AAEA,QAAM,WAAW,MAAM,MAAM,OAAO,EAAE,MAAM,GAAG,EAAE,QAAQ,QAAQ,yBAAyB,EAAE,CAAC;AAI7F,SAAO,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ;AACtD;","names":[]}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var config_exports = {};
|
|
20
|
+
__export(config_exports, {
|
|
21
|
+
getInputs: () => getInputs,
|
|
22
|
+
nodeProperties: () => nodeProperties
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(config_exports);
|
|
25
|
+
var import_prompts = require("@langchain/core/prompts");
|
|
26
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
27
|
+
var import_descriptions = require("../../../../utils/descriptions");
|
|
28
|
+
var import_sharedFields = require("../../../../utils/sharedFields");
|
|
29
|
+
function getInputs(parameters) {
|
|
30
|
+
const inputs = [
|
|
31
|
+
{ displayName: "", type: "main" },
|
|
32
|
+
{
|
|
33
|
+
displayName: "Model",
|
|
34
|
+
maxConnections: 1,
|
|
35
|
+
type: "ai_languageModel",
|
|
36
|
+
required: true
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const needsFallback = parameters?.needsFallback;
|
|
40
|
+
if (needsFallback === true) {
|
|
41
|
+
inputs.push({
|
|
42
|
+
displayName: "Fallback Model",
|
|
43
|
+
maxConnections: 1,
|
|
44
|
+
type: "ai_languageModel",
|
|
45
|
+
required: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const hasOutputParser = parameters?.hasOutputParser;
|
|
49
|
+
if (hasOutputParser === void 0 || hasOutputParser === true) {
|
|
50
|
+
inputs.push({
|
|
51
|
+
displayName: "Output Parser",
|
|
52
|
+
type: "ai_outputParser",
|
|
53
|
+
maxConnections: 1,
|
|
54
|
+
required: false
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return inputs;
|
|
58
|
+
}
|
|
59
|
+
const nodeProperties = [
|
|
60
|
+
(0, import_sharedFields.getTemplateNoticeField)(1978),
|
|
61
|
+
{
|
|
62
|
+
displayName: "Prompt",
|
|
63
|
+
name: "prompt",
|
|
64
|
+
type: "string",
|
|
65
|
+
required: true,
|
|
66
|
+
default: "={{ $json.input }}",
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
"@version": [1]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: "Prompt",
|
|
75
|
+
name: "prompt",
|
|
76
|
+
type: "string",
|
|
77
|
+
required: true,
|
|
78
|
+
default: "={{ $json.chat_input }}",
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
"@version": [1.1, 1.2]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: "Prompt",
|
|
87
|
+
name: "prompt",
|
|
88
|
+
type: "string",
|
|
89
|
+
required: true,
|
|
90
|
+
default: "={{ $json.chatInput }}",
|
|
91
|
+
displayOptions: {
|
|
92
|
+
show: {
|
|
93
|
+
"@version": [1.3]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
...import_descriptions.promptTypeOptionsDeprecated,
|
|
99
|
+
displayOptions: {
|
|
100
|
+
hide: {
|
|
101
|
+
"@version": [{ _cnd: { lte: 1.3 } }, { _cnd: { gte: 1.8 } }]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
...import_descriptions.promptTypeOptions,
|
|
107
|
+
displayOptions: {
|
|
108
|
+
show: {
|
|
109
|
+
"@version": [{ _cnd: { gte: 1.8 } }]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
...import_descriptions.textFromGuardrailsNode,
|
|
115
|
+
displayOptions: { show: { promptType: ["guardrails"], "@version": [{ _cnd: { gte: 1.5 } }] } }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
...import_descriptions.textFromPreviousNode,
|
|
119
|
+
displayOptions: { show: { promptType: ["auto"], "@version": [{ _cnd: { gte: 1.5 } }] } }
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
displayName: "Prompt (User Message)",
|
|
123
|
+
name: "text",
|
|
124
|
+
type: "string",
|
|
125
|
+
required: true,
|
|
126
|
+
default: "",
|
|
127
|
+
placeholder: "e.g. Hello, how can you help me?",
|
|
128
|
+
typeOptions: {
|
|
129
|
+
rows: 2
|
|
130
|
+
},
|
|
131
|
+
displayOptions: {
|
|
132
|
+
show: {
|
|
133
|
+
promptType: ["define"]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: "Require Specific Output Format",
|
|
139
|
+
name: "hasOutputParser",
|
|
140
|
+
type: "boolean",
|
|
141
|
+
default: false,
|
|
142
|
+
noDataExpression: true,
|
|
143
|
+
displayOptions: {
|
|
144
|
+
hide: {
|
|
145
|
+
"@version": [1, 1.1, 1.3]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: "Enable Fallback Model",
|
|
151
|
+
name: "needsFallback",
|
|
152
|
+
type: "boolean",
|
|
153
|
+
default: false,
|
|
154
|
+
noDataExpression: true,
|
|
155
|
+
displayOptions: {
|
|
156
|
+
hide: {
|
|
157
|
+
"@version": [1, 1.1, 1.3]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: "Chat Messages (if Using a Chat Model)",
|
|
163
|
+
name: "messages",
|
|
164
|
+
type: "fixedCollection",
|
|
165
|
+
typeOptions: {
|
|
166
|
+
multipleValues: true
|
|
167
|
+
},
|
|
168
|
+
default: {},
|
|
169
|
+
placeholder: "Add prompt",
|
|
170
|
+
options: [
|
|
171
|
+
{
|
|
172
|
+
name: "messageValues",
|
|
173
|
+
displayName: "Prompt",
|
|
174
|
+
values: [
|
|
175
|
+
{
|
|
176
|
+
displayName: "Type Name or ID",
|
|
177
|
+
name: "type",
|
|
178
|
+
type: "options",
|
|
179
|
+
options: [
|
|
180
|
+
{
|
|
181
|
+
name: "AI",
|
|
182
|
+
value: import_prompts.AIMessagePromptTemplate.lc_name()
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "System",
|
|
186
|
+
value: import_prompts.SystemMessagePromptTemplate.lc_name()
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "User",
|
|
190
|
+
value: import_prompts.HumanMessagePromptTemplate.lc_name()
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
default: import_prompts.SystemMessagePromptTemplate.lc_name()
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
displayName: "Message Type",
|
|
197
|
+
name: "messageType",
|
|
198
|
+
type: "options",
|
|
199
|
+
displayOptions: {
|
|
200
|
+
show: {
|
|
201
|
+
type: [import_prompts.HumanMessagePromptTemplate.lc_name()]
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
options: [
|
|
205
|
+
{
|
|
206
|
+
name: "Text",
|
|
207
|
+
value: "text",
|
|
208
|
+
description: "Simple text message"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "Image (Binary)",
|
|
212
|
+
value: "imageBinary",
|
|
213
|
+
description: "Process the binary input from the previous node"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "Image (URL)",
|
|
217
|
+
value: "imageUrl",
|
|
218
|
+
description: "Process the image from the specified URL"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
default: "text"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: "Image Data Field Name",
|
|
225
|
+
name: "binaryImageDataKey",
|
|
226
|
+
type: "string",
|
|
227
|
+
default: "data",
|
|
228
|
+
required: true,
|
|
229
|
+
description: "The name of the field in the chain's input that contains the binary image file to be processed",
|
|
230
|
+
displayOptions: {
|
|
231
|
+
show: {
|
|
232
|
+
messageType: ["imageBinary"]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
displayName: "Image URL",
|
|
238
|
+
name: "imageUrl",
|
|
239
|
+
type: "string",
|
|
240
|
+
default: "",
|
|
241
|
+
required: true,
|
|
242
|
+
description: "URL to the image to be processed",
|
|
243
|
+
displayOptions: {
|
|
244
|
+
show: {
|
|
245
|
+
messageType: ["imageUrl"]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
displayName: "Image Details",
|
|
251
|
+
description: "Control how the model processes the image and generates its textual understanding",
|
|
252
|
+
name: "imageDetail",
|
|
253
|
+
type: "options",
|
|
254
|
+
displayOptions: {
|
|
255
|
+
show: {
|
|
256
|
+
type: [import_prompts.HumanMessagePromptTemplate.lc_name()],
|
|
257
|
+
messageType: ["imageBinary", "imageUrl"]
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
options: [
|
|
261
|
+
{
|
|
262
|
+
name: "Auto",
|
|
263
|
+
value: "auto",
|
|
264
|
+
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"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "Low",
|
|
268
|
+
value: "low",
|
|
269
|
+
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."
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "High",
|
|
273
|
+
value: "high",
|
|
274
|
+
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."
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
default: "auto"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
displayName: "Message",
|
|
281
|
+
name: "message",
|
|
282
|
+
type: "string",
|
|
283
|
+
required: true,
|
|
284
|
+
displayOptions: {
|
|
285
|
+
hide: {
|
|
286
|
+
messageType: ["imageBinary", "imageUrl"]
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
default: ""
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
(0, import_sharedFields.getBatchingOptionFields)({
|
|
296
|
+
show: {
|
|
297
|
+
"@version": [{ _cnd: { gte: 1.7 } }]
|
|
298
|
+
}
|
|
299
|
+
}),
|
|
300
|
+
{
|
|
301
|
+
displayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${import_n8n_workflow.NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,
|
|
302
|
+
name: "notice",
|
|
303
|
+
type: "notice",
|
|
304
|
+
default: "",
|
|
305
|
+
displayOptions: {
|
|
306
|
+
show: {
|
|
307
|
+
hasOutputParser: [true]
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
displayName: "Connect an additional language model on the canvas to use it as a fallback if the main model fails",
|
|
313
|
+
name: "fallbackNotice",
|
|
314
|
+
type: "notice",
|
|
315
|
+
default: "",
|
|
316
|
+
displayOptions: {
|
|
317
|
+
show: {
|
|
318
|
+
needsFallback: [true]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
];
|
|
323
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
324
|
+
0 && (module.exports = {
|
|
325
|
+
getInputs,
|
|
326
|
+
nodeProperties
|
|
327
|
+
});
|
|
328
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/config.ts"],"sourcesContent":["import {\n\tAIMessagePromptTemplate,\n\tHumanMessagePromptTemplate,\n\tSystemMessagePromptTemplate,\n} from '@langchain/core/prompts';\nimport type { IDataObject, INodeInputConfiguration, INodeProperties } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport {\n\tpromptTypeOptions,\n\tpromptTypeOptionsDeprecated,\n\ttextFromGuardrailsNode,\n\ttextFromPreviousNode,\n} from '@utils/descriptions';\nimport { getBatchingOptionFields, getTemplateNoticeField } from '@utils/sharedFields';\n\n/**\n * Dynamic input configuration generation based on node parameters\n */\nexport function getInputs(parameters: IDataObject) {\n\tconst inputs: INodeInputConfiguration[] = [\n\t\t{ displayName: '', type: 'main' },\n\t\t{\n\t\t\tdisplayName: 'Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t},\n\t];\n\n\tconst needsFallback = parameters?.needsFallback;\n\n\tif (needsFallback === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Fallback Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t});\n\t}\n\n\t// If `hasOutputParser` is undefined it must be version 1.3 or earlier so we\n\t// always add the output parser input\n\tconst hasOutputParser = parameters?.hasOutputParser;\n\tif (hasOutputParser === undefined || hasOutputParser === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Output Parser',\n\t\t\ttype: 'ai_outputParser',\n\t\t\tmaxConnections: 1,\n\t\t\trequired: false,\n\t\t});\n\t}\n\n\treturn inputs;\n}\n\n/**\n * Node properties configuration\n */\nexport const nodeProperties: INodeProperties[] = [\n\tgetTemplateNoticeField(1978),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chat_input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.1, 1.2],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chatInput }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptionsDeprecated,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [{ _cnd: { lte: 1.3 } }, { _cnd: { gte: 1.8 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptions,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [{ _cnd: { gte: 1.8 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromGuardrailsNode,\n\t\tdisplayOptions: { show: { promptType: ['guardrails'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: { show: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\tdisplayName: 'Prompt (User Message)',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Require Specific Output Format',\n\t\tname: 'hasOutputParser',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Enable Fallback Model',\n\t\tname: 'needsFallback',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Chat Messages (if Using a Chat Model)',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add prompt',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'messageValues',\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Type Name or ID',\n\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'AI',\n\t\t\t\t\t\t\t\tvalue: AIMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'System',\n\t\t\t\t\t\t\t\tvalue: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: HumanMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message Type',\n\t\t\t\t\t\tname: 'messageType',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Simple text message',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (Binary)',\n\t\t\t\t\t\t\t\tvalue: 'imageBinary',\n\t\t\t\t\t\t\t\tdescription: 'Process the binary input from the previous node',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (URL)',\n\t\t\t\t\t\t\t\tvalue: 'imageUrl',\n\t\t\t\t\t\t\t\tdescription: 'Process the image from the specified URL',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Data Field Name',\n\t\t\t\t\t\tname: 'binaryImageDataKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: 'data',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The name of the field in the chain's input that contains the binary image file to be processed\",\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image URL',\n\t\t\t\t\t\tname: 'imageUrl',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription: 'URL to the image to be processed',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Details',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Control how the model processes the image and generates its textual understanding',\n\t\t\t\t\t\tname: 'imageDetail',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'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',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Low',\n\t\t\t\t\t\t\t\tvalue: 'low',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'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.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'High',\n\t\t\t\t\t\t\t\tvalue: 'high',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'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.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t},\n\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message',\n\t\t\t\t\t\tname: 'message',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tgetBatchingOptionFields({\n\t\tshow: {\n\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t},\n\t}),\n\t{\n\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\tname: 'notice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\thasOutputParser: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\tname: 'fallbackNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tneedsFallback: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAIO;AAEP,0BAAoC;AAEpC,0BAKO;AACP,0BAAgE;AAKzD,SAAS,UAAU,YAAyB;AAClD,QAAM,SAAoC;AAAA,IACzC,EAAE,aAAa,IAAI,MAAM,OAAO;AAAA,IAChC;AAAA,MACC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AAEA,QAAM,gBAAgB,YAAY;AAElC,MAAI,kBAAkB,MAAM;AAC3B,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,IACX,CAAC;AAAA,EACF;AAIA,QAAM,kBAAkB,YAAY;AACpC,MAAI,oBAAoB,UAAa,oBAAoB,MAAM;AAC9D,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACX,CAAC;AAAA,EACF;AAEA,SAAO;AACR;AAKO,MAAM,iBAAoC;AAAA,MAChD,4CAAuB,IAAI;AAAA,EAC3B;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,IACT,g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C;AAAA,cACF;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aACC;AAAA,cACF;AAAA,YACD;AAAA,YACA,SAAS;AAAA,UACV;AAAA,UAEA;AAAA,YACC,aAAa;AAAA,YACb,MAAM;AAAA,YACN,MAAM;AAAA,YACN,UAAU;AAAA,YACV,gBAAgB;AAAA,cACf,MAAM;AAAA,gBACL,aAAa,CAAC,eAAe,UAAU;AAAA,cACxC;AAAA,YACD;AAAA,YACA,SAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,MACA,6CAAwB;AAAA,IACvB,MAAM;AAAA,MACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,IACpC;AAAA,EACD,CAAC;AAAA,EACD;AAAA,IACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,IAC7I,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,iBAAiB,CAAC,IAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aACC;AAAA,IACD,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,eAAe,CAAC,IAAI;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var imageUtils_exports = {};
|
|
20
|
+
__export(imageUtils_exports, {
|
|
21
|
+
UnsupportedMimeTypeError: () => UnsupportedMimeTypeError,
|
|
22
|
+
createImageMessage: () => createImageMessage,
|
|
23
|
+
dataUriFromImageData: () => dataUriFromImageData
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(imageUtils_exports);
|
|
26
|
+
var import_messages = require("@langchain/core/messages");
|
|
27
|
+
var import_google_genai = require("@langchain/google-genai");
|
|
28
|
+
var import_ollama = require("@langchain/ollama");
|
|
29
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
30
|
+
class UnsupportedMimeTypeError extends import_n8n_workflow.OperationalError {
|
|
31
|
+
}
|
|
32
|
+
function dataUriFromImageData(binaryData, bufferData) {
|
|
33
|
+
if (!binaryData.mimeType?.startsWith("image/")) {
|
|
34
|
+
throw new UnsupportedMimeTypeError(
|
|
35
|
+
`${binaryData.mimeType} is not a supported type of binary data. Only images are supported.`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return `data:${binaryData.mimeType};base64,${bufferData.toString("base64")}`;
|
|
39
|
+
}
|
|
40
|
+
async function createImageMessage({
|
|
41
|
+
context,
|
|
42
|
+
itemIndex,
|
|
43
|
+
message
|
|
44
|
+
}) {
|
|
45
|
+
if (message.messageType !== "imageBinary" && message.messageType !== "imageUrl") {
|
|
46
|
+
throw new import_n8n_workflow.NodeOperationError(
|
|
47
|
+
context.getNode(),
|
|
48
|
+
"Invalid message type. Only imageBinary and imageUrl are supported"
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
const detail = message.imageDetail === "auto" ? void 0 : message.imageDetail;
|
|
52
|
+
if (message.messageType === "imageUrl" && message.imageUrl) {
|
|
53
|
+
return new import_messages.HumanMessage({
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: "image_url",
|
|
57
|
+
image_url: {
|
|
58
|
+
url: message.imageUrl,
|
|
59
|
+
detail
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const binaryDataKey = message.binaryImageDataKey ?? "data";
|
|
66
|
+
const inputData = context.getInputData()[itemIndex];
|
|
67
|
+
const binaryData = inputData.binary?.[binaryDataKey];
|
|
68
|
+
if (!binaryData) {
|
|
69
|
+
throw new import_n8n_workflow.NodeOperationError(context.getNode(), "No binary data set.");
|
|
70
|
+
}
|
|
71
|
+
const bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);
|
|
72
|
+
const model = await context.getInputConnectionData(
|
|
73
|
+
import_n8n_workflow.NodeConnectionTypes.AiLanguageModel,
|
|
74
|
+
0
|
|
75
|
+
);
|
|
76
|
+
try {
|
|
77
|
+
const dataURI = dataUriFromImageData(binaryData, bufferData);
|
|
78
|
+
const directUriModels = [import_google_genai.ChatGoogleGenerativeAI, import_ollama.ChatOllama];
|
|
79
|
+
const imageUrl = directUriModels.some((i) => model instanceof i) ? dataURI : { url: dataURI, detail };
|
|
80
|
+
return new import_messages.HumanMessage({
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: "image_url",
|
|
84
|
+
image_url: imageUrl
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
} catch (error) {
|
|
89
|
+
if (error instanceof UnsupportedMimeTypeError)
|
|
90
|
+
throw new import_n8n_workflow.NodeOperationError(context.getNode(), error.message);
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
UnsupportedMimeTypeError,
|
|
97
|
+
createImageMessage,
|
|
98
|
+
dataUriFromImageData
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=imageUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/imageUtils.ts"],"sourcesContent":["import type { BaseLanguageModel } from '@langchain/core/language_models/base';\nimport { HumanMessage } from '@langchain/core/messages';\nimport { ChatGoogleGenerativeAI } from '@langchain/google-genai';\nimport { ChatOllama } from '@langchain/ollama';\nimport type { IExecuteFunctions, IBinaryData } from 'n8n-workflow';\nimport { NodeOperationError, NodeConnectionTypes, OperationalError } from 'n8n-workflow';\n\nimport type { MessageTemplate } from './types';\n\nexport class UnsupportedMimeTypeError extends OperationalError {}\n\n/**\n * Converts binary image data to a data URI\n */\nexport function dataUriFromImageData(binaryData: IBinaryData, bufferData: Buffer): string {\n\tif (!binaryData.mimeType?.startsWith('image/')) {\n\t\tthrow new UnsupportedMimeTypeError(\n\t\t\t`${binaryData.mimeType} is not a supported type of binary data. Only images are supported.`,\n\t\t);\n\t}\n\treturn `data:${binaryData.mimeType};base64,${bufferData.toString('base64')}`;\n}\n\n/**\n * Creates a human message with image content from either binary data or URL\n */\nexport async function createImageMessage({\n\tcontext,\n\titemIndex,\n\tmessage,\n}: {\n\tcontext: IExecuteFunctions;\n\titemIndex: number;\n\tmessage: MessageTemplate;\n}): Promise<HumanMessage> {\n\t// Validate message type\n\tif (message.messageType !== 'imageBinary' && message.messageType !== 'imageUrl') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\t'Invalid message type. Only imageBinary and imageUrl are supported',\n\t\t);\n\t}\n\n\tconst detail = message.imageDetail === 'auto' ? undefined : message.imageDetail;\n\n\t// Handle image URL case\n\tif (message.messageType === 'imageUrl' && message.imageUrl) {\n\t\treturn new HumanMessage({\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'image_url',\n\t\t\t\t\timage_url: {\n\t\t\t\t\t\turl: message.imageUrl,\n\t\t\t\t\t\tdetail,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t}\n\n\t// Handle binary image case\n\tconst binaryDataKey = message.binaryImageDataKey ?? 'data';\n\tconst inputData = context.getInputData()[itemIndex];\n\tconst binaryData = inputData.binary?.[binaryDataKey] as IBinaryData;\n\n\tif (!binaryData) {\n\t\tthrow new NodeOperationError(context.getNode(), 'No binary data set.');\n\t}\n\n\tconst bufferData = await context.helpers.getBinaryDataBuffer(itemIndex, binaryDataKey);\n\tconst model = (await context.getInputConnectionData(\n\t\tNodeConnectionTypes.AiLanguageModel,\n\t\t0,\n\t)) as BaseLanguageModel;\n\n\ttry {\n\t\t// Create data URI from binary data\n\t\tconst dataURI = dataUriFromImageData(binaryData, bufferData);\n\n\t\t// Some models need different image URL formats\n\t\tconst directUriModels = [ChatGoogleGenerativeAI, ChatOllama];\n\t\tconst imageUrl = directUriModels.some((i) => model instanceof i)\n\t\t\t? dataURI\n\t\t\t: { url: dataURI, detail };\n\n\t\treturn new HumanMessage({\n\t\t\tcontent: [\n\t\t\t\t{\n\t\t\t\t\ttype: 'image_url',\n\t\t\t\t\timage_url: imageUrl,\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t} catch (error) {\n\t\tif (error instanceof UnsupportedMimeTypeError)\n\t\t\tthrow new NodeOperationError(context.getNode(), error.message);\n\t\tthrow error;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA6B;AAC7B,0BAAuC;AACvC,oBAA2B;AAE3B,0BAA0E;AAInE,MAAM,iCAAiC,qCAAiB;AAAC;AAKzD,SAAS,qBAAqB,YAAyB,YAA4B;AACzF,MAA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