Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

linting

BillSchumacher16f0e22ffa49
diff --git a/autogpt/app.py b/autogpt/app.py
index 7c24f70162..cf8e29a36d 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": "<url>", "question": "<question>"')
+@command(
+ "get_text_summary", "Get text summary", '"url": "<url>", "question": "<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 26fa445bb9..e97af008a4 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 d8f8e66402..b73fb98792 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": "<filename>", "text": "<text>"')
+@command(
+ "append_to_file", "Append to file", '"filename": "<filename>", "text": "<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": "<url>", "filename": "<filename>"', CFG.allow_downloads, "Error: You do not have user authorization to download files locally.")
+@command(
+ "download_file",
+ "Search Files",
+ '"url": "<url>", "filename": "<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 292978a417..1e48ab4db7 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 1ee8eabf68..801df2bb21 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 e25ea7457f..79de04ea8f 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