AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Greatly revised file operations and addition (workspace_path, log_path) to .env

Open bfalans opened this issue 1 year ago • 5 comments

Background

Because file operations like read_file had some errors and i needed an update file command i created a revised version of file operations. Addressing multiple issues:

  • 3077
  • 3076
  • 2801
  • 2541 for file operations

does NOT address:

  • 2706
  • 2673

Changes

  • modified read_file to take in both small and large files, tokenize and chunk them and yield the chunk data in a string
  • modified all file operations to better restrict/not restrict to workspace_path
  • created update_file command to update text in a file
  • modified logging to get logs on most operations
  • modified .env.temaplet, workspace.py and config.py to take into account new .env variables WORKSPACE_PATH and LOG_PATH , both of which are needed in the file operations

Documentation

All functions have a doc inside function describing parameters and return values

Test Plan

Only tested on my machine for now, I am not a tester and still gaining knowledge about how to code and test. Any test feedback on the modifications is welcome

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [ ] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [x] I have not snuck in any "extra" small tweaks changes

bfalans avatar Apr 25 '23 23:04 bfalans

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

github-actions[bot] avatar Apr 25 '23 23:04 github-actions[bot]

Codecov Report

Patch coverage has no change and project coverage change: -7.88 :warning:

Comparison is base (749b1bb) 50.73% compared to head (59ae593) 42.86%.

:exclamation: Current head 59ae593 differs from pull request most recent head b69ad3b. Consider uploading reports for the commit b69ad3b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3267      +/-   ##
==========================================
- Coverage   50.73%   42.86%   -7.88%     
==========================================
  Files          65       65              
  Lines        2935     2935              
  Branches      493      493              
==========================================
- Hits         1489     1258     -231     
- Misses       1326     1615     +289     
+ Partials      120       62      -58     

see 15 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Apr 26 '23 13:04 codecov[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2023 2:16pm

vercel[bot] avatar Apr 26 '23 14:04 vercel[bot]

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

github-actions[bot] avatar Apr 26 '23 14:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 26 '23 17:04 github-actions[bot]