chatcraft.org icon indicating copy to clipboard operation
chatcraft.org copied to clipboard

Store attachments as Blob type

Open humphd opened this issue 1 year ago • 1 comments

In #281 we are adding initial support for attachments. Currently, we only support image/* files, but in #325 we are going to expand this to allow more types.

The way we're handling current image attachments is closely linked to OpenAI's requirements for base64 image URIs, since that's where this feature was first needed. However, this isn't a great approach, and using a Blob is a much better approach.

Let's alter the way we store and manage attachments in the db and throughout our code to use Blobs, which can be generic and work with any type. We should probably also add a new class, ChatCraftAttachment or ChatCraftFile, etc. which can handle various conversions (e.g., file -> base64String).

humphd avatar Feb 08 '24 14:02 humphd