Version 1.2.0 encounters an error when using the multimodal model glm-4v-flash to recognize uploaded images, while the same configuration works fine in version 0.15.3. #197

Closed
opened 2026-02-16 10:18:25 -05:00 by yindo · 3 comments
Owner

Originally created by @5lei on GitHub (Apr 15, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • 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

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Operation Steps:

Configure a picture upload at the start node. At the second node, enable the mass spectrometry vision model glm-4v-flash, and an error occurs when identifying the picture content.

Error Information

[zhipuai] Error: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for ModelInvokeLLMRequest\nprompt_messages.content.type\n Input should be <PromptMessageContentType.TEXT: 'text'> [type=literal_error, input_value='text', input_type=str]\n For further information visit https://errors.pydantic.dev/2.8/v/literal_error"}

Image

Problem Description

The same configuration works normally in dify 0.15.3, but an error occurs after upgrading to 1.2.0. Please help check what the problem is. Thank you.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @5lei on GitHub (Apr 15, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ## Operation Steps: Configure a picture upload at the start node. At the second node, enable the mass spectrometry vision model glm-4v-flash, and an error occurs when identifying the picture content. ## Error Information [zhipuai] Error: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for ModelInvokeLLMRequest\nprompt_messages.content.type\n Input should be <PromptMessageContentType.TEXT: 'text'> [type=literal_error, input_value='text', input_type=str]\n For further information visit https://errors.pydantic.dev/2.8/v/literal_error"} ![Image](https://github.com/user-attachments/assets/a03896aa-6c12-4495-b27e-842d16c7a952) ## Problem Description The same configuration works normally in dify 0.15.3, but an error occurs after upgrading to 1.2.0. Please help check what the problem is. Thank you. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 15, 2025):

Hello @5lei! I'm Dosu, a bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. Let's dive into your issue together!

The ValidationError you're encountering with the glm-4v-flash model in version 1.2.0 is due to Zhipu not supporting system role messages. To resolve this issue, you need to move all prompts from the 'system' role to the 'user' role. This change is necessary because the handling of role messages has been updated in version 1.2.0, which differs from version 0.15.3 where this was not enforced [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 15, 2025): <!-- Greeting --> Hello @5lei! I'm [Dosu](https://dosu.dev), a bot here to help you with bugs, answer questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. Let's dive into your issue together! <!-- Answer --> The ValidationError you're encountering with the glm-4v-flash model in version 1.2.0 is due to Zhipu not supporting system role messages. To resolve this issue, you need to move all prompts from the 'system' role to the 'user' role. This change is necessary because the handling of role messages has been updated in version 1.2.0, which differs from version 0.15.3 where this was not enforced <sup>[[1]](https://github.com/langgenius/dify/issues/17745)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/eafd2a07-2b7b-4d41-acca-1e4f6d485c38?feedback_type=other)</sup>
Author
Owner

@5lei commented on GitHub (Apr 15, 2025):

I tried switching back to the user role, and the error still persists. It seems that the issue isn’t related to the prompt. I suspect it has something to do with the parameter passing of the visual images. There is no error when the visual option is not selected. Could you please take another look at this problem? Thank you.

@5lei commented on GitHub (Apr 15, 2025): I tried switching back to the user role, and the error still persists. It seems that the issue isn’t related to the prompt. I suspect it has something to do with the parameter passing of the visual images. There is no error when the visual option is not selected. Could you please take another look at this problem? Thank you.
Author
Owner

@dosubot[bot] commented on GitHub (Aug 17, 2025):

Hi, @5lei. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a validation error in Dify v1.2.0 using the glm-4v-flash multimodal model, which worked in v0.15.3.
  • The error involves a prompt message content type mismatch during model invocation.
  • I suggested the issue might be due to Zhipu not supporting system role messages and recommended moving prompts to the user role.
  • You tried moving prompts to the user role, but the error persists.
  • You suspect the problem is related to parameter passing of visual images rather than the prompt role.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I do not hear back within 5 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 17, 2025): Hi, @5lei. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a validation error in Dify v1.2.0 using the glm-4v-flash multimodal model, which worked in v0.15.3. - The error involves a prompt message content type mismatch during model invocation. - I suggested the issue might be due to Zhipu not supporting system role messages and recommended moving prompts to the user role. - You tried moving prompts to the user role, but the error persists. - You suspect the problem is related to parameter passing of visual images rather than the prompt role. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I do not hear back within 5 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#197