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

DRAFT: move command list handling to the CommandRegistry #3624

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions autogpt/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The application entry point. Can be invoked by a CLI or any other front end application."""
import json
import logging
import sys
from pathlib import Path
Expand All @@ -18,6 +19,12 @@
from scripts.install_plugin_deps import install_plugin_dependencies


def load_command_list_from_file(file_path: str):
with open(file_path, "r") as file:
command_list = json.load(file)
return command_list


def run_auto_gpt(
continuous: bool,
continuous_limit: int,
Expand Down Expand Up @@ -103,19 +110,12 @@ def run_auto_gpt(

cfg.set_plugins(scan_plugins(cfg, cfg.debug_mode))
# Create a CommandRegistry instance and scan default folder
command_registry = CommandRegistry()
command_registry.import_commands("autogpt.commands.analyze_code")
command_registry.import_commands("autogpt.commands.audio_text")
command_registry.import_commands("autogpt.commands.execute_code")
command_registry.import_commands("autogpt.commands.file_operations")
command_registry.import_commands("autogpt.commands.git_operations")
command_registry.import_commands("autogpt.commands.google_search")
command_registry.import_commands("autogpt.commands.image_gen")
command_registry.import_commands("autogpt.commands.improve_code")
command_registry.import_commands("autogpt.commands.twitter")
command_registry.import_commands("autogpt.commands.web_selenium")
command_registry.import_commands("autogpt.commands.write_tests")
command_registry.import_commands("autogpt.app")
if not cfg.command_list_file:
command_list_file = "command_list.json"
command_list = load_command_list_from_file(command_list_file)
logger.typewriter_log("command_list: ", Fore.GREEN, command_list)
command_registry = CommandRegistry(command_list)
logger.typewriter_log("command_list: ", Fore.GREEN, command_registry)

ai_name = ""
ai_config = construct_main_ai_config()
Expand Down