feat(OpenAI Node, Agent Node, Basic LLM Chain Node): Update title of an error when missing chatInput

This commit is contained in:
Oleg Ivaniv 2024-10-10 15:42:04 +02:00
parent 8e6ddfe028
commit e06b75ccd2
No known key found for this signature in database
2 changed files with 16 additions and 8 deletions

View file

@ -181,10 +181,14 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
} }
if (input === undefined) { if (input === undefined) {
throw new NodeOperationError(this.getNode(), 'No prompt specified', { throw new NodeOperationError(
this.getNode(),
"Could not automatically set prompt from previous node. Please select 'Define below' in the Prompt parameter",
{
description: description:
"Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter", "Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter",
}); },
);
} }
const assistantId = this.getNodeParameter('assistantId', i, '', { extractValue: true }) as string; const assistantId = this.getNodeParameter('assistantId', i, '', { extractValue: true }) as string;

View file

@ -98,10 +98,14 @@ export function getPromptInputByType(options: {
} }
if (input === undefined) { if (input === undefined) {
throw new NodeOperationError(ctx.getNode(), 'No prompt specified', { throw new NodeOperationError(
ctx.getNode(),
"Could not automatically set prompt from previous node. Please select 'Define below' in the Prompt parameter",
{
description: description:
"Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter", "Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter",
}); },
);
} }
return input; return input;