mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Basic LLM Chain Node): Remove fallback connection on lower versions (#19053)
This commit is contained in:
@@ -25,7 +25,7 @@ export function getInputs(parameters: IDataObject) {
|
|||||||
|
|
||||||
const needsFallback = parameters?.needsFallback;
|
const needsFallback = parameters?.needsFallback;
|
||||||
|
|
||||||
if (needsFallback === undefined || needsFallback === true) {
|
if (needsFallback === true) {
|
||||||
inputs.push({
|
inputs.push({
|
||||||
displayName: 'Fallback Model',
|
displayName: 'Fallback Model',
|
||||||
maxConnections: 1,
|
maxConnections: 1,
|
||||||
|
|||||||
@@ -7,27 +7,25 @@ describe('config', () => {
|
|||||||
it('should return basic inputs for all parameters', () => {
|
it('should return basic inputs for all parameters', () => {
|
||||||
const inputs = getInputs({});
|
const inputs = getInputs({});
|
||||||
|
|
||||||
expect(inputs).toHaveLength(4);
|
expect(inputs).toHaveLength(3);
|
||||||
expect(inputs[0].type).toBe(NodeConnectionTypes.Main);
|
expect(inputs[0].type).toBe(NodeConnectionTypes.Main);
|
||||||
expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
||||||
expect(inputs[2].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser);
|
||||||
expect(inputs[3].type).toBe(NodeConnectionTypes.AiOutputParser);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should exclude the OutputParser when hasOutputParser is false', () => {
|
it('should exclude the OutputParser when hasOutputParser is false', () => {
|
||||||
const inputs = getInputs({ hasOutputParser: false });
|
const inputs = getInputs({ hasOutputParser: false });
|
||||||
|
|
||||||
expect(inputs).toHaveLength(3);
|
expect(inputs).toHaveLength(2);
|
||||||
expect(inputs[0].type).toBe(NodeConnectionTypes.Main);
|
expect(inputs[0].type).toBe(NodeConnectionTypes.Main);
|
||||||
expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
expect(inputs[1].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
||||||
expect(inputs[2].type).toBe(NodeConnectionTypes.AiLanguageModel);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should include the OutputParser when hasOutputParser is true', () => {
|
it('should include the OutputParser when hasOutputParser is true', () => {
|
||||||
const inputs = getInputs({ hasOutputParser: true });
|
const inputs = getInputs({ hasOutputParser: true });
|
||||||
|
|
||||||
expect(inputs).toHaveLength(4);
|
expect(inputs).toHaveLength(3);
|
||||||
expect(inputs[3].type).toBe(NodeConnectionTypes.AiOutputParser);
|
expect(inputs[2].type).toBe(NodeConnectionTypes.AiOutputParser);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should exclude the FallbackInput when needsFallback is false', () => {
|
it('should exclude the FallbackInput when needsFallback is false', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user