AutoGPT
AutoGPT copied to clipboard
Clean config
Background
In version 0.3 some changes to the config of the commands were done and disabled commands were added to the .env file. This creates a situation the configuration is spread around many locations with no consistency. Moreover, the implementation of disabled commands in the env s is a bit problematic since it is a list that is separated by a comma. Regardless of the edge cases (empty list or list with one item that does not include a comma)
This PR sets the foundation for more consistent configuration. The idea is you have the hierarchy
- default values in the code
- yaml configuration file
- .env file
- env variables
- command line arguments
so I added commands and disabled commands to a configuration yaml and overwritten by the .env and env variables + tests.
Changes
- added a comment to the env file for the yaml configuration file
- added to CommandRegistry method to deal with a list (instead of doing a list to call one insert command)
- add code to read config from the yaml and to overwrite with the env variables (yaml keys are lowercase while env var are uppercase)
- added handling in edge cases
- added load_dotenv for loading the env file
- added tests
Documentation
Test Plan
Since it is refactoring part of the work is to make regression work and I added test
PR Quality Checklist
- [] My pull request is atomic and focuses on a single charge.
- [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.
- [ ] I have not snuck in any "extra" small tweaks changes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docs | ⬜️ Ignored (Inspect) | May 4, 2023 3:44pm |
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
This is a mass message from the AutoGPT core team. Our apologies for the ongoing delay in processing PRs. This is because we are re-architecting the AutoGPT core!
For more details (and for infor on joining our Discord), please refer to: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting
As mentioned elsewhere, I would also suggest to introduce version fields for these config files, so that these can be easily migrated if/when the need arises, including changes breaking backward compatibility (#3678 ).
good idea, will add this field. I will look at the structure of the k8 yaml files to see what idea can apply here
On Fri, May 5, 2023 at 12:21 PM Boostrix @.***> wrote:
As mentioned elsewhere, I would also suggest to introduce version fields for these config files, so that these can be easily migrated if/when the need arises, including changes breaking backward compatibility (#3678 https://github.com/Significant-Gravitas/Auto-GPT/issues/3678 ).
— Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/pull/3794#issuecomment-1535975804, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSAFJPCT2JKYNGFMBIZU4LXETBDJANCNFSM6AAAAAAXV7KAXY . You are receiving this because you authored the thread.Message ID: @.***>
it also seems there are currently some other env/yaml related PRs in process - maybe you could reach out to those folks so that these could integrate their changes with your branch - to hopefully reduce the amount of work for the devs to get this reviewed/integrated, given the ongoing re-arch effort mentioned above.
- #289
- #3720
- #3572
- #3603
given the manpower constraints mentioned above, it might be best if the people working on related/overlapping functionality could team up together and mutually review their changes and then get those integrated into common branch (using 3 distinct commits), but rebase onto the master branch - so that the devs have less work to do ?
What do you think ?
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.