mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(Text Classifier Node): Validate inputText parameter (#14832)
This commit is contained in:
@@ -227,6 +227,22 @@ export class TextClassifier implements INodeType {
|
|||||||
const item = items[itemIdx];
|
const item = items[itemIdx];
|
||||||
item.pairedItem = { item: itemIdx };
|
item.pairedItem = { item: itemIdx };
|
||||||
const input = this.getNodeParameter('inputText', itemIdx) as string;
|
const input = this.getNodeParameter('inputText', itemIdx) as string;
|
||||||
|
|
||||||
|
if (input === undefined || input === null) {
|
||||||
|
if (this.continueOnFail()) {
|
||||||
|
returnData[0].push({
|
||||||
|
json: { error: 'Text to classify is not defined' },
|
||||||
|
pairedItem: { item: itemIdx },
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
throw new NodeOperationError(
|
||||||
|
this.getNode(),
|
||||||
|
`Text to classify for item ${itemIdx} is not defined`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const inputPrompt = new HumanMessage(input);
|
const inputPrompt = new HumanMessage(input);
|
||||||
|
|
||||||
const systemPromptTemplateOpt = this.getNodeParameter(
|
const systemPromptTemplateOpt = this.getNodeParameter(
|
||||||
|
|||||||
Reference in New Issue
Block a user