AutoGPT
AutoGPT copied to clipboard
add plugins list to aiconfig
Background
It seems good practice to only load the plugins needed for a given agent - however, the current implementation will always load what's in the plugins folder as long as it's on the allowed list, meaning if you run multiple setups (ai_settings.yml), you end in a situation where you might have more plugins loaded than you actually want.
Changes
the changes introduced in this PR address the "problem" by introducing an optional plugins section in the ai_settings file. If there is any plugin listed (and only then) it will only load plugins that are on the list (while still respecting the settings from the environment, meaning anything not on the allowlist but in ai_settings will not be treated as if it was on the allowlist, and it won't override the denylist either.) If the list is empty, everything else will behave like before.
Example: if you have
plugins/ExamplePlugin1.zip
plugins/ExamplePlugin2.zip
plugins/ExamplePlugin3.zip
and your ai_settings have
ai_name: ExampleGPT
...
plugins:
- AutoGPTExamplePlugin1
- AutoGPTExamplePlugin3
Only ExamplePlugin1 and ExamplePlugin3 will be loaded (if allow/deny lists / user-input permits)
Documentation
- docstrings describing methods have been adjusted to new params
- I have not found any documentation on ai_settings.yml contents to add to, and i didn't want to sneak it in with this PR either
Test Plan
- Tests for previous behavior still work
- Tests for new behavior have been added to
- tests/test_ai_config.py
- tests/unit/test_plugins.py
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
By submitting this, I agree that my pull request should be closed if I do not fill this out or follow the guidelines.
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 13, 2023 9:00am |
Codecov Report
Patch coverage: 81.81% and project coverage change: +0.11 :tada:
Comparison is base (
6c78d80) 60.93% compared to head (4155342) 61.04%.
Additional details and impacted files
@@ Coverage Diff @@
## master #4089 +/- ##
==========================================
+ Coverage 60.93% 61.04% +0.11%
==========================================
Files 73 73
Lines 3315 3322 +7
Branches 543 546 +3
==========================================
+ Hits 2020 2028 +8
Misses 1156 1156
+ Partials 139 138 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| autogpt/main.py | 0.00% <0.00%> (ø) |
|
| autogpt/config/ai_config.py | 80.59% <100.00%> (+1.23%) |
:arrow_up: |
| autogpt/plugins.py | 76.59% <100.00%> (+1.23%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This is a great pr and brings up important concepts and concerns! We have a ReArch in progress that may fix some of this that may interest you in contributing to. Ping me in the discord if you’re interested
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
It seems good practice to only load the plugins needed for a given agent
100% agree! I'll go even further and say this also applies to commands.
Doing it manually per agent isn't going to be manageable at scale though. Especially when taking dynamic tool acquisition (future feature) into consideration, tool selection should be done using AI to make sure agents focus on their task.
You would be welcome to contribute to a routine that filters the list of available commands/tools based on a task description. I'll also add an issue for this to the roadmap or kanban this week(end).