-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
Add makedirs to file operations #3289
Add makedirs to file operations #3289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add tests, take a look in the tests folder to see how it’s done
Added tests |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3289 +/- ##
==========================================
+ Coverage 51.37% 51.42% +0.04%
==========================================
Files 65 65
Lines 3013 3016 +3
Branches 508 507 -1
==========================================
+ Hits 1548 1551 +3
- Misses 1338 1339 +1
+ Partials 127 126 -1
☔ View full report in Codecov by Sentry. |
All feedback from the review has addressed
Background
Many times auto gpt will try to download or append to files in a directory that doesn't exist, this will cause an error that it then tries to correct, sometimes unsuccessfully.
Related issue: #3249
Changes
I added logic to check if the directory exists and if not create it. I used the same code already being used for
write_to_file
and added it to theappend_to_file
anddownload_file
operations.Documentation
No documentation.
Test Plan
I had auto gpt download and append to files.
PR Quality Checklist
I didn't add any tests because I couldn't find out where or how to add them as I found other file operations didn't have tests.