fix(OpenAI Node): Show correct inputs for AI node (#14142)

This commit is contained in:
jeanpaul
2025-03-24 19:45:53 +01:00
committed by GitHub
parent cb01f2dd0d
commit 5bf10cdb4a

View File

@@ -50,25 +50,22 @@ const configureNodeInputs = (
) => { ) => {
if (resource === 'assistant' && operation === 'message') { if (resource === 'assistant' && operation === 'message') {
const inputs: INodeInputConfiguration[] = [ const inputs: INodeInputConfiguration[] = [
{ type: NodeConnectionTypes.Main }, { type: 'main' },
{ type: NodeConnectionTypes.AiTool, displayName: 'Tools' }, { type: 'ai_tool', displayName: 'Tools' },
]; ];
if (memory !== 'threadId') { if (memory !== 'threadId') {
inputs.push({ type: NodeConnectionTypes.AiMemory, displayName: 'Memory', maxConnections: 1 }); inputs.push({ type: 'ai_memory', displayName: 'Memory', maxConnections: 1 });
} }
return inputs; return inputs;
} }
if (resource === 'text' && operation === 'message') { if (resource === 'text' && operation === 'message') {
if (hideTools === 'hide') { if (hideTools === 'hide') {
return [NodeConnectionTypes.Main]; return ['main'];
} }
return [ return [{ type: 'main' }, { type: 'ai_tool', displayName: 'Tools' }];
{ type: NodeConnectionTypes.Main },
{ type: NodeConnectionTypes.AiTool, displayName: 'Tools' },
];
} }
return [NodeConnectionTypes.Main]; return ['main'];
}; };
// eslint-disable-next-line n8n-nodes-base/node-class-description-missing-subtitle // eslint-disable-next-line n8n-nodes-base/node-class-description-missing-subtitle