Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add plugins list to aiconfig #4089

Conversation

ppetermann
Copy link
Contributor

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

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • 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.

@vercel
Copy link

vercel bot commented May 10, 2023

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
Copy link

codecov bot commented May 10, 2023

Codecov Report

Patch coverage: 81.81% and project coverage change: +0.11 🎉

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%) ⬆️
autogpt/plugins.py 76.59% <100.00%> (+1.23%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ntindle
Copy link
Member

ntindle commented May 10, 2023

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

AndresCdo and others added 8 commits May 13, 2023 10:47
…gnificant-Gravitas#3870)

* Adds pytest-parallel dependencies

* Implement pytest-parallel for faster tests

* Uses pytest-xdist

* Auto number of workers processes

* Update ci.yml

---------

Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
…tas#4142)

Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
…nificant-Gravitas#3706)

Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
…s#4149)

* parse package versions so upgrades can be forced

* better version from @collijk
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
@ppetermann ppetermann requested a review from a team May 13, 2023 08:53
@github-actions github-actions bot added size/l and removed size/m labels May 13, 2023
@github-actions github-actions bot added size/m and removed size/l labels May 13, 2023
@github-actions github-actions bot added size/l and removed size/m labels May 13, 2023
@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 25, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

bassie661 added a commit to bassie661/Auto-GPT that referenced this pull request May 31, 2023
Added future support for PR: Significant-Gravitas#4089

Only handle plugins: list if 'plugins' attribute exists in the AIConfig class
@Pwuts
Copy link
Member

Pwuts commented Sep 8, 2023

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).

@Pwuts Pwuts closed this Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts function: focus function: plugins size/l
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.