Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: upload files or folders to chat from local #162

Closed
wants to merge 1 commit into from

Conversation

muzafferkadir
Copy link

Uploading File Integration for AI Chat Interactions

Features Added

  • Added ability to upload local files directly into the chat interface
  • Added support for uploading entire folders with multiple files
  • Integrated file contents seamlessly into the chat history
  • Real-time parsing and display of uploaded files in the workbench

Technical Implementation

  • Implemented addCustomFile and addCustomFolder functions in Chat.client.tsx
  • Added new UI buttons in EditorPanel.tsx for file and folder uploads
  • Extended workbench store to handle new file operations
  • Files are stored with unique IDs and properly formatted for chat display

UI Changes

  • New "Upload File" button with file upload icon
  • New "Upload Folder" button with folder plus icon
  • Intuitive file selection interface using native file picker

Benefits

  • Enables users to directly manipulate project files through chat interface
  • Streamlines workflow for adding multiple files simultaneously
  • Maintains chat history with uploaded file contents
  • Improves project collaboration capabilities

How to Use

  1. Click "Upload File" to add a single file
  2. Click "Upload Folder" to add multiple files from a directory
  3. Files appear in chat history and workbench for AI interaction
  4. Make changes through chat interface as needed

This PR enhances the project's functionality by allowing seamless integration of local files into the AI chat workflow, making it more powerful and user-friendly.

@muzafferkadir
Copy link
Author

It may be good to add some security measures such as file type restrictions, size limits and node_modules filtering before merging to make it production-ready. It would be good to test thoroughly for potential bugs and edge cases.

@cepicdalim
Copy link

Same #31

@muzafferkadir
Copy link
Author

Same #31

Ah, after the message you sent, I understood that the pr request was about "downloading files locally" and that the pr request would be cancelled. Are you sure that this pr and 31 are the same? I see that they are different in terms of functionality. If we are sure, we can send any pr request, we can add the missing parts, no problem.

@ghost
Copy link

ghost commented Nov 9, 2024

A much needed feature. Looking forward to when this is available. Hopefully, sooner rather than later.

@pjmartorell
Copy link

pjmartorell commented Nov 11, 2024

To avoid passing sensitive data to the LLM it would be better to exclude files and folders defined in the .gitignore (if any)

@lassecapel
Copy link

I think we need a combination of this pr, #31 and #289. Combining those will add functionality:

  • upload for file and folder
  • add the context to the chat
  • some snity checking on files, don't add the world to the context

Copy link

github-actions bot commented Dec 2, 2024

This pull request has been marked as stale due to inactivity. If no further activity occurs, it will be closed in 7 days.

@github-actions github-actions bot added the stale The pull / issue is stale and will be closed soon label Dec 2, 2024
@dustinwloring1988 dustinwloring1988 added the enhancement New feature or request label Dec 2, 2024
@github-actions github-actions bot removed the stale The pull / issue is stale and will be closed soon label Dec 2, 2024
@wonderwhy-er
Copy link
Collaborator

Considering there is now folder import and github public repo import

Does this PR has something that missing there?

@thecodacus thecodacus closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants