mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-20 15:34:23 +01:00
Re-add install-plugin-deps to CLI (#3170)
This commit is contained in:
@@ -55,6 +55,11 @@ import click
|
|||||||
type=click.Path(),
|
type=click.Path(),
|
||||||
hidden=True,
|
hidden=True,
|
||||||
)
|
)
|
||||||
|
@click.option(
|
||||||
|
"--install-plugin-deps",
|
||||||
|
is_flag=True,
|
||||||
|
help="Installs external dependencies for 3rd party plugins.",
|
||||||
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def main(
|
def main(
|
||||||
ctx: click.Context,
|
ctx: click.Context,
|
||||||
@@ -71,6 +76,7 @@ def main(
|
|||||||
allow_downloads: bool,
|
allow_downloads: bool,
|
||||||
skip_news: bool,
|
skip_news: bool,
|
||||||
workspace_directory: str,
|
workspace_directory: str,
|
||||||
|
install_plugin_deps: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Welcome to AutoGPT an experimental open-source application showcasing the capabilities of the GPT-4 pushing the boundaries of AI.
|
Welcome to AutoGPT an experimental open-source application showcasing the capabilities of the GPT-4 pushing the boundaries of AI.
|
||||||
@@ -95,6 +101,7 @@ def main(
|
|||||||
allow_downloads,
|
allow_downloads,
|
||||||
skip_news,
|
skip_news,
|
||||||
workspace_directory,
|
workspace_directory,
|
||||||
|
install_plugin_deps,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from autogpt.plugins import scan_plugins
|
|||||||
from autogpt.prompts.prompt import construct_main_ai_config
|
from autogpt.prompts.prompt import construct_main_ai_config
|
||||||
from autogpt.utils import get_current_git_branch, get_latest_bulletin
|
from autogpt.utils import get_current_git_branch, get_latest_bulletin
|
||||||
from autogpt.workspace import Workspace
|
from autogpt.workspace import Workspace
|
||||||
|
from scripts.install_plugin_deps import install_plugin_dependencies
|
||||||
|
|
||||||
|
|
||||||
def run_auto_gpt(
|
def run_auto_gpt(
|
||||||
@@ -31,6 +32,7 @@ def run_auto_gpt(
|
|||||||
allow_downloads: bool,
|
allow_downloads: bool,
|
||||||
skip_news: bool,
|
skip_news: bool,
|
||||||
workspace_directory: str,
|
workspace_directory: str,
|
||||||
|
install_plugin_deps: bool,
|
||||||
):
|
):
|
||||||
cfg = Config()
|
cfg = Config()
|
||||||
# TODO: fill in llm values here
|
# TODO: fill in llm values here
|
||||||
@@ -72,6 +74,9 @@ def run_auto_gpt(
|
|||||||
"Please consider upgrading to Python 3.10 or higher.",
|
"Please consider upgrading to Python 3.10 or higher.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if install_plugin_deps:
|
||||||
|
install_plugin_dependencies()
|
||||||
|
|
||||||
# TODO: have this directory live outside the repository (e.g. in a user's
|
# TODO: have this directory live outside the repository (e.g. in a user's
|
||||||
# home directory) and have it come in as a command line argument or part of
|
# home directory) and have it come in as a command line argument or part of
|
||||||
# the env file.
|
# the env file.
|
||||||
|
|||||||
@@ -5,8 +5,16 @@ import zipfile
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def install_plugin_dependencies():
|
||||||
# Plugin packages
|
"""
|
||||||
|
Installs dependencies for all plugins in the plugins dir.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
None
|
||||||
|
"""
|
||||||
plugins_dir = Path(os.getenv("PLUGINS_DIR", "plugins"))
|
plugins_dir = Path(os.getenv("PLUGINS_DIR", "plugins"))
|
||||||
for plugin in plugins_dir.glob("*.zip"):
|
for plugin in plugins_dir.glob("*.zip"):
|
||||||
with zipfile.ZipFile(str(plugin), "r") as zfile:
|
with zipfile.ZipFile(str(plugin), "r") as zfile:
|
||||||
@@ -24,4 +32,4 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
install_plugin_dependencies()
|
||||||
|
|||||||
Reference in New Issue
Block a user