AutoGPT
AutoGPT copied to clipboard
Add tests for json_utils.json_fix_llm
Background
I get the following error a lot. Before debugging and refactoring, let's add relevant simple unit-tests.
Error: The following AI output couldn't be converted to a JSON:
Changes
Added tests for json_utils.json_fix_llm::fix_json_using_multiple_techniques()
Documentation
Test Plan
Add tests, they pass
PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] 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
Run the linter please
Also let’s add some more realistic test cases for the content we expect to see
Not sure why this needs the api key. Will look a bit later today when I’m at my laptop
Codecov Report
Patch coverage has no change and project coverage change: -8.16 :warning:
Comparison is base (
d6ef9d1) 46.75% compared to head (7051cd2) 38.59%.
Additional details and impacted files
@@ Coverage Diff @@
## master #2952 +/- ##
==========================================
- Coverage 46.75% 38.59% -8.16%
==========================================
Files 63 63
Lines 3016 3016
Branches 496 496
==========================================
- Hits 1410 1164 -246
- Misses 1493 1786 +293
+ Partials 113 66 -47
see 16 files with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Also let’s add some more realistic test cases for the content we expect to see
I intentionally wanted to keep it very simple, to start lean. And as you can see, we already find interesting behavior, that required using mocks
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.
Two unit-tests failures seems unrelated to the PR