diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000..17eab482 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,10 @@ +[settings] +profile = black +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true +line_length = 88 +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +skip = .tox,__pycache__,*.pyc,venv*/*,reports,venv,env,node_modules,.env,.venv,dist diff --git a/autogpt/agent/agent.py b/autogpt/agent/agent.py index 6f1e15be..c0bb8d5b 100644 --- a/autogpt/agent/agent.py +++ b/autogpt/agent/agent.py @@ -3,8 +3,7 @@ from colorama import Fore, Style from autogpt.app import execute_command, get_command from autogpt.chat import chat_with_ai, create_chat_message from autogpt.config import Config -from autogpt.json_fixes.master_json_fix_method import \ - fix_json_using_multiple_techniques +from autogpt.json_fixes.master_json_fix_method import fix_json_using_multiple_techniques from autogpt.json_validation.validate_json import validate_json from autogpt.logs import logger, print_assistant_thoughts from autogpt.speech import say_text diff --git a/autogpt/app.py b/autogpt/app.py index 10eb98bb..03e2320c 100644 --- a/autogpt/app.py +++ b/autogpt/app.py @@ -6,14 +6,21 @@ from autogpt.agent.agent_manager import AgentManager from autogpt.commands.audio_text import read_audio_from_file from autogpt.commands.command import CommandRegistry, command from autogpt.commands.evaluate_code import evaluate_code -from autogpt.commands.execute_code import (execute_python_file, execute_shell, - execute_shell_popen) -from autogpt.commands.file_operations import (append_to_file, delete_file, - download_file, read_file, - search_files, write_to_file) +from autogpt.commands.execute_code import ( + execute_python_file, + execute_shell, + execute_shell_popen, +) +from autogpt.commands.file_operations import ( + append_to_file, + delete_file, + download_file, + read_file, + search_files, + write_to_file, +) from autogpt.commands.git_operations import clone_repository -from autogpt.commands.google_search import (google_official_search, - google_search) +from autogpt.commands.google_search import google_official_search, google_search from autogpt.commands.image_gen import generate_image from autogpt.commands.improve_code import improve_code from autogpt.commands.twitter import send_tweet diff --git a/autogpt/json_fixes/master_json_fix_method.py b/autogpt/json_fixes/master_json_fix_method.py index 991a95f2..a77bf670 100644 --- a/autogpt/json_fixes/master_json_fix_method.py +++ b/autogpt/json_fixes/master_json_fix_method.py @@ -9,7 +9,9 @@ CFG = Config() def fix_json_using_multiple_techniques(assistant_reply: str) -> Dict[Any, Any]: from autogpt.json_fixes.parsing import ( - attempt_to_fix_json_by_finding_outermost_brackets, fix_and_parse_json) + attempt_to_fix_json_by_finding_outermost_brackets, + fix_and_parse_json, + ) # Parse and print Assistant response assistant_reply_json = fix_and_parse_json(assistant_reply) diff --git a/autogpt/logs.py b/autogpt/logs.py index 4ae33432..df3487f2 100644 --- a/autogpt/logs.py +++ b/autogpt/logs.py @@ -204,8 +204,9 @@ logger = Logger() def print_assistant_thoughts(ai_name, assistant_reply): """Prints the assistant's thoughts to the console""" - from autogpt.json_fixes.bracket_termination import \ - attempt_to_fix_json_by_finding_outermost_brackets + from autogpt.json_fixes.bracket_termination import ( + attempt_to_fix_json_by_finding_outermost_brackets, + ) from autogpt.json_fixes.parsing import fix_and_parse_json try: diff --git a/autogpt/memory/milvus.py b/autogpt/memory/milvus.py index e2b8fea8..44aa72b9 100644 --- a/autogpt/memory/milvus.py +++ b/autogpt/memory/milvus.py @@ -1,6 +1,5 @@ """ Milvus memory storage provider.""" -from pymilvus import (Collection, CollectionSchema, DataType, FieldSchema, - connections) +from pymilvus import Collection, CollectionSchema, DataType, FieldSchema, connections from autogpt.memory.base import MemoryProviderSingleton, get_ada_embedding diff --git a/tests/unit/models/test_base_open_api_plugin.py b/tests/unit/models/test_base_open_api_plugin.py index 8f49c295..227ed7cf 100644 --- a/tests/unit/models/test_base_open_api_plugin.py +++ b/tests/unit/models/test_base_open_api_plugin.py @@ -2,8 +2,11 @@ from typing import Any, Dict, List, Optional, Tuple import pytest -from autogpt.models.base_open_ai_plugin import (BaseOpenAIPlugin, Message, - PromptGenerator) +from autogpt.models.base_open_ai_plugin import ( + BaseOpenAIPlugin, + Message, + PromptGenerator, +) class DummyPlugin(BaseOpenAIPlugin): diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py index 83656da2..8e673bd5 100644 --- a/tests/unit/test_plugins.py +++ b/tests/unit/test_plugins.py @@ -1,8 +1,11 @@ import pytest from autogpt.config import Config -from autogpt.plugins import (blacklist_whitelist_check, inspect_zip_for_module, - scan_plugins) +from autogpt.plugins import ( + blacklist_whitelist_check, + inspect_zip_for_module, + scan_plugins, +) PLUGINS_TEST_DIR = "tests/unit/data/test_plugins" PLUGIN_TEST_ZIP_FILE = "Auto-GPT-Plugin-Test-master.zip"