AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Feature/add .env fixed ai_name, ai_role and or extra goals

Open bassie661 opened this issue 2 years ago • 4 comments

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

bassie661 avatar May 02 '23 20:05 bassie661

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

vercel[bot] avatar May 02 '23 20:05 vercel[bot]

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

p-i- avatar May 05 '23 00:05 p-i-

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 avatar May 05 '23 18:05 Boostrix

@Boostrix join the discord already lol. Might as well get the contributor badge already!

anonhostpi avatar May 05 '23 18:05 anonhostpi

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.

codecov[bot] avatar May 23 '23 14:05 codecov[bot]

Forgive me for not understanding, but this seems to add complexity and logic by doing two things:

  1. Allowing users to load everything that is in the aiconfig.yaml from the .env
  2. 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.

ntindle avatar May 23 '23 17:05 ntindle

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 ?

bassie661 avatar May 23 '23 19:05 bassie661

Would love a better ai_settings file as well. Tag me on discord so we can have a quick discussion about it!

ntindle avatar May 25 '23 16:05 ntindle

Closed because of new PR with a different approach #4478

bassie661 avatar May 30 '23 16:05 bassie661