diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts index 2245cfd2a887b..0554a2f0c0a52 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/methods/config.ts @@ -25,7 +25,7 @@ export function getInputs(parameters: IDataObject) { const needsFallback = parameters?.needsFallback; - if (needsFallback === undefined || needsFallback === true) { + if (needsFallback === true) { inputs.push({ displayName: 'Fallback Model', maxConnections: 1, diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts index 67bc1a72b416b..1dbbdbcc40bc4 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainLLM/test/config.test.ts @@ -7,27 +7,25 @@ describe('config', () => { it('should return basic inputs for all parameters', () => { const inputs = getInputs({}); - expect(inputs).toHaveLength(4); + expect(inputs).toHaveLength(3); expect(inputs[0].type).toBe(NodeConnectionTypes.Main); expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel); - expect(inputs[2].type).toBe(NodeConnectionTypes.AiLanguageModel); - expect(inputs[3].type).toBe(NodeConnectionTypes.AiOutputParser); + expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser); }); it('should exclude the OutputParser when hasOutputParser is false', () => { const inputs = getInputs({ hasOutputParser: false }); - expect(inputs).toHaveLength(3); + expect(inputs).toHaveLength(2); expect(inputs[0].type).toBe(NodeConnectionTypes.Main); expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel); - expect(inputs[2].type).toBe(NodeConnectionTypes.AiLanguageModel); }); it('should include the OutputParser when hasOutputParser is true', () => { const inputs = getInputs({ hasOutputParser: true }); - expect(inputs).toHaveLength(4); - expect(inputs[3].type).toBe(NodeConnectionTypes.AiOutputParser); + expect(inputs).toHaveLength(3); + expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser); }); it('should exclude the FallbackInput when needsFallback is false', () => {