/chat-messages API handle VL model input error #7860

Closed
opened 2026-02-21 18:22:44 -05:00 by yindo · 3 comments
Owner

Originally created by @arzen on GitHub (Jan 23, 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

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

use qwen2.5 -VL model, set response_mode to "blocking" such as :

{
  "inputs": {},
    "query": "有什么手机?",
    "response_mode": "blocking",
    "conversation_id": "",
    "user": "abc-123",
    "files": [],
  "auto_generate_name": false
}

post call API /chat-messages

✔️ Expected Behavior

it can work well

Actual Behavior

then respone error message:

{
    "code": "completion_request_error",
    "message": "[tongyi] Error: 2 validation errors for AssistantPromptMessage\ncontent.str\n  Input should be a valid string [type=string_type, input_value=[{'text': '你好!我...的新篇章!😊'}], input_type=list]\n    For further information visit https://errors.pydantic.dev/2.9/v/string_type\ncontent.json-or-python[json=list[PromptMessageContent],python=chain[is-instance[Sequence],function-wrap[sequence_validator()]]].0.type\n  Field required [type=missing, input_value={'text': '你好!我们...活的新篇章!😊'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.9/v/missing",
    "status": 400
}

if set response_mode to "streaming", it can work,

Originally created by @arzen on GitHub (Jan 23, 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 0.15.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce use qwen2.5 -VL model, set response_mode to "blocking" such as : ``` { "inputs": {}, "query": "有什么手机?", "response_mode": "blocking", "conversation_id": "", "user": "abc-123", "files": [], "auto_generate_name": false } ``` post call API /chat-messages ### ✔️ Expected Behavior it can work well ### ❌ Actual Behavior then respone error message: ``` { "code": "completion_request_error", "message": "[tongyi] Error: 2 validation errors for AssistantPromptMessage\ncontent.str\n Input should be a valid string [type=string_type, input_value=[{'text': '你好!我...的新篇章!😊'}], input_type=list]\n For further information visit https://errors.pydantic.dev/2.9/v/string_type\ncontent.json-or-python[json=list[PromptMessageContent],python=chain[is-instance[Sequence],function-wrap[sequence_validator()]]].0.type\n Field required [type=missing, input_value={'text': '你好!我们...活的新篇章!😊'}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.9/v/missing", "status": 400 } ``` if set response_mode to "streaming", it can work,
yindo added the 🐞 bug label 2026-02-21 18:22:44 -05:00
yindo closed this issue 2026-02-21 18:22:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 23, 2025):

Hey @arzen! I'm here to help you with any bugs, questions, or contributions you have for our project. Let's tackle this issue together!

I found a similar unsolved discussion titled "Help:agent not support blocking mode in restful api,why?" which might be related to the issue you're experiencing [1].

The error message you're encountering indicates validation errors for the AssistantPromptMessage model. Specifically, it seems that the content field is expected to be a valid string, but a list is being provided instead. Additionally, a required field within the content is missing.

To resolve this, ensure that the content field in your request is a valid string and that all required fields are included. If switching to "streaming" mode works, it might be due to differences in how the modes handle input validation. You may need to adjust the input format or structure when using "blocking" mode to meet the validation requirements.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Jan 23, 2025): <!-- Greeting --> Hey @arzen! I'm here to help you with any bugs, questions, or contributions you have for our project. Let's tackle this issue together! <!-- Answer --> I found a similar unsolved discussion titled "[Help:agent not support blocking mode in restful api,why?](https://github.com/langgenius/dify/discussions/7805)" which might be related to the issue you're experiencing <sup>[[1]](https://github.com/langgenius/dify/discussions/7805)</sup>. The error message you're encountering indicates validation errors for the `AssistantPromptMessage` model. Specifically, it seems that the `content` field is expected to be a valid string, but a list is being provided instead. Additionally, a required field within the `content` is missing. To resolve this, ensure that the `content` field in your request is a valid string and that all required fields are included. If switching to "streaming" mode works, it might be due to differences in how the modes handle input validation. You may need to adjust the input format or structure when using "blocking" mode to meet the validation requirements. <!-- 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/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/9e24259e-6a67-4711-9c7a-78d55311e73d?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 23, 2025):

Can you share the configuration of the LLM node.

@crazywoola commented on GitHub (Jan 23, 2025): Can you share the configuration of the LLM node.
Author
Owner

@hieheihei commented on GitHub (Jan 25, 2025):

When using Qwen-VL-Max in blocking mode, I also encountered this problem.

@hieheihei commented on GitHub (Jan 25, 2025): When using Qwen-VL-Max in blocking mode, I also encountered this problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7860