Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
wants to merge 5 commits into from

Conversation

chrisbarrera
Copy link
Contributor

@chrisbarrera chrisbarrera commented Jul 5, 2024

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

  • 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.

🚀 This description was created by Ellipsis for commit d3685e7

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 ❤️ by ellipsis.dev

ellipsis-dev[bot]

This comment was marked as spam.

Christopher Barrera added 2 commits July 5, 2024 13:18
Signed-off-by: Christopher Barrera <chrisbarrera@icloud.com>
Signed-off-by: Christopher Barrera <cb@arda.tx.rr.com>
Signed-off-by: Christopher Barrera <chrisbarrera@icloud.com>
Signed-off-by: Christopher Barrera <cb@arda.tx.rr.com>
Christopher Barrera added 2 commits July 5, 2024 16:27
Signed-off-by: Christopher Barrera <cb@arda.tx.rr.com>
Signed-off-by: Christopher Barrera <cb@arda.tx.rr.com>
@chrisbarrera
Copy link
Contributor Author

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

- Changing models should also reset the attached file.
- The "You" text component should only show the filename on the message where it was attached.

Signed-off-by: Christopher Barrera <cb@arda.tx.rr.com>
@manyoso
Copy link
Collaborator

manyoso commented Jul 8, 2024

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 manyoso self-requested a review July 8, 2024 15:11
@manyoso manyoso marked this pull request as draft July 8, 2024 15:11
@chrisbarrera
Copy link
Contributor Author

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.

@StefanEgle
Copy link

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

@manyoso
Copy link
Collaborator

manyoso commented Sep 20, 2024

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
Copy link
Collaborator

manyoso commented Oct 23, 2024

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

@manyoso manyoso closed this Oct 23, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants