Analyze picture has error using Qwen-omni-7B #433

Closed
opened 2026-02-16 10:19:24 -05:00 by yindo · 2 comments
Owner

Originally created by @fanfan-lucky on GitHub (Jul 9, 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.5.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Run failed: [openai_api_compatible] Error: PluginInvokeError: {"args":{"description":"[models] Error: Object of type ImagePromptMessageContent is not JSON serializable"},"error_type":"InvokeError","message":"[models] Error: Object of type ImagePromptMessageContent is not JSON serializable"}

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @fanfan-lucky on GitHub (Jul 9, 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.5.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Run failed: [openai_api_compatible] Error: PluginInvokeError: {"args":{"description":"[models] Error: Object of type ImagePromptMessageContent is not JSON serializable"},"error_type":"InvokeError","message":"[models] Error: Object of type ImagePromptMessageContent is not JSON serializable"} ![Image](https://github.com/user-attachments/assets/a0c27109-c692-4538-a22f-caac01f0ea8b) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:19:24 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 9, 2025):

This error happens because the ImagePromptMessageContent object (used for image prompts) isn't being converted to a JSON-serializable format before being sent to the model/plugin. Dify's core code uses Pydantic's model_dump and a custom jsonable_encoder to handle this serialization, so this error usually means that somewhere in the integration (possibly in a plugin or external handler for Qwen-omni-7B), the object is being passed directly to json.dumps or similar without first converting it to a dict or using the encoder.

There is no official Qwen-omni-7B provider in the core Dify repo, so this is likely an issue with a custom or third-party integration. To fix it, ensure that any ImagePromptMessageContent objects are passed through model_dump(), dict(), or Dify's jsonable_encoder before serialization. This will convert them into a format that can be safely serialized to JSON and sent to the model/plugin. You can see how Dify handles this in its plugin invocation code and encoder utility (reference, reference).

If you're using a custom plugin or extension for Qwen-omni-7B, check its code to make sure it serializes prompt messages correctly. If you need a workaround, you can manually convert any ImagePromptMessageContent to a dict before sending it to the plugin or API.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 9, 2025): <!-- Answer --> This error happens because the ImagePromptMessageContent object (used for image prompts) isn't being converted to a JSON-serializable format before being sent to the model/plugin. Dify's core code uses Pydantic's model_dump and a custom jsonable_encoder to handle this serialization, so this error usually means that somewhere in the integration (possibly in a plugin or external handler for Qwen-omni-7B), the object is being passed directly to json.dumps or similar without first converting it to a dict or using the encoder. There is no official Qwen-omni-7B provider in the core Dify repo, so this is likely an issue with a custom or third-party integration. To fix it, ensure that any ImagePromptMessageContent objects are passed through model_dump(), dict(), or Dify's jsonable_encoder before serialization. This will convert them into a format that can be safely serialized to JSON and sent to the model/plugin. You can see how Dify handles this in its plugin invocation code and encoder utility ([reference](https://github.com/langgenius/dify/blob/a316766ad7eb0438c26194d466e9bcdc7e7c87e2/api/core/model_runtime/utils/encoders.py), [reference](https://github.com/langgenius/dify/blob/a316766ad7eb0438c26194d466e9bcdc7e7c87e2/api/core/plugin/impl/model.py)). If you're using a custom plugin or extension for Qwen-omni-7B, check its code to make sure it serializes prompt messages correctly. If you need a workaround, you can manually convert any ImagePromptMessageContent to a dict before sending it to the plugin or API. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7f005297-ba4b-45c3-b777-533011e11ffb?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22116)
Author
Owner

@fanfan-lucky commented on GitHub (Jul 9, 2025):

Already resolved.

@fanfan-lucky commented on GitHub (Jul 9, 2025): Already resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#433