gpt4all icon indicating copy to clipboard operation
gpt4all copied to clipboard

Feature to attach a file when sending a message to LLM.

Open chrisbarrera opened this issue 1 year ago • 5 comments

Describe your changes

This pull request introduce a new feature as a (hopefully ready for integration) proof of concept: a paperclip icon on the textinput field right that opens a file dialog to select a text file. This file will be sent to the LLM along with the message entered into the textinput field.

Issue ticket number and link

#2567

Checklist before requesting a review

  • [x] I have performed a self-review of my code.
  • [ ] If it is a core feature, I have added thorough tests.
  • [ ] I have added thorough documentation for my code.
  • [ ] I have tagged PR with relevant project labels. I acknowledge that a PR without labels may be dismissed.
  • [ ] If this PR addresses a bug, I have provided both a screenshot/video of the original bug and the working solution.

:rocket: This description was created by Ellipsis for commit d3685e798545f774ff60bb77fbf1bae2570ad82c

Summary:

Added a feature to attach a text file when sending a message to the LLM, including UI changes in ChatView.qml and enabling QML file reading in main.cpp.

Key points:

  • Added icons/paperclip.svg to gpt4all-chat/CMakeLists.txt.
  • Enabled QML file reading in main.cpp by setting QML_XHR_ALLOW_FILE_READ.
  • Updated ChatView.qml to include a FileDialog for selecting text files and a MyToolButton for attaching files.
  • Modified ChatView.qml to append file contents to the message text before sending to the LLM.

Generated with :heart: by ellipsis.dev

chrisbarrera avatar Jul 05 '24 18:07 chrisbarrera

Screen capture showing interaction: muted text of the filename following the "You" in the conversation area, and a paperclip icon on the right side of the textinput field. Screenshot 2024-07-06 at 7 06 59 AM

chrisbarrera avatar Jul 06 '24 12:07 chrisbarrera

Hi @chrisbarrera! This is excellent. I have another version of this feature in a private branch that expands on this a bit. I'm going to keep this PR as a draft and merge the two if that is ok? Thanks for doing this!

manyoso avatar Jul 08 '24 15:07 manyoso

Hey @manyoso thanks for the feedback. I am just glad either way that its on the board and y'all will add this as a feature. Feel free to use as little or as much of my implementation as makes sense compared to yours.

chrisbarrera avatar Jul 08 '24 20:07 chrisbarrera

Hey! Today I also wondered why there is no paperclip icon and found this chat. When will it released?

StefanEgle avatar Aug 14 '24 17:08 StefanEgle

Update: this feature is still planned but taking some back seat to the tooling work and RAG improvements. The tooling work in turn is taking a back seat to a prerequisite change to our backend that is going to unlock a lot of other stuff. That should be coming in shortly.

manyoso avatar Sep 20 '24 14:09 manyoso

We now have first instance of this working with excel files and issue opened to add more.

manyoso avatar Oct 23 '24 16:10 manyoso