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

[Feature]: Support uploading/downloading file through front-end #1379

Open
xingyaoww opened this issue Apr 26, 2024 · 3 comments · May be fixed by #1718
Open

[Feature]: Support uploading/downloading file through front-end #1379

xingyaoww opened this issue Apr 26, 2024 · 3 comments · May be fixed by #1718
Assignees
Labels
enhancement New feature or request severity:low Minor issues, code cleanup, etc
Milestone

Comments

@xingyaoww
Copy link
Collaborator

xingyaoww commented Apr 26, 2024

What problem or use case are you trying to solve?

Support uploading and downloading files through the front end. This will allow the agent to perform data analytics tasks by looking at user-uploaded content (e.g., CSV, excel, or even a zip file, etc.).

Describe the UX of the solution you'd like

  • Support uploading the files to workspace by simply dragging files to the workspace in UI or adding a button for uploading.
  • Support downloading file (not sure what's the best way to do it).
  • Maybe support the ability to move file (but it may confuses the agent)
image

Do you have thoughts on the technical implementation?

Describe alternatives you've considered

Having user directly modify the mounted workspace folder on their disk - this is probably not a good user experience as the user need to switch back-and-forth.

Additional context

@xingyaoww xingyaoww added the enhancement New feature or request label Apr 26, 2024
@amanape
Copy link
Collaborator

amanape commented Apr 26, 2024

For the technical implementation, it may be worth exploring the Clipboard API, FileReader, and drag event listeners as a starting point. It may be as straightforward as extending the backend endpoints to accept filename and content to update workspace.

It is also worth noting that the implementation may also slightly depend on the target platform, which is currently self-hosted. It will require additional considerations if OpenDevin were, for example, accessible online via URL.

@xingyaoww
Copy link
Collaborator Author

xingyaoww commented Apr 26, 2024

Currently, our Sandbox abstraction has a copy_to method (https://github.com/OpenDevin/OpenDevin/blob/main/opendevin/sandbox/sandbox.py#L33), which we could leverage to implement this uploading feature.

We may need to support copying from [inside the container] to the [host] to be able to download from workspace.

If OpenDevin were hosted via URL, as long as the sandbox supports this copy_to method, the whole upload/downloading thing should work out-of-box?

@amanape
Copy link
Collaborator

amanape commented Apr 26, 2024

We may need to support copying from [inside the container] to the [host] to be able to download from workspace.

I was actually referring to extending files.py based on a quick trace from how the current frontend file explorer. But I'm not all too familiar with the backend implementation to know how the agent will be aware of this change, so I may be lacking.

If OpenDevin were hosted via URL, as long as the sandbox supports this copy_to method, the whole upload/downloading thing should work out-of-box?

I meant the actual APIs that would be utilized on the frontend. If I remember correctly, it requires less permissions/effort to copy/paste/drag to an Electron application compared to a Safari browser. But that was a while back.

@xingyaoww xingyaoww changed the title Support uploading/downloading file through front-end [Feature]: Support uploading/downloading file through front-end Apr 26, 2024
@xingyaoww xingyaoww added this to the 2024-05 milestone Apr 26, 2024
@rbren rbren added the severity:low Minor issues, code cleanup, etc label May 2, 2024
@amanape amanape linked a pull request May 11, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request severity:low Minor issues, code cleanup, etc
Projects
Development

Successfully merging a pull request may close this issue.

3 participants