Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks done
arzen opened this issue Jan 23, 2025 · 3 comments · May be fixed by #13052
Open
5 tasks done

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

arzen opened this issue Jan 23, 2025 · 3 comments · May be fixed by #13052
Labels
🐞 bug Something isn't working

Comments

@arzen
Copy link

arzen commented 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,

@arzen arzen changed the title /chat-messages AIP handle VL model input error /chat-messages API handle VL model input error Jan 23, 2025
@dosubot dosubot bot added the 🐞 bug Something isn't working label Jan 23, 2025
Copy link

dosubot bot commented 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

@crazywoola
Copy link
Member

Can you share the configuration of the LLM node.

@hieheihei
Copy link

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

@hieheihei hieheihei linked a pull request Jan 26, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants