chatcraft.org
chatcraft.org copied to clipboard
Ability to attach file(s) to a chat
Similar to the work that's happening in #286, where we can attach image files, I'd like to be able to attach arbitrary file types and be able to then include them in the context of the chat. Eventually, this could include:
- Any text file (this is where we should start, as it won't require much work) like a piece of source code
- Similar to text files, I'd also like to support various types of files that will need to be parsed to text. For example: PDF, Word
- Any image file (already being done as part of #286)
- An audio file. We would need to extract the audio to text. A bunch of the work is already done to enable audio recording
We don't need to worry about all of these at first, and can file follow-up issues to do them once the basics are included.
To begin, we should probably add a paperclip icon to the prompt area, which when clicked, allows you to select local a file(s). We'd then show the file as an icon in the chat messages, but behind the scenes extract the text to include as part of the message's content.
We should consider how to handle the database, we could add a separate table for storing files as blob
s, or perhaps we decide to only store the content in the message? I suspect we'll want the files, but I'm not sure.