AutoGPT
AutoGPT copied to clipboard
Feature/add .env fixed ai_name, ai_role and or extra goals
To be able to set a fixed ai_name, ai_role and the option to have goals set fixed, that will either be prepended to the yaml goals, or appended to the yaml goals, or will overrule the yaml configured goals.
Background
The option to be able to choose the way of setting the ai_name, role and or goals through either the env variables or through the terminal has it's benefits. Especially when testing a lot, I found that setting the goals fixed in the .env file has pro's as I am 100% sure they are set according to plan. The ability to either prepend or append them and the overrule the ai_sttings.yaml for the goals are also included.
Changes
The ability to either prepend or append GOALS and to overrule the ai_settings.yaml are included in this change.
Documentation
In-code comments are at the "load" function in ai_config.py and documentation with the settings in the .env.template file.
Test Plan
I tested this by adding goals, ai_name and role in the env file and launch auto-GPT, it either prepends/appends the goals and respects the goals from the ai_settings.yaml file. Or when ENV_GOALS_ONLY=True it ignores the goals from the ai_settings.yaml and only uses the goals as set in the .env file.
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
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 | May 28, 2023 0:24am |
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
Overall, this looks like useful change that might be a potential candidate PR to be reviewed prior to/during the ongoing re-arch effort, however it seems that its lacking test coverage ? If that's indeed the case, you might want to see if you can get unit tests to demonstrate that the existing behavior isn't modified by your changes, since these are mostly config changes and very little code.
@Boostrix join the discord already lol. Might as well get the contributor badge already!
Codecov Report
Patch coverage: 81.81% and project coverage change: +0.01 :tada:
Comparison is base (
44f6d94) 67.74% compared to head (3349e21) 67.75%.
Additional details and impacted files
@@ Coverage Diff @@
## master #3711 +/- ##
==========================================
+ Coverage 67.74% 67.75% +0.01%
==========================================
Files 72 72
Lines 3537 3545 +8
Branches 560 563 +3
==========================================
+ Hits 2396 2402 +6
- Misses 956 957 +1
- Partials 185 186 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| autogpt/config/ai_config.py | 78.08% <81.81%> (-0.38%) |
:arrow_down: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Forgive me for not understanding, but this seems to add complexity and logic by doing two things:
- Allowing users to load everything that is in the aiconfig.yaml from the .env
- Adds the ability to do pre and post-goals, which are not treated any different than typical goals other than that you can't add in the config file.
I'm not really seeing a use case here that isn't supported by swapping out the aiconfig file.
No problem at all, the thing here was, first of all it was a month ago that I added this PR and I know more about auto-GPT now and how it works, so that's why I was asking for someone to look at it in discord.
That said I came up with this because I found myself pulling new master's multiple times a day to test different scenarios. So at one point I found it was much easier to have the goals set in the .env file and just copy that over, it was quicker and more convenient to have it stored in a single place and comment out or change goals, instead of having to copy paste different ai_settings.yaml files.
Also the .env will never be overwritten by the system if you mistakenly choose no at the beginning of the session, so to me it's a more robust feeling.
But I totally understand where you are pointing at. I know I could just swap out ai_settings files and maybe it's better to close this PR and first get into discord to discuss the pro's and con's of a new idea like this before I create a PR like this.
It would be nice to have a more robust ai_settings file that allows:
- to set multiple scenario's (especially for testing)
- the ability to set these scenario's as permanent so they won't get overwritten.
- the ability to have auto-GPT walk through multiple scenario's with their resp. role and goals.
- more uniformity (there is difference between for instance how the prompts are stored in a yaml that has array's and goals are seperated by dashes).
- maybe to have a header in the yaml settings file with some
I think it's better to close this PR and go back to discord to discuss the topic to come up with a better solution., right ?
Would love a better ai_settings file as well. Tag me on discord so we can have a quick discussion about it!
Closed because of new PR with a different approach #4478