First Alpha Release: Discourse OpenAI Dall-E Bot

Hi All,

After hacking together the OpenAI ChatBot for Discourse, creating the same type of plugin for the OpenAI Dall-E image generator was easy.

Currently generating images in 256x256 format and wrapping the results in Markdown image code:

![prompt-as-alt-text](url-of-generated-image-from-open-ai)

Seems to work OK most of the time, but sometimes the Markdown does not resolve the image as quickly as I would like.

Created a user for this Dall-E bot and a new category. Here some examples:

I think I'll take a break from OpenAI for a few days now that I have learned the OpenAI API and written two Discourse plugins.

My guess is that I made need to find a way to improve adding the Dall-E generated image URL to a forum reply post.

Please try it out to help debug; as I am logging for debugging at time time.

Thanks!

There is an unresolved issue with this plugin because the links to Dall-E generated images expire in two hours and Discourse seems to download these hot-linked images slower than two hours at times.

Testing continues ....

See Also:

OK. I have (seemingly) resolved this issue by:

  1. Downloading the Dall-E generated images to the Discourse container in a public upload folder.
  2. Generating a "community" URL and using that image in Markdown when posting.

This method preserves the generated image since Dall-E expires the image link after two hours, giving Discourse tasks time to download the image in the standard Discourse way.

For some reason, these URLs render better than the Dall-E generated (very long) URLS.

Usage to Date:

OK. I think the primary issue of images not rendering perfectly at times is because we run "two containers" and Redis seems to dominate one container and the process of downloading images and converting the in-post links can get out of sync.

Today, when I rebuilt the container, all images appeared as they should. So, in single container (normal) Discourse apps, this "images out of sync" issue should not exist.

Still, maybe someday I'll debug the Redis job and see how I can improve this for dual containers, but it is not a priority at this as "it works".