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

Implement directory-based plugin system #4548

Merged
merged 5 commits into from Jun 10, 2023

Conversation

erik-megarad
Copy link
Contributor

Background

When developing and using plugins it is onerous to download a zip file manually and to download a new zip file each time the source changes. It also makes it difficult to inspect and make changes to plugins if they're not working right (e.g. the recent change to AutoGPTPluginTemplate which broke all plugins).

A solution which seems straightforward is to allow directories in the plugins directory. Each directory can be either a normal directory or, importantly, a cloned github repo. This makes it easier for 3rd party plugins to be used without being part of the official plugin repository.

It also includes changes to plugin dependencies in that now each plugin has the ability to have its own requirements.txt file. Now, all plugins don't need to share the same dependency list, and you only install dependencies of plugins you actually will use. This was necessary to support directory plugins as their requirements couldn't be installed otherwise.

Changes

  • Add directory-based plugin support when loading plugins
  • Add directory-based plugin support when installing plugin dependencies
  • Necessary test changes to accommodate

Documentation

  • A little bit of inline comments, but significant documentation changes would need to be made to the plugins repo documentation if/when this is merged. I can take care of that.

Test Plan

  • Created my own plugin and tested it in a directory
  • Split out plugins that I want from the main plugins repo and using them as directories
  • Adding a directory-based plugin into the unit tests

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.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports autogpt tests --in-place

@vercel
Copy link

vercel bot commented Jun 2, 2023

Deployment failed with the following error:

Resource is limited - try again in 5 minutes (more than 100, code: "api-deployments-free-per-day").

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

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

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: +0.05 🎉

Comparison is base (6ff8478) 68.81% compared to head (d8bdf17) 68.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4548      +/-   ##
==========================================
+ Coverage   68.81%   68.87%   +0.05%     
==========================================
  Files          72       72              
  Lines        3585     3598      +13     
  Branches      574      578       +4     
==========================================
+ Hits         2467     2478      +11     
- Misses        927      928       +1     
- Partials      191      192       +1     
Impacted Files Coverage Δ
autogpt/plugins.py 76.15% <84.61%> (+0.79%) ⬆️

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

@vercel
Copy link

vercel bot commented Jun 2, 2023

Deployment failed with the following error:

Resource is limited - try again in 4 minutes (more than 100, code: "api-deployments-free-per-day").

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

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

@reconsumeralization
Copy link

Check it on another cloned repo first?

@erik-megarad
Copy link
Contributor Author

Check it on another cloned repo first?

Yep it works

@vercel
Copy link

vercel bot commented Jun 3, 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) Visit Preview Jun 10, 2023 7:54pm

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

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

@github-actions github-actions bot added size/l and removed size/xl labels Jun 4, 2023
@erik-megarad erik-megarad force-pushed the fix/directory branch 2 times, most recently from 27b2540 to a93a5d6 Compare June 4, 2023 17:08
@github-actions github-actions bot added size/m and removed size/l labels Jun 4, 2023
@erik-megarad erik-megarad force-pushed the fix/directory branch 2 times, most recently from eb01d82 to a1fce9f Compare June 4, 2023 17:41
@github-actions github-actions bot added size/xl and removed size/m labels Jun 4, 2023
@github-actions
Copy link

github-actions bot commented Jun 4, 2023

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

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

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

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

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

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

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

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

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

ntindle
ntindle previously approved these changes Jun 10, 2023
tests/integration/test_plugins.py Show resolved Hide resolved
@ntindle ntindle added this to the v0.4.1 Release milestone Jun 10, 2023
@vercel vercel bot temporarily deployed to Preview June 10, 2023 03:32 Inactive
@waynehamadi waynehamadi merged commit 15c6b0c into Significant-Gravitas:master Jun 10, 2023
13 checks passed
@Anhmarukita123
Copy link

I have successfully installed auto GPT and shutdown, now I want to use Auto GPT, what should I do? Please show me how to use Auto GPT

@lc0rp
Copy link
Contributor

lc0rp commented Jul 17, 2023

I have successfully installed auto GPT and shutdown, now I want to use Auto GPT, what should I do? Please show me how to use Auto GPT

Wrong place to post this. Please refer to https://github.com/Significant-Gravitas/Auto-GPT/tree/release-v0.4.5#quickstart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants