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

The chat api supports base64 image files #9430

Open
4 of 5 tasks
deific opened this issue Oct 17, 2024 · 6 comments
Open
4 of 5 tasks

The chat api supports base64 image files #9430

deific opened this issue Oct 17, 2024 · 6 comments
Assignees
Labels
💪 enhancement New feature or request

Comments

@deific
Copy link

deific commented Oct 17, 2024

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When chatting through the API interface, currently the file only supports the methods of remote_url and local_file, and in my scenario, there are limitations when using both methods. I hope to be able to upload files using base64 format image content.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
@dosubot dosubot bot added the 💪 enhancement New feature or request label Oct 17, 2024
@crazywoola
Copy link
Member

The current two upload methods have covered most of the scenarios, and if the base64 file upload is open, it will cause some unnecessary problems, such as you will encounter variable length limitations.

I would like to know more about why you need this, can you give me a example or case that can describe this feature request.

@deific
Copy link
Author

deific commented Oct 18, 2024

The current two upload methods have covered most of the scenarios, and if the base64 file upload is open, it will cause some unnecessary problems, such as you will encounter variable length limitations.

I would like to know more about why you need this, can you give me a example or case that can describe this feature request.

The remote_url method requires uploading the image to a publicly accessible location. For scenarios that require protecting user privacy, publicly accessing the image may be problematic.
The local file upload method relies on dify's file upload service, and the image itself may be a part of the user's data asset, which also needs to be stored and accessed. Because chatting requires uploading to dify again, the interaction is not very friendly. And after DIY storage, it may be useless in most scenarios (after the chat ends).
The base64 method is simpler and will be stored in the chat session. Of course, size is an issue and may be more suitable for some small or compressed image scenes.

@rocing
Copy link

rocing commented Nov 11, 2024

the same question and demand

Copy link

dosubot bot commented Dec 12, 2024

Hi, @deific. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • You requested support for base64 file uploads in the chat API, citing privacy and data handling concerns with current methods.
  • "Crazywoola" mentioned potential issues with base64, like variable length limitations, and asked for more context.
  • You clarified that remote_url requires public access, posing privacy concerns, and local_file is not user-friendly.
  • Another user, "rocing," also expressed the need for this feature.

Next Steps

  • Could you confirm if this issue is still relevant to the latest version of the Dify repository? If so, please comment to keep the discussion open.
  • If there are no further updates, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 12, 2024
@rocing
Copy link

rocing commented Dec 13, 2024

I think base64 still has many use cases, and in some scenarios it has advantages over remote_url and local_file. I hope the official website can support it. Currently, I am still encountering issues with remote_url because I often experience latency problems accessing my CDN from mainland China, which leads to failures. I also need to prepare an overseas CDN.

@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Dec 13, 2024
Copy link

dosubot bot commented Dec 13, 2024

@takatost, the user @rocing has indicated that the issue regarding base64 file uploads is still relevant, citing ongoing latency problems with remote_url and the need for support on the official website. Could you please assist them with this matter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants