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.
Refactor/rename agent subpackage to agents (#4961)
James Collinsc9adedf74675
diff --git a/autogpt/agent/__init__.py b/autogpt/agent/__init__.pydeleted file mode 100644index 90d1148c2a..0000000000--- a/autogpt/agent/__init__.py+++ /dev/null@@ -1,3 +0,0 @@-from autogpt.agent.agent import Agent--__all__ = ["Agent"]diff --git a/autogpt/agents/__init__.py b/autogpt/agents/__init__.pynew file mode 100644index 0000000000..a6df24ad71--- /dev/null+++ b/autogpt/agents/__init__.py@@ -0,0 +1,3 @@+from .agent import Agent++__all__ = ["Agent"]diff --git a/autogpt/agent/agent.py b/autogpt/agents/agent.pysimilarity index 100%rename from autogpt/agent/agent.pyrename to autogpt/agents/agent.pydiff --git a/autogpt/commands/decorators.py b/autogpt/commands/decorators.pyindex 3528af04b9..b63c76d535 100644--- a/autogpt/commands/decorators.py+++ b/autogpt/commands/decorators.py@@ -2,7 +2,7 @@ import functoolsfrom pathlib import Pathfrom typing import Callable-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.logs import loggerdiff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.pyindex aad93193e9..2403b2ba5d 100644--- a/autogpt/commands/execute_code.py+++ b/autogpt/commands/execute_code.py@@ -7,7 +7,7 @@ import dockerfrom docker.errors import DockerException, ImageNotFoundfrom docker.models.containers import Container as DockerContainer-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.config import Configfrom autogpt.logs import loggerdiff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.pyindex 0a06da3183..939b7dc181 100644--- a/autogpt/commands/file_operations.py+++ b/autogpt/commands/file_operations.py@@ -8,7 +8,7 @@ import os.pathfrom pathlib import Pathfrom typing import Generator, Literal-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.logs import loggerfrom autogpt.memory.vector import MemoryItem, VectorMemorydiff --git a/autogpt/commands/git_operations.py b/autogpt/commands/git_operations.pyindex 276031f78e..021157fbbd 100644--- a/autogpt/commands/git_operations.py+++ b/autogpt/commands/git_operations.py@@ -2,7 +2,7 @@from git.repo import Repo-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.url_utils.validators import validate_urldiff --git a/autogpt/commands/image_gen.py b/autogpt/commands/image_gen.pyindex b1a89b2890..abae6149e9 100644--- a/autogpt/commands/image_gen.py+++ b/autogpt/commands/image_gen.py@@ -9,7 +9,7 @@ import openaiimport requestsfrom PIL import Image-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.logs import loggerdiff --git a/autogpt/commands/task_statuses.py b/autogpt/commands/task_statuses.pyindex 062ebe3a49..34908928fe 100644--- a/autogpt/commands/task_statuses.py+++ b/autogpt/commands/task_statuses.py@@ -3,7 +3,7 @@ from __future__ import annotationsfrom typing import NoReturn-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.logs import loggerdiff --git a/autogpt/commands/web_search.py b/autogpt/commands/web_search.pyindex d47d680b26..9ea0d20611 100644--- a/autogpt/commands/web_search.py+++ b/autogpt/commands/web_search.py@@ -7,7 +7,7 @@ from itertools import islicefrom duckduckgo_search import DDGS-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandDUCKDUCKGO_MAX_ATTEMPTS = 3diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.pyindex 821957f3e0..948d799e9c 100644--- a/autogpt/commands/web_selenium.py+++ b/autogpt/commands/web_selenium.py@@ -27,7 +27,7 @@ from webdriver_manager.chrome import ChromeDriverManagerfrom webdriver_manager.firefox import GeckoDriverManagerfrom webdriver_manager.microsoft import EdgeChromiumDriverManager as EdgeDriverManager-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.command_decorator import commandfrom autogpt.logs import loggerfrom autogpt.memory.vector import MemoryItem, get_memorydiff --git a/autogpt/llm/chat.py b/autogpt/llm/chat.pyindex 4364cb1d8f..f08fdab4ea 100644--- a/autogpt/llm/chat.py+++ b/autogpt/llm/chat.py@@ -4,7 +4,7 @@ import timefrom typing import TYPE_CHECKINGif TYPE_CHECKING:- from autogpt.agent.agent import Agent+ from autogpt.agents.agent import Agentfrom autogpt.config import Configfrom autogpt.llm.api_manager import ApiManagerdiff --git a/autogpt/main.py b/autogpt/main.pyindex 4ef3fc949a..0da2d193b2 100644--- a/autogpt/main.py+++ b/autogpt/main.py@@ -6,7 +6,7 @@ from typing import Optionalfrom colorama import Fore, Style-from autogpt.agent import Agent+from autogpt.agents import Agentfrom autogpt.config.config import ConfigBuilder, check_openai_api_keyfrom autogpt.configurator import create_configfrom autogpt.logs import loggerdiff --git a/autogpt/memory/message_history.py b/autogpt/memory/message_history.pyindex 30dbbb809e..c718f2edbd 100644--- a/autogpt/memory/message_history.py+++ b/autogpt/memory/message_history.py@@ -6,7 +6,7 @@ from dataclasses import dataclassfrom typing import TYPE_CHECKING, Optionalif TYPE_CHECKING:- from autogpt.agent import Agent+ from autogpt.agents import Agentfrom autogpt.config import Configfrom autogpt.json_utils.utilities import extract_json_from_responsediff --git a/benchmarks.py b/benchmarks.pyindex cb592be8a3..2e143f9d6f 100644--- a/benchmarks.py+++ b/benchmarks.py@@ -1,4 +1,4 @@-from autogpt.agent import Agent+from autogpt.agents import Agentfrom autogpt.config import AIConfig, Config, ConfigBuilderfrom autogpt.main import COMMAND_CATEGORIESfrom autogpt.memory.vector import get_memorydiff --git a/tests/challenges/debug_code/test_debug_code_challenge_a.py b/tests/challenges/debug_code/test_debug_code_challenge_a.pyindex 90a7084dc8..c846f9ce52 100644--- a/tests/challenges/debug_code/test_debug_code_challenge_a.py+++ b/tests/challenges/debug_code/test_debug_code_challenge_a.py@@ -3,7 +3,7 @@ from pathlib import Pathimport pytestfrom pytest_mock import MockerFixture-from autogpt.agent import Agent+from autogpt.agents import Agentfrom autogpt.commands.execute_code import execute_python_filefrom autogpt.workspace import Workspacefrom tests.challenges.challenge_decorator.challenge_decorator import challengediff --git a/tests/conftest.py b/tests/conftest.pyindex 64e8402470..09d358e690 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -6,7 +6,7 @@ import pytestimport yamlfrom pytest_mock import MockerFixture-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.config import AIConfig, Config, ConfigBuilderfrom autogpt.config.ai_config import AIConfigfrom autogpt.llm.api_manager import ApiManagerdiff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.pyindex 664c6cbb46..d3832c27a4 100644--- a/tests/integration/agent_factory.py+++ b/tests/integration/agent_factory.py@@ -1,6 +1,6 @@import pytest-from autogpt.agent import Agent+from autogpt.agents import Agentfrom autogpt.config import AIConfig, Configfrom autogpt.memory.vector import get_memoryfrom autogpt.models.command_registry import CommandRegistrydiff --git a/tests/integration/test_execute_code.py b/tests/integration/test_execute_code.pyindex b7be8622a9..80010c6f2c 100644--- a/tests/integration/test_execute_code.py+++ b/tests/integration/test_execute_code.py@@ -7,7 +7,7 @@ import tempfileimport pytestimport autogpt.commands.execute_code as sut # system under testing-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.config import Configdiff --git a/tests/integration/test_image_gen.py b/tests/integration/test_image_gen.pyindex 8cdcfd9867..0a9f68978a 100644--- a/tests/integration/test_image_gen.py+++ b/tests/integration/test_image_gen.py@@ -6,7 +6,7 @@ from unittest.mock import patchimport pytestfrom PIL import Image-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.commands.image_gen import generate_image, generate_image_with_sd_webuidiff --git a/tests/integration/test_web_selenium.py b/tests/integration/test_web_selenium.pyindex e900b4b3f9..43de2860ee 100644--- a/tests/integration/test_web_selenium.py+++ b/tests/integration/test_web_selenium.py@@ -1,7 +1,7 @@import pytestfrom pytest_mock import MockerFixture-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.commands.web_selenium import browse_websitediff --git a/tests/unit/test_agent.py b/tests/unit/test_agent.pyindex 351454be04..7baeeb64fd 100644--- a/tests/unit/test_agent.py+++ b/tests/unit/test_agent.py@@ -1,4 +1,4 @@-from autogpt.agent.agent import Agent, execute_command+from autogpt.agents.agent import Agent, execute_commanddef test_agent_initialization(agent: Agent):diff --git a/tests/unit/test_file_operations.py b/tests/unit/test_file_operations.pyindex f9c571d8cf..d7d870a592 100644--- a/tests/unit/test_file_operations.py+++ b/tests/unit/test_file_operations.py@@ -12,7 +12,7 @@ import pytestfrom pytest_mock import MockerFixtureimport autogpt.commands.file_operations as file_ops-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.config import Configfrom autogpt.memory.vector.memory_item import MemoryItemfrom autogpt.memory.vector.utils import Embeddingdiff --git a/tests/unit/test_git_commands.py b/tests/unit/test_git_commands.pyindex a6defdfc32..9f56a38409 100644--- a/tests/unit/test_git_commands.py+++ b/tests/unit/test_git_commands.py@@ -2,7 +2,7 @@ import pytestfrom git.exc import GitCommandErrorfrom git.repo.base import Repo-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.commands.git_operations import clone_repositorydiff --git a/tests/unit/test_message_history.py b/tests/unit/test_message_history.pyindex 9b275252c8..ec01cd558f 100644--- a/tests/unit/test_message_history.py+++ b/tests/unit/test_message_history.py@@ -4,7 +4,7 @@ from unittest.mock import MagicMockimport pytest-from autogpt.agent import Agent+from autogpt.agents import Agentfrom autogpt.config import AIConfigfrom autogpt.config.config import Configfrom autogpt.llm.base import ChatModelResponse, ChatSequence, Messagediff --git a/tests/unit/test_web_search.py b/tests/unit/test_web_search.pyindex 4f5143069b..790b1c2f67 100644--- a/tests/unit/test_web_search.py+++ b/tests/unit/test_web_search.py@@ -3,7 +3,7 @@ import jsonimport pytestfrom googleapiclient.errors import HttpError-from autogpt.agent.agent import Agent+from autogpt.agents.agent import Agentfrom autogpt.commands.web_search import google, safe_google_results, web_search