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

Azure DALL-e failing on v1.0.1 - 'base64' is not defined #15856

Open
5 tasks done
jonjonhui opened this issue Mar 14, 2025 · 1 comment
Open
5 tasks done

Azure DALL-e failing on v1.0.1 - 'base64' is not defined #15856

jonjonhui opened this issue Mar 14, 2025 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@jonjonhui
Copy link

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

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

  1. Create an agent
  2. Attach Azure DALL-e as a tool
  3. Send a message to request for an image

✔️ Expected Behavior

Azure Dall-E successfully returns an image

❌ Actual Behavior

Image
This error is thrown.
{"azure_dalle3": "tool invoke error: PluginInvokeError: {"args":{},"error_type":"NameError","message":"name 'base64' is not defined"}"}

Copy link

dosubot bot commented Mar 14, 2025

@jonjonhui Hello! I'm here to help you with bugs, questions, and becoming a contributor. Let me know how I can assist you while you wait for a human maintainer.

The error you're encountering, "name 'base64' is not defined," suggests that the base64 module is not being imported in the context where it's needed for the Azure DALL-e integration. In the Dify codebase, the base64 module is typically imported using the following statement:

from base64 import b64decode

This import is necessary for decoding base64-encoded image data received from the DALL-e API [1][2].

To resolve this issue, ensure that the base64 module is correctly imported in the file where the Azure DALL-e tool is implemented. You should check the relevant file for the DallE3Tool class and verify that the import statement is present and correctly placed at the top of the file. If it's missing, add the import statement to fix the NameError.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the 🐞 bug Something isn't working label Mar 14, 2025
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

No branches or pull requests

1 participant