You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
Please do not modify this template :) and fill in all the required fields.
Dify version
0.14.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
If there are variables in the system prompt words, the variables should be replaced with actual values and the replaced strings should be input into the big model.
❌ Actual Behavior
Content input is an array,this should be a string.
The text was updated successfully, but these errors were encountered:
The issue you're encountering seems to be related to how variables within system prompts are handled and replaced in the Dify workflow. In the LLM node, the message.content should be a string, but it appears to be an array of TextPromptMessageContent objects instead. This discrepancy is likely causing the "Bad Request Error" with error code 400.
To resolve this, ensure that the variables in the system prompt are correctly replaced with actual values before being passed to the LLM node. The message.content should be a single string after variable replacement, not an array. You might need to adjust the code to concatenate the data attributes of the TextPromptMessageContent objects into a single string before assigning it to message.content.
Additionally, verify that all required parameters, such as messages[0].content[0].type, are correctly set in the request payload. This will help prevent the "Missing required parameter" error.
Self Checks
Dify version
0.14.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
If there are variables in the system prompt words, the variables should be replaced with actual values and the replaced strings should be input into the big model.
❌ Actual Behavior
Content input is an array,this should be a string.The text was updated successfully, but these errors were encountered: