@n8n/n8n-nodes-langchain 2.30.4 → 2.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node-definitions/.nodes-hash +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatAwsBedrock/v1.schema.js +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatAwsBedrock/v1.ts +35 -0
- package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatAwsBedrock/v11.schema.js +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatAwsBedrock/v11.ts +35 -0
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +3 -17
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +2 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +112 -20
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js +2 -1
- package/dist/nodes/llms/LmChatCohere/LmChatCohere.node.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/utils.d.ts +2 -0
- package/dist/nodes/mcp/McpClientTool/utils.js +8 -1
- package/dist/nodes/mcp/McpClientTool/utils.js.map +1 -1
- package/dist/nodes/mcp/McpTrigger/McpServer.d.ts +2 -0
- package/dist/nodes/mcp/McpTrigger/McpServer.js +41 -5
- package/dist/nodes/mcp/McpTrigger/McpServer.js.map +1 -1
- package/dist/nodes/mcp/McpTrigger/__tests__/helpers/mock-mcp-sdk.js +2 -0
- package/dist/nodes/mcp/McpTrigger/__tests__/helpers/mock-mcp-sdk.js.map +1 -1
- package/dist/nodes/mcp/McpTrigger/protocol/MessageFormatter.d.ts +6 -0
- package/dist/nodes/mcp/McpTrigger/protocol/MessageFormatter.js +13 -0
- package/dist/nodes/mcp/McpTrigger/protocol/MessageFormatter.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/Chat.node.js +14 -1
- package/dist/nodes/trigger/ChatTrigger/Chat.node.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +6 -2
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
- package/dist/nodes/vendors/Microsoft/microsoft-utils.js +174 -22
- package/dist/nodes/vendors/Microsoft/microsoft-utils.js.map +1 -1
- package/dist/typecheck.tsbuildinfo +1 -1
- package/dist/types/nodes.json +1 -1
- package/dist/utils/agent-execution/buildSteps.js +7 -4
- package/dist/utils/agent-execution/buildSteps.js.map +1 -1
- package/dist/utils/aws/createBedrockRuntimeClient.d.ts +8 -0
- package/dist/utils/aws/createBedrockRuntimeClient.js +27 -0
- package/dist/utils/aws/createBedrockRuntimeClient.js.map +1 -0
- package/dist/utils/aws/resolveAwsCredentials.d.ts +1 -0
- package/dist/utils/aws/resolveAwsCredentials.js +10 -2
- package/dist/utils/aws/resolveAwsCredentials.js.map +1 -1
- package/dist/utils/chatModelMessageWrapper.d.ts +5 -0
- package/dist/utils/chatModelMessageWrapper.js +40 -0
- package/dist/utils/chatModelMessageWrapper.js.map +1 -0
- package/package.json +22 -21
package/dist/types/nodes.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
{"displayName":"Qwen Cloud Chat Model","name":"lmChatAlibabaCloud","group":["transform"],"version":[1],"description":"For advanced usage with an AI chain","defaults":{"name":"Qwen Cloud Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatalibabacloud/"}]},"alias":["qwen","dashscope","alibaba","model studio"]},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"alibabaCloudApi","required":true}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"={{ $credentials?.url + \"/compatible-mode/v1\" }}"},"properties":[{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"If using JSON response format, you must include word \"json\" in the prompt in your chain or agent.","name":"notice","type":"notice","default":"","displayOptions":{"show":{"/options.responseFormat":["json_object"]}}},{"displayName":"Model","name":"model","type":"options","description":"The model which will generate the completion. <a href=\"https://www.qwencloud.com/models\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.id}}","value":"={{$responseItem.id}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"qwen-plus","builderHint":{"propertyHint":"Default to the latest Qwen flagship (qwen3.6-max-preview or qwen3.6-plus). Use qwen-plus for cost-efficient builds. Avoid qwen-turbo, Qwen 3.5 and earlier, and older dated snapshots."}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Frequency Penalty","name":"frequencyPenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim","type":"number"},{"displayName":"Maximum Number of Tokens","name":"maxTokens","default":-1,"description":"The maximum number of tokens to generate in the completion. The limit depends on the selected model.","type":"number"},{"displayName":"Response Format","name":"responseFormat","default":"text","type":"options","options":[{"name":"Text","value":"text","description":"Regular text response"},{"name":"JSON","value":"json_object","description":"Enables JSON mode, which should guarantee the message the model generates is valid JSON"}]},{"displayName":"Presence Penalty","name":"presencePenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":2,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Timeout","name":"timeout","default":360000,"description":"Maximum amount of time a request is allowed to take in milliseconds","type":"number"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt","type":"number"},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.","type":"number"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAlibabaCloud/alibaba.svg"},
|
|
42
42
|
{"displayName":"Anthropic Chat Model","name":"lmChatAnthropic","group":["transform"],"version":[1,1.1,1.2,1.3,1.4,1.5],"defaultVersion":1.5,"description":"Language Model Anthropic","defaults":{"name":"Anthropic Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatanthropic/"}]},"alias":["claude","sonnet","opus"]},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"anthropicApi","required":true}],"properties":[{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Model","name":"model","type":"options","options":[{"name":"Claude 3.5 Sonnet(20241022)","value":"claude-3-5-sonnet-20241022"},{"name":"Claude 3 Opus(20240229)","value":"claude-3-opus-20240229"},{"name":"Claude 3.5 Sonnet(20240620)","value":"claude-3-5-sonnet-20240620"},{"name":"Claude 3 Sonnet(20240229)","value":"claude-3-sonnet-20240229"},{"name":"Claude 3.5 Haiku(20241022)","value":"claude-3-5-haiku-20241022"},{"name":"Claude 3 Haiku(20240307)","value":"claude-3-haiku-20240307"},{"name":"LEGACY: Claude 2","value":"claude-2"},{"name":"LEGACY: Claude 2.1","value":"claude-2.1"},{"name":"LEGACY: Claude Instant 1.2","value":"claude-instant-1.2"},{"name":"LEGACY: Claude Instant 1","value":"claude-instant-1"}],"description":"The model which will generate the completion. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","default":"claude-2","builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"displayOptions":{"show":{"@version":[1]}}},{"displayName":"Model","name":"model","type":"options","options":[{"name":"Claude 3.5 Sonnet(20241022)","value":"claude-3-5-sonnet-20241022"},{"name":"Claude 3 Opus(20240229)","value":"claude-3-opus-20240229"},{"name":"Claude 3.5 Sonnet(20240620)","value":"claude-3-5-sonnet-20240620"},{"name":"Claude 3 Sonnet(20240229)","value":"claude-3-sonnet-20240229"},{"name":"Claude 3.5 Haiku(20241022)","value":"claude-3-5-haiku-20241022"},{"name":"Claude 3 Haiku(20240307)","value":"claude-3-haiku-20240307"},{"name":"LEGACY: Claude 2","value":"claude-2"},{"name":"LEGACY: Claude 2.1","value":"claude-2.1"},{"name":"LEGACY: Claude Instant 1.2","value":"claude-instant-1.2"},{"name":"LEGACY: Claude Instant 1","value":"claude-instant-1"}],"description":"The model which will generate the completion. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","default":"claude-3-sonnet-20240229","builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"displayOptions":{"show":{"@version":[1.1]}}},{"displayName":"Model","name":"model","type":"options","options":[{"name":"Claude 3.5 Sonnet(20241022)","value":"claude-3-5-sonnet-20241022"},{"name":"Claude 3 Opus(20240229)","value":"claude-3-opus-20240229"},{"name":"Claude 3.5 Sonnet(20240620)","value":"claude-3-5-sonnet-20240620"},{"name":"Claude 3 Sonnet(20240229)","value":"claude-3-sonnet-20240229"},{"name":"Claude 3.5 Haiku(20241022)","value":"claude-3-5-haiku-20241022"},{"name":"Claude 3 Haiku(20240307)","value":"claude-3-haiku-20240307"}],"description":"The model which will generate the completion. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","default":"claude-3-5-sonnet-20240620","builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"displayOptions":{"show":{"@version":[{"_cnd":{"lte":1.2}}]}}},{"displayName":"Model","name":"model","type":"resourceLocator","default":{"mode":"list","value":"claude-sonnet-4-5-20250929","cachedResultName":"Claude Sonnet 4.5"},"builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"required":true,"modes":[{"displayName":"From List","name":"list","type":"list","placeholder":"Select a model...","typeOptions":{"searchListMethod":"searchModels","searchable":true}},{"displayName":"ID","name":"id","type":"string","placeholder":"Claude Sonnet"}],"description":"The model. Choose from the list, or specify an ID. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","displayOptions":{"show":{"@version":[1.3]}}},{"displayName":"Model","name":"model","type":"resourceLocator","default":{"mode":"list","value":"claude-sonnet-4-6","cachedResultName":"Claude Sonnet 4.6"},"builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"required":true,"modes":[{"displayName":"From List","name":"list","type":"list","placeholder":"Select a model...","typeOptions":{"searchListMethod":"searchModels","searchable":true}},{"displayName":"ID","name":"id","type":"string","placeholder":"Claude Sonnet"}],"description":"The model. Choose from the list, or specify an ID. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","displayOptions":{"show":{"@version":[1.4]}}},{"displayName":"Model","name":"model","type":"resourceLocator","default":{"mode":"list","value":"claude-sonnet-4-6","cachedResultName":"Claude Sonnet 4.6"},"builderHint":{"propertyHint":"Default to claude-sonnet-4-6 (latest Sonnet); use claude-opus-4-7 when the user needs the most capable model. Never use Claude Sonnet 4.5, Claude 3.x, Claude 2, or LEGACY options — those are superseded and are not valid choices. When extended thinking is needed on Opus 4.7+, set Thinking Mode to Adaptive and choose an Effort level. The legacy Manual thinking mode is rejected by Opus 4.7."},"required":true,"modes":[{"displayName":"From List","name":"list","type":"list","placeholder":"Select a model...","typeOptions":{"searchListMethod":"searchModels","searchable":true}},{"displayName":"ID","name":"id","type":"string","placeholder":"Claude Sonnet"}],"description":"The model. Choose from the list, or specify an ID. <a href=\"https://docs.anthropic.com/claude/docs/models-overview\">Learn more</a>.","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}]}}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Maximum Number of Tokens","name":"maxTokensToSample","default":4096,"description":"The maximum number of tokens to generate in the completion","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. Not supported on newer Anthropic models (Claude Opus 4.7+, Claude Sonnet 5+) — ignored there.","type":"number","displayOptions":{"hide":{"thinking":[true],"thinkingMode":["adaptive","manual"]}}},{"displayName":"Top K","name":"topK","default":-1,"typeOptions":{"maxValue":1,"minValue":-1,"numberPrecision":1},"description":"Used to remove \"long tail\" low probability responses. Defaults to -1, which disables it. Not supported on newer Anthropic models (Claude Opus 4.7+, Claude Sonnet 5+) — ignored there.","type":"number","displayOptions":{"hide":{"thinking":[true],"thinkingMode":["adaptive","manual"]}}},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both. Not supported on newer Anthropic models (Claude Opus 4.7+, Claude Sonnet 5+) — ignored there.","type":"number","displayOptions":{"hide":{"thinking":[true],"thinkingMode":["adaptive","manual"]}}},{"displayName":"Enable Thinking","name":"thinking","type":"boolean","default":false,"description":"Whether to enable thinking mode for the model","displayOptions":{"show":{"@version":[{"_cnd":{"lte":1.4}}]}}},{"displayName":"Thinking Budget (Tokens)","name":"thinkingBudget","type":"number","default":1024,"description":"The maximum number of tokens to use for thinking","displayOptions":{"show":{"@version":[{"_cnd":{"lte":1.4}}],"thinking":[true]}}},{"displayName":"Thinking Mode","name":"thinkingMode","type":"options","default":"disabled","description":"How extended thinking should be configured for the model","options":[{"name":"Disabled","value":"disabled","description":"No extended thinking"},{"name":"Adaptive (Recommended)","value":"adaptive","description":"Claude decides how much to think; control with Effort"},{"name":"Manual (Deprecated)","value":"manual","description":"Legacy fixed-budget mode; rejected by Opus 4.7+"}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}]}}},{"displayName":"Effort","name":"effort","type":"options","default":"medium","description":"Effort level for adaptive thinking","options":[{"name":"Low","value":"low"},{"name":"Medium","value":"medium"},{"name":"High","value":"high"},{"name":"X-High","value":"xhigh"},{"name":"Max","value":"max"}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}],"thinkingMode":["adaptive"],"/model.value":[{"_cnd":{"includes":"opus"}}]}}},{"displayName":"Effort","name":"effort","type":"options","default":"medium","description":"Effort level for adaptive thinking","options":[{"name":"Low","value":"low"},{"name":"Medium","value":"medium"},{"name":"High","value":"high"}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}],"thinkingMode":["adaptive"],"/model.value":[{"_cnd":{"regex":"^(?!.*opus).*"}}]}}},{"displayName":"Thinking Budget (Tokens)","name":"thinkingBudget","type":"number","default":1024,"description":"Maximum tokens used for thinking. Manual mode is rejected by Opus 4.7+.","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}],"thinkingMode":["manual"]}}},{"displayName":"Stream Responses","name":"streaming","type":"boolean","default":false,"description":"Whether the model should stream its response over Server-Sent Events instead of returning a single non-streamed payload. Final output shape is unchanged."}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LMChatAnthropic/anthropic.svg"},
|
|
43
43
|
{"displayName":"Azure OpenAI Chat Model","name":"lmChatAzureOpenAi","group":["transform"],"version":1,"description":"For advanced usage with an AI chain","defaults":{"name":"Azure OpenAI Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatazureopenai/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"azureOpenAiApi","required":true,"displayOptions":{"show":{"authentication":["azureOpenAiApi"]}}},{"name":"azureEntraCognitiveServicesOAuth2Api","required":true,"displayOptions":{"show":{"authentication":["azureEntraCognitiveServicesOAuth2Api"]}}}],"properties":[{"displayName":"Authentication","name":"authentication","type":"options","default":"azureOpenAiApi","options":[{"name":"API Key","value":"azureOpenAiApi"},{"name":"Azure Entra ID (OAuth2)","value":"azureEntraCognitiveServicesOAuth2Api"}]},{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.","name":"notice","type":"notice","default":"","displayOptions":{"show":{"/options.responseFormat":["json_object"]}}},{"displayName":"Model (Deployment) Name","name":"model","type":"string","description":"The name of the model(deployment) to use (e.g., gpt-4, gpt-35-turbo)","required":true,"default":""},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Frequency Penalty","name":"frequencyPenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim","type":"number"},{"displayName":"Maximum Number of Tokens","name":"maxTokens","default":-1,"description":"The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768). Use -1 for default.","type":"number","typeOptions":{"maxValue":128000}},{"displayName":"Response Format","name":"responseFormat","default":"text","type":"options","options":[{"name":"Text","value":"text","description":"Regular text response"},{"name":"JSON","value":"json_object","description":"Enables JSON mode, which should guarantee the message the model generates is valid JSON"}]},{"displayName":"Presence Penalty","name":"presencePenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":2,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Timeout (Ms)","name":"timeout","default":60000,"description":"Maximum amount of time a request is allowed to take in milliseconds","type":"number"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt on failure","type":"number"},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.","type":"number"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAzureOpenAi/azure.svg"},
|
|
44
|
-
{"displayName":"AWS Bedrock Chat Model","name":"lmChatAwsBedrock","group":["transform"],"version":[1,1.1],"description":"Language Model AWS Bedrock","defaults":{"name":"AWS Bedrock Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatawsbedrock/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"aws","required":true,"displayOptions":{"show":{"authentication":["iam"]}}},{"name":"awsAssumeRole","required":true,"displayOptions":{"show":{"authentication":["assumeRole"]}}}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"=https://bedrock.{{$credentials?.region ?? \"eu-central-1\"}}.amazonaws.com"},"properties":[{"displayName":"Authentication","name":"authentication","type":"options","options":[{"name":"AWS (IAM)","value":"iam"},{"name":"AWS (Assume Role)","value":"assumeRole"}],"default":"iam"},{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Model Source","name":"modelSource","type":"options","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.1}}]}},"options":[{"name":"On-Demand Models","value":"onDemand","description":"Standard foundation models with on-demand pricing"},{"name":"Inference Profiles","value":"inferenceProfile","description":"Cross-region inference profiles (required for models like Claude Sonnet 4 and others)"}],"default":"onDemand","description":"Choose between on-demand foundation models or inference profiles"},{"displayName":"Model","name":"model","type":"options","allowArbitraryValues":true,"description":"The model which will generate the completion. <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html\">Learn more</a>.","displayOptions":{"hide":{"modelSource":["inferenceProfile"]}},"typeOptions":{"loadOptionsDependsOn":["modelSource"],"loadOptions":{"routing":{"request":{"method":"GET","url":"/foundation-models?&byOutputModality=TEXT&byInferenceType=ON_DEMAND"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"modelSummaries"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.modelName}}","description":"={{$responseItem.modelArn}}","value":"={{$responseItem.modelId}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"","builderHint":{"propertyHint":"Default to the latest Claude Sonnet on Bedrock (anthropic.claude-sonnet-4-6 family). For Claude Sonnet 4+, switch Model Source to Inference Profiles. Avoid claude-sonnet-4-5, claude-3.x, and non-Claude legacy models unless requested."}},{"displayName":"Model","name":"model","type":"options","allowArbitraryValues":true,"description":"The inference profile which will generate the completion. <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html\">Learn more</a>.","displayOptions":{"show":{"modelSource":["inferenceProfile"]}},"typeOptions":{"loadOptionsDependsOn":["modelSource"],"loadOptions":{"routing":{"request":{"method":"GET","url":"/inference-profiles?maxResults=1000"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"inferenceProfileSummaries"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.inferenceProfileName}}","description":"={{$responseItem.description || $responseItem.inferenceProfileArn}}","value":"={{$responseItem.inferenceProfileId}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"","builderHint":{"propertyHint":"Default to the latest Claude Sonnet inference profile (anthropic.claude-sonnet-4-6 family). Avoid claude-sonnet-4-5 and claude-3.x profiles unless specifically requested."}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Maximum Number of Tokens","name":"maxTokensToSample","default":2000,"description":"The maximum number of tokens to generate in the completion","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAwsBedrock/bedrock.svg"},
|
|
44
|
+
{"displayName":"AWS Bedrock Chat Model","name":"lmChatAwsBedrock","group":["transform"],"version":[1,1.1],"description":"Language Model AWS Bedrock","defaults":{"name":"AWS Bedrock Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatawsbedrock/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"aws","required":true,"displayOptions":{"show":{"authentication":["iam"]}}},{"name":"awsAssumeRole","required":true,"displayOptions":{"show":{"authentication":["assumeRole"]}}}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"=https://bedrock.{{$credentials?.region ?? \"eu-central-1\"}}.amazonaws.com"},"properties":[{"displayName":"Authentication","name":"authentication","type":"options","options":[{"name":"AWS (IAM)","value":"iam"},{"name":"AWS (Assume Role)","value":"assumeRole"}],"default":"iam"},{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Model Source","name":"modelSource","type":"options","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.1}}]}},"options":[{"name":"On-Demand Models","value":"onDemand","description":"Standard foundation models with on-demand pricing"},{"name":"Inference Profiles","value":"inferenceProfile","description":"Cross-region inference profiles (required for models like Claude Sonnet 4 and others)"}],"default":"onDemand","description":"Choose between on-demand foundation models or inference profiles"},{"displayName":"Model","name":"model","type":"options","allowArbitraryValues":true,"description":"The model which will generate the completion. <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html\">Learn more</a>.","displayOptions":{"hide":{"modelSource":["inferenceProfile"]}},"typeOptions":{"loadOptionsDependsOn":["modelSource"],"loadOptions":{"routing":{"request":{"method":"GET","url":"/foundation-models?&byOutputModality=TEXT&byInferenceType=ON_DEMAND"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"modelSummaries"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.modelName}}","description":"={{$responseItem.modelArn}}","value":"={{$responseItem.modelId}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"","builderHint":{"propertyHint":"Default to the latest Claude Sonnet on Bedrock (anthropic.claude-sonnet-4-6 family). For Claude Sonnet 4+, switch Model Source to Inference Profiles. Avoid claude-sonnet-4-5, claude-3.x, and non-Claude legacy models unless requested."}},{"displayName":"Model","name":"model","type":"options","allowArbitraryValues":true,"description":"The inference profile which will generate the completion. <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html\">Learn more</a>.","displayOptions":{"show":{"modelSource":["inferenceProfile"]}},"typeOptions":{"loadOptionsDependsOn":["modelSource"],"loadOptions":{"routing":{"request":{"method":"GET","url":"/inference-profiles?maxResults=1000"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"inferenceProfileSummaries"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.inferenceProfileName}}","description":"={{$responseItem.description || $responseItem.inferenceProfileArn}}","value":"={{$responseItem.inferenceProfileId}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"","builderHint":{"propertyHint":"Default to the latest Claude Sonnet inference profile (anthropic.claude-sonnet-4-6 family). Avoid claude-sonnet-4-5 and claude-3.x profiles unless specifically requested."}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Maximum Number of Tokens","name":"maxTokensToSample","default":2000,"description":"The maximum number of tokens to generate in the completion","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.","type":"number"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt when a request fails","type":"number"},{"displayName":"Additional Model Request Fields","name":"additionalModelRequestFields","default":"{}","description":"Model-family-specific inference parameters passed through as JSON (e.g. Claude <code>top_k</code>/<code>thinking</code>, Nova <code>inferenceConfig</code>/<code>reasoningConfig</code>, Cohere penalties). See the <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">AWS model parameters docs</a>.","type":"json","typeOptions":{"rows":4}},{"displayName":"Latency Optimization","name":"latency","default":"standard","description":"Latency optimization mode for the request. \"Optimized\" can reduce response time for supported models and regions.","type":"options","options":[{"name":"Standard","value":"standard"},{"name":"Optimized","value":"optimized"}]},{"displayName":"Guardrail","name":"guardrail","type":"fixedCollection","default":{},"description":"Apply an Amazon Bedrock guardrail to requests","options":[{"displayName":"Guardrail","name":"values","values":[{"displayName":"Guardrail Identifier","name":"guardrailIdentifier","type":"string","default":"","description":"The identifier (ID or ARN) of the guardrail to apply"},{"displayName":"Guardrail Version","name":"guardrailVersion","type":"string","default":"","description":"The version of the guardrail to apply"},{"displayName":"Trace","name":"trace","type":"options","default":"disabled","description":"The trace behavior for the guardrail","options":[{"name":"Disabled","value":"disabled"},{"name":"Enabled","value":"enabled"},{"name":"Enabled (Full)","value":"enabled_full"}]}]}]}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatAwsBedrock/bedrock.svg"},
|
|
45
45
|
{"displayName":"Cohere Chat Model","name":"lmChatCohere","group":["transform"],"version":[1],"description":"For advanced usage with an AI chain","defaults":{"name":"Cohere Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatcohere/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"cohereApi","required":true}],"requestDefaults":{"baseURL":"={{$credentials?.url}}","headers":{"accept":"application/json","authorization":"=Bearer {{$credentials?.apiKey}}"}},"properties":[{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Model","name":"model","type":"options","description":"The model which will generate the completion. <a href=\"https://docs.cohere.com/docs/models\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"/v1/models?page_size=100&endpoint=chat"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"models"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.name}}","value":"={{$responseItem.name}}","description":"={{$responseItem.description}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"default":"command-a-03-2025","builderHint":{"propertyHint":"Default to the latest Cohere Command A model (command-a-03-2025). Avoid command-r and command-light legacy variants."}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":2,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt","type":"number"}]}],"iconUrl":{"light":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatCohere/cohere.svg","dark":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatCohere/cohere.dark.svg"}},
|
|
46
46
|
{"displayName":"DeepSeek Chat Model","name":"lmChatDeepSeek","group":["transform"],"version":[1],"description":"For advanced usage with an AI chain","defaults":{"name":"DeepSeek Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatdeepseek/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"deepSeekApi","required":true}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"={{ $credentials?.url }}"},"properties":[{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"If using JSON response format, you must include word \"json\" in the prompt in your chain or agent. Also, make sure to select latest models released post November 2023.","name":"notice","type":"notice","default":"","displayOptions":{"show":{"/options.responseFormat":["json_object"]}}},{"displayName":"Model","name":"model","type":"options","description":"The model which will generate the completion. <a href=\"https://api-docs.deepseek.com/quick_start/pricing\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.id}}","value":"={{$responseItem.id}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"deepseek-chat","builderHint":{"propertyHint":"Default to the latest DeepSeek (deepseek-chat = V3.2 non-thinking, deepseek-reasoner = V3.2 thinking / R-series reasoning). Avoid older V3 and R1 snapshots."}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Frequency Penalty","name":"frequencyPenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim","type":"number"},{"displayName":"Maximum Number of Tokens","name":"maxTokens","default":-1,"description":"The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).","type":"number","typeOptions":{"maxValue":32768}},{"displayName":"Response Format","name":"responseFormat","default":"text","type":"options","options":[{"name":"Text","value":"text","description":"Regular text response"},{"name":"JSON","value":"json_object","description":"Enables JSON mode, which should guarantee the message the model generates is valid JSON"}]},{"displayName":"Presence Penalty","name":"presencePenalty","default":0,"typeOptions":{"maxValue":2,"minValue":-2,"numberPrecision":1},"description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.7,"typeOptions":{"maxValue":2,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Timeout","name":"timeout","default":360000,"description":"Maximum amount of time a request is allowed to take in milliseconds","type":"number"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt","type":"number"},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.","type":"number"}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatDeepSeek/deepseek.svg"},
|
|
47
47
|
{"displayName":"Google Gemini Chat Model","name":"lmChatGoogleGemini","group":["transform"],"version":[1,1.1],"description":"Chat Model Google Gemini","defaults":{"name":"Google Gemini Chat Model"},"codex":{"categories":["AI"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatgooglegemini/"}]}},"inputs":[],"outputs":["ai_languageModel"],"outputNames":["Model"],"credentials":[{"name":"googlePalmApi","required":true}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"={{ $credentials.host }}"},"properties":[{"displayName":"This node must be connected to an AI chain. <a data-action='openSelectiveNodeCreator' data-action-parameter-creatorview='AI'>Insert one</a>","name":"notice","type":"notice","default":"","typeOptions":{"containerClass":"ndv-connection-hint-notice"}},{"displayName":"Model","name":"modelName","type":"options","description":"The model which will generate the completion. <a href=\"https://developers.generativeai.google/api/rest/generativelanguage/models/list\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"/v1beta/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"models"}},{"type":"filter","properties":{"pass":"={{ !$responseItem.name.includes('embedding') && !$responseItem.name.includes('imagen') }}"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.name}}","value":"={{$responseItem.name}}","description":"={{$responseItem.description}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"models/gemini-2.5-flash","builderHint":{"propertyHint":"Default to the latest flagship Gemini (models/gemini-3.1-pro-preview). Use models/gemini-3.1-flash-lite for cost-efficient builds. Avoid Gemini 2.x, 1.x, and earlier."},"displayOptions":{"show":{"@version":[{"_cnd":{"eq":1}}]}}},{"displayName":"Model","name":"modelName","type":"options","description":"The model which will generate the completion. <a href=\"https://developers.generativeai.google/api/rest/generativelanguage/models/list\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"/v1beta/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"models"}},{"type":"filter","properties":{"pass":"={{ !$responseItem.name.includes('embedding') && !$responseItem.name.includes('imagen') }}"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.name}}","value":"={{$responseItem.name}}","description":"={{$responseItem.description}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"models/gemini-3-flash-preview","builderHint":{"propertyHint":"Default to the latest flagship Gemini (models/gemini-3.1-pro-preview). Use models/gemini-3.1-flash-lite for cost-efficient builds. Avoid Gemini 2.x, 1.x, and earlier."},"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.1}}]}}},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Maximum Number of Tokens","name":"maxOutputTokens","default":2048,"description":"The maximum number of tokens to generate in the completion","type":"number"},{"displayName":"Sampling Temperature","name":"temperature","default":0.4,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.","type":"number"},{"displayName":"Top K","name":"topK","default":32,"typeOptions":{"maxValue":40,"minValue":-1,"numberPrecision":1},"description":"Used to remove \"long tail\" low probability responses. Defaults to -1, which disables it.","type":"number"},{"displayName":"Top P","name":"topP","default":1,"typeOptions":{"maxValue":1,"minValue":0,"numberPrecision":1},"description":"Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.","type":"number"},{"displayName":"Safety Settings","name":"safetySettings","type":"fixedCollection","typeOptions":{"multipleValues":true},"default":{"values":{"category":"HARM_CATEGORY_HARASSMENT","threshold":"HARM_BLOCK_THRESHOLD_UNSPECIFIED"}},"placeholder":"Add Option","options":[{"name":"values","displayName":"Values","values":[{"displayName":"Safety Category","name":"category","type":"options","description":"The category of harmful content to block","default":"HARM_CATEGORY_UNSPECIFIED","options":[{"value":"HARM_CATEGORY_HARASSMENT","name":"HARM_CATEGORY_HARASSMENT","description":"Harassment content"},{"value":"HARM_CATEGORY_HATE_SPEECH","name":"HARM_CATEGORY_HATE_SPEECH","description":"Hate speech and content"},{"value":"HARM_CATEGORY_SEXUALLY_EXPLICIT","name":"HARM_CATEGORY_SEXUALLY_EXPLICIT","description":"Sexually explicit content"},{"value":"HARM_CATEGORY_DANGEROUS_CONTENT","name":"HARM_CATEGORY_DANGEROUS_CONTENT","description":"Dangerous content"}]},{"displayName":"Safety Threshold","name":"threshold","type":"options","description":"The threshold of harmful content to block","default":"HARM_BLOCK_THRESHOLD_UNSPECIFIED","options":[{"value":"HARM_BLOCK_THRESHOLD_UNSPECIFIED","name":"HARM_BLOCK_THRESHOLD_UNSPECIFIED","description":"Threshold is unspecified"},{"value":"BLOCK_LOW_AND_ABOVE","name":"BLOCK_LOW_AND_ABOVE","description":"Content with NEGLIGIBLE will be allowed"},{"value":"BLOCK_MEDIUM_AND_ABOVE","name":"BLOCK_MEDIUM_AND_ABOVE","description":"Content with NEGLIGIBLE and LOW will be allowed"},{"value":"BLOCK_ONLY_HIGH","name":"BLOCK_ONLY_HIGH","description":"Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed"},{"value":"BLOCK_NONE","name":"BLOCK_NONE","description":"All content will be allowed"}]}]}]}]}],"iconUrl":"icons/@n8n/n8n-nodes-langchain/dist/nodes/llms/LmChatGoogleGemini/google.svg"},
|
|
@@ -53,7 +53,7 @@ function buildMessageContent(providerMetadata, toolInput, toolId, toolName) {
|
|
|
53
53
|
if (thinkingContent && thinkingType) {
|
|
54
54
|
return buildAnthropicContentBlocks(thinkingContent, thinkingType, thinkingSignature, toolInput, toolId, toolName);
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return null;
|
|
57
57
|
}
|
|
58
58
|
function resolveToolName(tool) {
|
|
59
59
|
return (tool.action.metadata?.hitl?.toolName ??
|
|
@@ -82,8 +82,8 @@ function buildIndividualAIMessage(toolId, toolName, toolInput, providerMetadata)
|
|
|
82
82
|
};
|
|
83
83
|
const content = buildMessageContent(providerMetadata, toolInput, toolId, toolName);
|
|
84
84
|
return new messages_1.AIMessage({
|
|
85
|
-
content,
|
|
86
|
-
...(
|
|
85
|
+
content: content ?? [],
|
|
86
|
+
...(content === null && { tool_calls: [toolCall] }),
|
|
87
87
|
...(providerMetadata.thoughtSignature && {
|
|
88
88
|
additional_kwargs: buildGeminiAdditionalKwargs([{ id: toolId, name: toolName, args: toolInput }], providerMetadata.thoughtSignature),
|
|
89
89
|
}),
|
|
@@ -164,11 +164,14 @@ function buildSteps(response, itemIndex) {
|
|
|
164
164
|
? [sharedAIMessage]
|
|
165
165
|
: []
|
|
166
166
|
: [buildIndividualAIMessage(toolId, toolName, toolInput, providerMetadata)];
|
|
167
|
+
const logFallback = messageLog[0]?.content?.length
|
|
168
|
+
? messageLog[0]?.content
|
|
169
|
+
: `Calling ${nodeName}`;
|
|
167
170
|
steps.push({
|
|
168
171
|
action: {
|
|
169
172
|
tool: toolName,
|
|
170
173
|
toolInput: toolInputForResult,
|
|
171
|
-
log: toolInput.log ||
|
|
174
|
+
log: toolInput.log || logFallback,
|
|
172
175
|
messageLog,
|
|
173
176
|
toolCallId: toolInput?.id,
|
|
174
177
|
type: toolInput.type || 'tool_call',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildSteps.js","sourceRoot":"","sources":["../../../utils/agent-execution/buildSteps.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"buildSteps.js","sourceRoot":"","sources":["../../../utils/agent-execution/buildSteps.ts"],"names":[],"mappings":";;AA2TA,gCA0FC;AArZD,uDAAqD;AACrD,+CAAkD;AAgClD,SAAS,uBAAuB,CAAC,QAAkC;IAClE,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAGzB,MAAM,gBAAgB,GACrB,OAAO,QAAQ,CAAC,MAAM,EAAE,gBAAgB,KAAK,QAAQ;QACpD,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB;QAClC,CAAC,CAAC,SAAS,CAAC;IAGd,MAAM,eAAe,GACpB,OAAO,QAAQ,CAAC,SAAS,EAAE,eAAe,KAAK,QAAQ;QACtD,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,eAAe;QACpC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,YAAY,GACjB,QAAQ,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU;QAC/C,QAAQ,CAAC,SAAS,EAAE,YAAY,KAAK,mBAAmB;QACvD,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,YAAY;QACjC,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,iBAAiB,GACtB,OAAO,QAAQ,CAAC,SAAS,EAAE,iBAAiB,KAAK,QAAQ;QACxD,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,iBAAiB;QACtC,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACN,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,iBAAiB;KACjB,CAAC;AACH,CAAC;AAkBD,SAAS,2BAA2B,CACnC,eAAuB,EACvB,YAA8C,EAC9C,iBAAqC,EACrC,SAAsB,EACtB,MAAc,EACd,QAAgB;IAGhB,MAAM,aAAa,GAClB,YAAY,KAAK,UAAU;QAC1B,CAAC,CAAC;YACA,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,eAAe;YACzB,SA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CAAC,CAAC,CAAC,EAAE,OAAO;YACxB,CAAC,CAAC,WAAW,QAAQ,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC;YACV,MAAM,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,kBAAkB;gBAC7B,GAAG,EAAE,SAAS,CAAC,GAAG,IAAI,WAAW;gBACjC,UAAU;gBACV,UAAU,EAAE,SAAS,EAAE,EAAE;gBACzB,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,WAAW;aACnC;YACD,WAAW;SACX,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BedrockRuntimeClient } from '@aws-sdk/client-bedrock-runtime';
|
|
2
|
+
import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@smithy/types';
|
|
3
|
+
import { type AWSRegion } from 'n8n-nodes-base/aws-credentials';
|
|
4
|
+
export declare function createBedrockRuntimeClient(params: {
|
|
5
|
+
region: AWSRegion;
|
|
6
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
7
|
+
bedrockRuntimeEndpoint?: string;
|
|
8
|
+
}): BedrockRuntimeClient;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createBedrockRuntimeClient = createBedrockRuntimeClient;
|
|
4
|
+
const client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
5
|
+
const ai_utilities_1 = require("@n8n/ai-utilities");
|
|
6
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
7
|
+
const aws_credentials_1 = require("n8n-nodes-base/aws-credentials");
|
|
8
|
+
function createBedrockRuntimeClient(params) {
|
|
9
|
+
const { region, credentials, bedrockRuntimeEndpoint } = params;
|
|
10
|
+
const endpoint = bedrockRuntimeEndpoint
|
|
11
|
+
? (0, aws_credentials_1.validateBedrockEndpointOverride)(bedrockRuntimeEndpoint, region)
|
|
12
|
+
: `https://bedrock-runtime.${region}.${(0, aws_credentials_1.getAwsDomain)(region)}`;
|
|
13
|
+
const proxyAgent = (0, ai_utilities_1.getNodeProxyAgent)(endpoint);
|
|
14
|
+
const clientConfig = {
|
|
15
|
+
region,
|
|
16
|
+
credentials,
|
|
17
|
+
...(bedrockRuntimeEndpoint ? { endpoint } : {}),
|
|
18
|
+
};
|
|
19
|
+
if (proxyAgent) {
|
|
20
|
+
clientConfig.requestHandler = new node_http_handler_1.NodeHttpHandler({
|
|
21
|
+
httpAgent: proxyAgent,
|
|
22
|
+
httpsAgent: proxyAgent,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return new client_bedrock_runtime_1.BedrockRuntimeClient(clientConfig);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=createBedrockRuntimeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBedrockRuntimeClient.js","sourceRoot":"","sources":["../../../utils/aws/createBedrockRuntimeClient.ts"],"names":[],"mappings":";;AAkBA,gEA2BC;AA7CD,4EAGyC;AACzC,oDAAsD;AACtD,iEAA4D;AAE5D,oEAIwC;AAOxC,SAAgB,0BAA0B,CAAC,MAI1C;IACA,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,sBAAsB,EAAE,GAAG,MAAM,CAAC;IAG/D,MAAM,QAAQ,GAAG,sBAAsB;QACtC,CAAC,CAAC,IAAA,iDAA+B,EAAC,sBAAsB,EAAE,MAAM,CAAC;QACjE,CAAC,CAAC,2BAA2B,MAAM,IAAI,IAAA,8BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;IAC/D,MAAM,UAAU,GAAG,IAAA,gCAAiB,EAAC,QAAQ,CAAC,CAAC;IAE/C,MAAM,YAAY,GAA+B;QAChD,MAAM;QACN,WAAW;QAEX,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/C,CAAC;IACF,IAAI,UAAU,EAAE,CAAC;QAChB,YAAY,CAAC,cAAc,GAAG,IAAI,mCAAe,CAAC;YACjD,SAAS,EAAE,UAAU;YACrB,UAAU,EAAE,UAAU;SACtB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,6CAAoB,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -4,5 +4,6 @@ import { type ISupplyDataFunctions } from 'n8n-workflow';
|
|
|
4
4
|
export type ResolvedAwsCredentials = {
|
|
5
5
|
region: AWSRegion;
|
|
6
6
|
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
7
|
+
bedrockRuntimeEndpoint?: string;
|
|
7
8
|
};
|
|
8
9
|
export declare function resolveAwsCredentials(context: ISupplyDataFunctions, itemIndex?: number): Promise<ResolvedAwsCredentials>;
|
|
@@ -50,7 +50,11 @@ async function resolveAwsCredentials(context, itemIndex = 0) {
|
|
|
50
50
|
? { sessionToken: creds.sessionToken }
|
|
51
51
|
: {}),
|
|
52
52
|
};
|
|
53
|
-
return {
|
|
53
|
+
return {
|
|
54
|
+
region: creds.region,
|
|
55
|
+
credentials: identity,
|
|
56
|
+
bedrockRuntimeEndpoint: creds.bedrockRuntimeEndpoint,
|
|
57
|
+
};
|
|
54
58
|
}
|
|
55
59
|
const creds = (await context.getCredentials('awsAssumeRole'));
|
|
56
60
|
(0, aws_credentials_1.assertSupportedAwsRegion)(creds.region);
|
|
@@ -108,6 +112,10 @@ async function resolveAwsCredentials(context, itemIndex = 0) {
|
|
|
108
112
|
...(requestHandler ? { requestHandler } : {}),
|
|
109
113
|
},
|
|
110
114
|
});
|
|
111
|
-
return {
|
|
115
|
+
return {
|
|
116
|
+
region: creds.region,
|
|
117
|
+
credentials: provider,
|
|
118
|
+
bedrockRuntimeEndpoint: creds.bedrockRuntimeEndpoint,
|
|
119
|
+
};
|
|
112
120
|
}
|
|
113
121
|
//# sourceMappingURL=resolveAwsCredentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveAwsCredentials.js","sourceRoot":"","sources":["../../../utils/aws/resolveAwsCredentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"resolveAwsCredentials.js","sourceRoot":"","sources":["../../../utils/aws/resolveAwsCredentials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,sDAmGC;AAvHD,oDAAsD;AACtD,iEAA4D;AAE5D,oEAOwC;AACxC,+CAAoE;AAS7D,KAAK,UAAU,qBAAqB,CAC1C,OAA6B,EAC7B,SAAS,GAAG,CAAC;IAEb,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAEnE,CAAC;IAEhB,IAAI,cAAc,KAAK,YAAY,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAA0B,CAAC;QAG7E,IAAA,0CAAwB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEvC,MAAM,QAAQ,GAA0B;YACvC,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,GAAG,CAAC,KAAK,CAAC,oBAAoB,IAAI,KAAK,CAAC,YAAY;gBACnD,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE;gBACtC,CAAC,CAAC,EAAE,CAAC;SACN,CAAC;QACF,OAAO;YACN,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,WAAW,EAAE,QAAQ;YACrB,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;SACpD,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC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M;YACpB,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C;KACD,CAAC,CAAC;IAEH,OAAO;QACN,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,WAAW,EAAE,QAAQ;QACrB,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;KACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import type { BaseMessage } from '@langchain/core/messages';
|
|
3
|
+
export type ChatModelMessageWrapper = (messages: BaseMessage[]) => BaseMessage[];
|
|
4
|
+
export declare function normalizeEmptyToolCallContent(messages: BaseMessage[]): BaseMessage[];
|
|
5
|
+
export declare function wrapChatModelMessageInput<TModel extends BaseChatModel>(model: TModel, wrapMessages?: ChatModelMessageWrapper): TModel;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeEmptyToolCallContent = normalizeEmptyToolCallContent;
|
|
4
|
+
exports.wrapChatModelMessageInput = wrapChatModelMessageInput;
|
|
5
|
+
const messages_1 = require("@langchain/core/messages");
|
|
6
|
+
const wrappedChatModelMessageInput = Symbol('wrappedChatModelMessageInput');
|
|
7
|
+
function normalizeEmptyToolCallContent(messages) {
|
|
8
|
+
return messages.map((message) => {
|
|
9
|
+
if (messages_1.AIMessage.isInstance(message) &&
|
|
10
|
+
Array.isArray(message.content) &&
|
|
11
|
+
message.content.length === 0 &&
|
|
12
|
+
message.tool_calls?.length) {
|
|
13
|
+
return new messages_1.AIMessage({
|
|
14
|
+
id: message.id,
|
|
15
|
+
name: message.name,
|
|
16
|
+
content: '',
|
|
17
|
+
additional_kwargs: message.additional_kwargs,
|
|
18
|
+
response_metadata: message.response_metadata,
|
|
19
|
+
tool_calls: message.tool_calls,
|
|
20
|
+
invalid_tool_calls: message.invalid_tool_calls,
|
|
21
|
+
usage_metadata: message.usage_metadata,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return message;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function wrapChatModelMessageInput(model, wrapMessages = normalizeEmptyToolCallContent) {
|
|
28
|
+
const patchableModel = model;
|
|
29
|
+
if (patchableModel[wrappedChatModelMessageInput])
|
|
30
|
+
return model;
|
|
31
|
+
const originalGenerate = patchableModel._generate.bind(model);
|
|
32
|
+
const originalStreamResponseChunks = patchableModel._streamResponseChunks.bind(model);
|
|
33
|
+
patchableModel._generate = async (messages, options, runManager) => await originalGenerate(wrapMessages(messages), options, runManager);
|
|
34
|
+
patchableModel._streamResponseChunks = async function* (messages, options, runManager) {
|
|
35
|
+
yield* originalStreamResponseChunks(wrapMessages(messages), options, runManager);
|
|
36
|
+
};
|
|
37
|
+
patchableModel[wrappedChatModelMessageInput] = true;
|
|
38
|
+
return model;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=chatModelMessageWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModelMessageWrapper.js","sourceRoot":"","sources":["../../utils/chatModelMessageWrapper.ts"],"names":[],"mappings":";;AA4BA,sEAsBC;AAMD,8DAqBC;AA3ED,uDAAqD;AAIrD,MAAM,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAsB5E,SAAgB,6BAA6B,CAAC,QAAuB;IACpE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/B,IACC,oBAAS,CAAC,UAAU,CAAC,OAAO,CAAC;YAC7B,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;YAC9B,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAC5B,OAAO,CAAC,UAAU,EAAE,MAAM,EACzB,CAAC;YACF,OAAO,IAAI,oBAAS,CAAC;gBACpB,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
|
2
2
|
"name": "@n8n/n8n-nodes-langchain",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -212,10 +212,11 @@
|
|
|
212
212
|
"@vitest/coverage-v8": "4.1.9",
|
|
213
213
|
"eslint-plugin-n8n-nodes-base": "^1.16.7",
|
|
214
214
|
"fast-glob": "3.2.12",
|
|
215
|
+
"typescript": "6.0.2",
|
|
215
216
|
"vitest": "^4.1.9",
|
|
216
217
|
"vitest-mock-extended": "^3.1.0",
|
|
217
|
-
"@n8n/eslint-plugin-community-nodes": "0.
|
|
218
|
-
"@n8n/vitest-config": "1.
|
|
218
|
+
"@n8n/eslint-plugin-community-nodes": "0.25.0",
|
|
219
|
+
"@n8n/vitest-config": "1.18.0"
|
|
219
220
|
},
|
|
220
221
|
"dependencies": {
|
|
221
222
|
"@aws-sdk/client-bedrock-runtime": "3.938.0",
|
|
@@ -250,13 +251,13 @@
|
|
|
250
251
|
"@langchain/redis": "1.0.1",
|
|
251
252
|
"@langchain/textsplitters": "1.0.1",
|
|
252
253
|
"@langchain/weaviate": "1.0.1",
|
|
253
|
-
"@microsoft/agents-a365-notifications": "
|
|
254
|
-
"@microsoft/agents-a365-observability": "
|
|
255
|
-
"@microsoft/agents-a365-runtime": "
|
|
256
|
-
"@microsoft/agents-a365-tooling": "
|
|
257
|
-
"@microsoft/agents-a365-tooling-extensions-langchain": "
|
|
258
|
-
"@microsoft/agents-activity": "1.
|
|
259
|
-
"@microsoft/agents-hosting": "1.
|
|
254
|
+
"@microsoft/agents-a365-notifications": "1.0.0",
|
|
255
|
+
"@microsoft/agents-a365-observability": "1.0.0",
|
|
256
|
+
"@microsoft/agents-a365-runtime": "1.0.0",
|
|
257
|
+
"@microsoft/agents-a365-tooling": "1.0.0",
|
|
258
|
+
"@microsoft/agents-a365-tooling-extensions-langchain": "1.0.0",
|
|
259
|
+
"@microsoft/agents-activity": "1.6.1",
|
|
260
|
+
"@microsoft/agents-hosting": "1.6.1",
|
|
260
261
|
"@mistralai/mistralai": "^1.10.0",
|
|
261
262
|
"@modelcontextprotocol/sdk": "1.26.0",
|
|
262
263
|
"@mozilla/readability": "^0.6.0",
|
|
@@ -302,17 +303,17 @@
|
|
|
302
303
|
"weaviate-client": "3.9.0",
|
|
303
304
|
"zod": "3.25.67",
|
|
304
305
|
"zod-to-json-schema": "3.23.3",
|
|
305
|
-
"@n8n/
|
|
306
|
-
"@n8n/
|
|
307
|
-
"@n8n/config": "2.
|
|
308
|
-
"@n8n/
|
|
309
|
-
"@n8n/
|
|
310
|
-
"@n8n/
|
|
311
|
-
"@n8n/
|
|
312
|
-
"
|
|
313
|
-
"n8n-nodes-base": "2.
|
|
314
|
-
"n8n-core": "2.
|
|
315
|
-
"n8n
|
|
306
|
+
"@n8n/client-oauth2": "1.13.0",
|
|
307
|
+
"@n8n/ai-utilities": "0.24.1",
|
|
308
|
+
"@n8n/config": "2.29.0",
|
|
309
|
+
"@n8n/errors": "0.12.0",
|
|
310
|
+
"@n8n/json-schema-to-zod": "1.14.0",
|
|
311
|
+
"@n8n/di": "0.15.0",
|
|
312
|
+
"@n8n/typescript-config": "1.9.0",
|
|
313
|
+
"n8n-workflow": "2.31.1",
|
|
314
|
+
"n8n-nodes-base": "2.31.1",
|
|
315
|
+
"n8n-core": "2.31.1",
|
|
316
|
+
"@n8n/utils": "1.39.0"
|
|
316
317
|
},
|
|
317
318
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
318
319
|
"homepage": "https://n8n.io",
|