n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
45.49k stars 6.25k forks source link

Text Classifier node complains when System Prompt option is not explicitly set #10336

Open jimleuk opened 1 month ago

jimleuk commented 1 month ago

Bug Description

When using the "text classifier" node, it complains with the following error if the system prompt option is not explicitly set.

{
  "errorMessage": "Could not get parameter",
  "errorDetails": {
    "errorExtra": {
      "parameterName": "options.systemPromptTemplate"
    }
  },
  "n8nDetails": {
    "n8nVersion": "1.53.1 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "Error: Could not get parameter",
      "    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1629:15)",
      "    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2358:24)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/TextClassifier/TextClassifier.node.js:183:50)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1086:20"
    ]
  }
}

To Reproduce

  1. Add Advanced AI > Text Classifier node
  2. Add inputs "text" and specify a few categories to use.
  3. Click Test step to execute the node
  4. The error message is shown
  5. In the node's options, select system prompt option - do not edit the option's text
  6. Click Test Step again to execute the node
  7. The node executes successfully

Expected behavior

The node should execute successfully if the system prompt option is not set as it's expected to be optional.

Operating System

MacOS Sonoma 14.6

n8n Version

1.53.1

Node.js Version

18

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 1 month ago

Thanks @jimleuk,

I have managed to reproduce and have created AI-274 as the internal ticket to get this resolved.

silva-kleyton commented 3 weeks ago

I have the same problem

Operating System MacOS Sonoma 14.6

n8n Version 1.55.0

Node.js Version 20

Database Postgres