dify icon indicating copy to clipboard operation
dify copied to clipboard

In a chat,after using file upload feature and docExtractor to ask llm.Then the next ask failed with "Run failed: Only image file can convert to prompt message content"

Open cskkx1 opened this issue 1 year ago • 2 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

Version 0.10.0-beta2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

1.Import this DSL,remember to change the ext txt to yml. 文档上传问答测试.yml.txt 2.Upload a file and ask llm. 3.Ask LLM again.

✔️ Expected Behavior

After file upload ask llm,I can still ask another time.

❌ Actual Behavior

After file upload ask llm,can't ask anymore.And return "Run failed: Only image file can convert to prompt message content" 1728379906478

cskkx1 avatar Oct 08 '24 09:10 cskkx1

@cskkx1 Hello there! I'm here to help you with any bugs, answer your questions, and guide you on how to become a contributor. Let's work on resolving your issue together.

The error "Run failed: Only image file can convert to prompt message content" occurs because the system expects non-string content of a UserPromptMessage to be of type IMAGE. If the content type is TEXT, a ValueError is raised. This indicates that the system is designed to handle only image files for conversion to prompt message content, and any other type, such as text, will trigger this error.

To resolve this, ensure that the file being uploaded is an image and is correctly recognized as such by the system [1].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Oct 08 '24 09:10 dosubot[bot]

Can any body reproduce this bug?

cskkx1 avatar Oct 09 '24 07:10 cskkx1

As do I.

kkjinping avatar Oct 11 '24 06:10 kkjinping

Thank you for the report! This issue will be fixed in the next beta version.

laipz8200 avatar Oct 15 '24 03:10 laipz8200

Fixed in #9360, enjoy!

laipz8200 avatar Oct 15 '24 08:10 laipz8200