tjhasan / chatgpt-agent

Simple agent for discord users to interact with chatGPT AI at a low level.
1 stars 0 forks source link

Update dalle.js code to send image file instead of a link to the image after /vision is called #5

Closed tjhasan closed 1 year ago

tjhasan commented 1 year ago

In the current implementation of dalle.js, openAI returns a link to the resulting image. Mimir then edits his response with this link, which Discord then automatically embeds with the image at that link into the channel.

This is fine, however it makes it impossible to access those images after a long time has passed. They will still appear in the discord chat history but you won't be able to save them to your local machine. Additionally, trying to access the link will result in an auth error.

For this reason, we need to adjust the code to do the following:

  1. Save image from response image link into *.png file.
  2. Edit response with resulting .png file.

This can be done because waifu.js currently handles images in this way, so we can use that as reference.

mrodgers616 commented 1 year ago

I got this

tjhasan commented 1 year ago

Completed. /vision now sends the image file instead of just a url. Will need to update the code again to get it to work with firebase in the future.