diff --git a/autogpt/app.py b/autogpt/app.py index 7c24f701..cf8e29a3 100644 --- a/autogpt/app.py +++ b/autogpt/app.py @@ -135,7 +135,9 @@ def execute_command( return f"Error: {str(e)}" -@command("get_text_summary", "Get text summary", '"url": "", "question": ""') +@command( + "get_text_summary", "Get text summary", '"url": "", "question": ""' +) def get_text_summary(url: str, question: str) -> str: """Return the results of a Google search diff --git a/autogpt/commands/command.py b/autogpt/commands/command.py index 26fa445b..e97af008 100644 --- a/autogpt/commands/command.py +++ b/autogpt/commands/command.py @@ -20,7 +20,7 @@ class Command: name: str, description: str, method: Callable[..., Any], - signature: str = '', + signature: str = "", enabled: bool = True, disabled_reason: Optional[str] = None, ): @@ -126,7 +126,7 @@ class CommandRegistry: def command( name: str, description: str, - signature: str = '', + signature: str = "", enabled: bool = True, disabled_reason: Optional[str] = None, ) -> Callable[..., Any]: diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py index d8f8e664..b73fb987 100644 --- a/autogpt/commands/file_operations.py +++ b/autogpt/commands/file_operations.py @@ -9,8 +9,8 @@ import requests from colorama import Back, Fore from requests.adapters import HTTPAdapter, Retry -from autogpt.config import Config from autogpt.commands.command import command +from autogpt.config import Config from autogpt.spinner import Spinner from autogpt.utils import readable_file_size from autogpt.workspace import WORKSPACE_PATH, path_in_workspace @@ -163,7 +163,9 @@ def write_to_file(filename: str, text: str) -> str: return f"Error: {str(e)}" -@command("append_to_file", "Append to file", '"filename": "", "text": ""') +@command( + "append_to_file", "Append to file", '"filename": "", "text": ""' +) def append_to_file(filename: str, text: str, shouldLog: bool = True) -> str: """Append text to a file @@ -235,8 +237,13 @@ def search_files(directory: str) -> list[str]: return found_files - -@command("download_file", "Search Files", '"url": "", "filename": ""', CFG.allow_downloads, "Error: You do not have user authorization to download files locally.") +@command( + "download_file", + "Search Files", + '"url": "", "filename": ""', + CFG.allow_downloads, + "Error: You do not have user authorization to download files locally.", +) def download_file(url, filename): """Downloads a file Args: diff --git a/autogpt/config/ai_config.py b/autogpt/config/ai_config.py index 292978a4..1e48ab4d 100644 --- a/autogpt/config/ai_config.py +++ b/autogpt/config/ai_config.py @@ -47,7 +47,6 @@ class AIConfig: self.prompt_generator = None self.command_registry = None - @staticmethod def load(config_file: str = SAVE_FILE) -> "AIConfig": """ diff --git a/autogpt/config/config.py b/autogpt/config/config.py index 1ee8eabf..801df2bb 100644 --- a/autogpt/config/config.py +++ b/autogpt/config/config.py @@ -131,7 +131,7 @@ class Config(metaclass=Singleton): plugins_allowlist = os.getenv("ALLOWLISTED_PLUGINS") if plugins_allowlist: - plugins_allowlist=plugins_allowlist.split(",") + plugins_allowlist = plugins_allowlist.split(",") self.plugins_whitelist = plugins_allowlist else: self.plugins_whitelist = [] diff --git a/autogpt/prompts/prompt.py b/autogpt/prompts/prompt.py index e25ea745..79de04ea 100644 --- a/autogpt/prompts/prompt.py +++ b/autogpt/prompts/prompt.py @@ -71,9 +71,7 @@ def build_default_prompt_generator() -> PromptGenerator: "Every command has a cost, so be smart and efficient. Aim to complete tasks in" " the least number of steps." ) - prompt_generator.add_performance_evaluation( - "Write all code to a file." - ) + prompt_generator.add_performance_evaluation("Write all code to a file.") return prompt_generator