glm-4-chat 添加后有问题
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.11
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
❌ Actual Behavior
You are receiving an empty response from the glm-4-chat model because the model does not support system messages, and user messages must be in sequence. Ensure that your prompt messages are correctly formatted and that the content is properly handled.
Here are some key points to check:
- System Message Handling: If there is a system message, it should have content. If not, it should be removed.
- User Messages: There must be at least one user message after any system message. Ensure that user messages are properly sequenced and concatenated if necessary.
Here is a relevant part of the code that handles this:
if len(prompt_messages) == 0:
raise BadRequestError('At least one message is required')
if prompt_messages[0].role == MinimaxMessage.Role.SYSTEM.value:
if prompt_messages[0].content:
bot_setting['content'] = prompt_messages[0].content
prompt_messages = prompt_messages[1:]
if len(prompt_messages) == 0:
raise BadRequestError('At least one user message is required')
messages = [message.to_dict() for message in prompt_messages]
Additionally, ensure that you are using the latest version of both the frontend and backend of your Dify instance. If you are using Azure OpenAI, verify that the model is successfully deployed and that the model version is 0613 or later, as earlier versions do not support the function call capability required by the chat model [1][2][3][4][5].
To continue talking to Dosu, mention @dosu.
Close due to #1542
hai还是不行呀,我直接掉 glm-4是可以的,到DIFY里面就是使用不了