chatcraft.org
chatcraft.org copied to clipboard
Store attachments as Blob type
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 Blob
s, 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).