Agent Prompter node throwing error with GPT 1o-preview or 1o-mini

I’m running KNIME AP 5.2.5.

I just attempted to use the newer GPT models 1o-mini and 1o-preview, and received the following error message from the Agent Prompter node:

ERROR Agent Prompter 4:1762:0:1682 Execute failed: Error code: 400 - {‘error’: {‘message’: “Unsupported value: ‘messages[0].role’ does not support ‘system’ with this model.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘messages[0].role’, ‘code’: ‘unsupported_value’}}

This workflow/node works just fine with previous models (4o, 3.5, etc).

Anyone encounter a similar issue?

Hey there

The cause of error seems to be on the OpenAI-side, not KNIME side:

O1 series do not support system messages currently:

Try removing the system message / change it to Human or ai message in your conversation table…

2 Likes

Thank you for the insight. I made your recommended modifications; they appear to have worked, but I am getting a new error:

ERROR Chat Model Prompter 4:1767:0:1765 Execute failed: Error code: 400 - {‘error’: {‘message’: “Unsupported parameter: ‘max_tokens’ is not supported with this model. Use ‘max_completion_tokens’ instead.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘max_tokens’, ‘code’: ‘unsupported_parameter’}}

The max_tokens parameter in the current OpenAI Chat Model Connector node is/cannot be converted in any way to the new parameter max_completion_tokens, so I assume this is a dead end for this node with the gpt-1o model. Will try to configure my chatbot for the 1o model using the nodepit OpenAI nodes, which presumably allow this level of configuration in the JSON string.

Am I missing a more simple solution?