Bug:The issue with calling Zhipu AI is that in the chat assistant type, workflow orchestration is available, but errors occur when using the workflow type.
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, 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] Pleas do not modify this template :) and fill in all the required fields.
Dify version
Version 0.6.3
Cloud or Self Hosted
Cloud
Steps to reproduce
The issue with the ZhiPu AI model arises when operating within the chat assistant type where workflow orchestration is functioning properly. However, errors are encountered when switching to the workflow type. Among the four available models, only one model operates correctly in the workflow type (chatglm_turbo). The other two models result in errors (glm-3-turbo, glm-4), and one model seems to be in a state of self-entertainment (glm-4v), consistently producing hallucinatory results. There are two specific error prompts that occur: "Node LLM run failed: [Zhipu] Error: Error code: 400, with error text {"error":{"code":"1214","message":"The messages parameter is illegal. Please check the document."}}. When this error appears, the functioning model remains unaffected, but selecting either of the other two models leads to the error.
use glm-3-turbo, glm-4
use glm-4v
use chatglm_turbo (correctly)
✔️ Expected Behavior
All models are functioning properly.
❌ Actual Behavior
the four available models, only one model operates correctly in the workflow type (chatglm_turbo). The other two models result in errors (glm-3-turbo, glm-4), and one model seems to be in a state of self-entertainment (glm-4v), consistently producing hallucinatory results. There are two specific error prompts that occur: "Node LLM run failed: [Zhipu] Error: Error code: 400, with error text {"error":{"code":"1214","message":"The messages parameter is illegal. Please check the document."}}. When this error appears, the functioning model remains unaffected, but selecting either of the other two models leads to the error.
The issue you're encountering with the ZhiPu AI models glm-3-turbo, glm-4, and glm-4v, where only the chatglm_turbo model operates correctly, seems to be related to the configuration and parameter rules of these models. The error message indicating "The messages parameter is illegal" suggests a problem with the request parameters, possibly due to incorrect formatting or values that the API does not accept.
To address this, ensure that your request parameters are correctly formatted and contain the expected values. The differences in behavior between the models could be due to specific parameters like temperature and top_p in the chatglm_turbo model, which control the output's randomness and creativity, making it more stable.
If the problem persists, reviewing the specific configurations for the glm-3-turbo, glm-4, and glm-4v models and comparing them to the chatglm_turbo model might provide further insights. Unfortunately, without direct access to these configurations or more detailed error logs, it's challenging to provide a more specific solution.
The Dify codebase includes several error handling mechanisms for ZhiPu AI models, which could help in diagnosing the issue further. Ensuring that your request aligns with the expected parameters and formats as per the Dify documentation might resolve the error.
Sources
- Bug:The issue with calling Zhipu AI is that in the chat assistant type, workflow orchestration is available, but errors occur when using the workflow type.
- 调用智谱AI出错问题,聊天助手类型中工作流编排可用,但使用工作流类型就报错。
- api/core/model_runtime/model_providers/zhipuai/llm/chatglm_turbo.yaml
- api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/init.py
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
This is a model related issue, pls check official documents of ZhipuAI.
Hi, @ixujue,
I'm helping the Dify team manage their backlog and am marking this issue as stale. From what I understand, the issue involves errors with ZhiPu AI models when switching to the workflow type, with only one out of four available models operating correctly. The other two models result in errors, and one model consistently produces hallucinatory results. The error message "The messages parameter is illegal" suggests a problem with the request parameters, possibly due to incorrect formatting or values that the API does not accept. The discussion includes suggestions to review the specific configurations for the problematic models and ensure that request parameters align with the expected formats as per the Dify documentation. Additionally, it's recommended to consult the official documents of ZhipuAI for further insights.
Could you please confirm if this issue is still relevant to the latest version of the Dify repository? If it is, please let the Dify team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.
Thank you!
Please upgrade to latest version to see if this issue persists. :)