Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Loading