langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.37k stars 7.22k forks source link

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. #3590

Closed ixujue closed 5 months ago

ixujue commented 6 months ago

Self Checks

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.

image use glm-3-turbo, glm-4 image use glm-4v image use chatglm_turbo (correctly) image

image

✔️ 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.

dosubot[bot] commented 6 months ago

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

#### 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.
Yeuoly commented 6 months ago

This is a model related issue, pls check official documents of ZhipuAI.

dosubot[bot] commented 5 months ago

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!

crazywoola commented 5 months ago

Please upgrade to latest version to see if this issue persists. :)