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.

Refactor/rename agent subpackage to agents (#4961)

James Collinsc9adedf74675
diff --git a/autogpt/agent/__init__.py b/autogpt/agent/__init__.py
deleted file mode 100644
index 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__.py
new file mode 100644
index 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.py
similarity index 100%
rename from autogpt/agent/agent.py
rename to autogpt/agents/agent.py
diff --git a/autogpt/commands/decorators.py b/autogpt/commands/decorators.py
index 3528af04b9..b63c76d535 100644
--- a/autogpt/commands/decorators.py
+++ b/autogpt/commands/decorators.py
@@ -2,7 +2,7 @@ import functools
from pathlib import Path
from typing import Callable
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.logs import logger
diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.py
index aad93193e9..2403b2ba5d 100644
--- a/autogpt/commands/execute_code.py
+++ b/autogpt/commands/execute_code.py
@@ -7,7 +7,7 @@ import docker
from docker.errors import DockerException, ImageNotFound
from docker.models.containers import Container as DockerContainer
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.config import Config
from autogpt.logs import logger
diff --git a/autogpt/commands/file_operations.py b/autogpt/commands/file_operations.py
index 0a06da3183..939b7dc181 100644
--- a/autogpt/commands/file_operations.py
+++ b/autogpt/commands/file_operations.py
@@ -8,7 +8,7 @@ import os.path
from pathlib import Path
from typing import Generator, Literal
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.logs import logger
from autogpt.memory.vector import MemoryItem, VectorMemory
diff --git a/autogpt/commands/git_operations.py b/autogpt/commands/git_operations.py
index 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 Agent
from autogpt.command_decorator import command
from autogpt.url_utils.validators import validate_url
diff --git a/autogpt/commands/image_gen.py b/autogpt/commands/image_gen.py
index b1a89b2890..abae6149e9 100644
--- a/autogpt/commands/image_gen.py
+++ b/autogpt/commands/image_gen.py
@@ -9,7 +9,7 @@ import openai
import requests
from PIL import Image
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.logs import logger
diff --git a/autogpt/commands/task_statuses.py b/autogpt/commands/task_statuses.py
index 062ebe3a49..34908928fe 100644
--- a/autogpt/commands/task_statuses.py
+++ b/autogpt/commands/task_statuses.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from typing import NoReturn
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.logs import logger
diff --git a/autogpt/commands/web_search.py b/autogpt/commands/web_search.py
index d47d680b26..9ea0d20611 100644
--- a/autogpt/commands/web_search.py
+++ b/autogpt/commands/web_search.py
@@ -7,7 +7,7 @@ from itertools import islice
from duckduckgo_search import DDGS
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
DUCKDUCKGO_MAX_ATTEMPTS = 3
diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.py
index 821957f3e0..948d799e9c 100644
--- a/autogpt/commands/web_selenium.py
+++ b/autogpt/commands/web_selenium.py
@@ -27,7 +27,7 @@ from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.microsoft import EdgeChromiumDriverManager as EdgeDriverManager
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.command_decorator import command
from autogpt.logs import logger
from autogpt.memory.vector import MemoryItem, get_memory
diff --git a/autogpt/llm/chat.py b/autogpt/llm/chat.py
index 4364cb1d8f..f08fdab4ea 100644
--- a/autogpt/llm/chat.py
+++ b/autogpt/llm/chat.py
@@ -4,7 +4,7 @@ import time
from typing import TYPE_CHECKING
if TYPE_CHECKING:
- from autogpt.agent.agent import Agent
+ from autogpt.agents.agent import Agent
from autogpt.config import Config
from autogpt.llm.api_manager import ApiManager
diff --git a/autogpt/main.py b/autogpt/main.py
index 4ef3fc949a..0da2d193b2 100644
--- a/autogpt/main.py
+++ b/autogpt/main.py
@@ -6,7 +6,7 @@ from typing import Optional
from colorama import Fore, Style
-from autogpt.agent import Agent
+from autogpt.agents import Agent
from autogpt.config.config import ConfigBuilder, check_openai_api_key
from autogpt.configurator import create_config
from autogpt.logs import logger
diff --git a/autogpt/memory/message_history.py b/autogpt/memory/message_history.py
index 30dbbb809e..c718f2edbd 100644
--- a/autogpt/memory/message_history.py
+++ b/autogpt/memory/message_history.py
@@ -6,7 +6,7 @@ from dataclasses import dataclass
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
- from autogpt.agent import Agent
+ from autogpt.agents import Agent
from autogpt.config import Config
from autogpt.json_utils.utilities import extract_json_from_response
diff --git a/benchmarks.py b/benchmarks.py
index cb592be8a3..2e143f9d6f 100644
--- a/benchmarks.py
+++ b/benchmarks.py
@@ -1,4 +1,4 @@
-from autogpt.agent import Agent
+from autogpt.agents import Agent
from autogpt.config import AIConfig, Config, ConfigBuilder
from autogpt.main import COMMAND_CATEGORIES
from autogpt.memory.vector import get_memory
diff --git a/tests/challenges/debug_code/test_debug_code_challenge_a.py b/tests/challenges/debug_code/test_debug_code_challenge_a.py
index 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 Path
import pytest
from pytest_mock import MockerFixture
-from autogpt.agent import Agent
+from autogpt.agents import Agent
from autogpt.commands.execute_code import execute_python_file
from autogpt.workspace import Workspace
from tests.challenges.challenge_decorator.challenge_decorator import challenge
diff --git a/tests/conftest.py b/tests/conftest.py
index 64e8402470..09d358e690 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,7 +6,7 @@ import pytest
import yaml
from pytest_mock import MockerFixture
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.config import AIConfig, Config, ConfigBuilder
from autogpt.config.ai_config import AIConfig
from autogpt.llm.api_manager import ApiManager
diff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.py
index 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 Agent
from autogpt.config import AIConfig, Config
from autogpt.memory.vector import get_memory
from autogpt.models.command_registry import CommandRegistry
diff --git a/tests/integration/test_execute_code.py b/tests/integration/test_execute_code.py
index b7be8622a9..80010c6f2c 100644
--- a/tests/integration/test_execute_code.py
+++ b/tests/integration/test_execute_code.py
@@ -7,7 +7,7 @@ import tempfile
import pytest
import autogpt.commands.execute_code as sut # system under testing
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.config import Config
diff --git a/tests/integration/test_image_gen.py b/tests/integration/test_image_gen.py
index 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 patch
import pytest
from PIL import Image
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.commands.image_gen import generate_image, generate_image_with_sd_webui
diff --git a/tests/integration/test_web_selenium.py b/tests/integration/test_web_selenium.py
index e900b4b3f9..43de2860ee 100644
--- a/tests/integration/test_web_selenium.py
+++ b/tests/integration/test_web_selenium.py
@@ -1,7 +1,7 @@
import pytest
from pytest_mock import MockerFixture
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.commands.web_selenium import browse_website
diff --git a/tests/unit/test_agent.py b/tests/unit/test_agent.py
index 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_command
def test_agent_initialization(agent: Agent):
diff --git a/tests/unit/test_file_operations.py b/tests/unit/test_file_operations.py
index f9c571d8cf..d7d870a592 100644
--- a/tests/unit/test_file_operations.py
+++ b/tests/unit/test_file_operations.py
@@ -12,7 +12,7 @@ import pytest
from pytest_mock import MockerFixture
import autogpt.commands.file_operations as file_ops
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.config import Config
from autogpt.memory.vector.memory_item import MemoryItem
from autogpt.memory.vector.utils import Embedding
diff --git a/tests/unit/test_git_commands.py b/tests/unit/test_git_commands.py
index a6defdfc32..9f56a38409 100644
--- a/tests/unit/test_git_commands.py
+++ b/tests/unit/test_git_commands.py
@@ -2,7 +2,7 @@ import pytest
from git.exc import GitCommandError
from git.repo.base import Repo
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.commands.git_operations import clone_repository
diff --git a/tests/unit/test_message_history.py b/tests/unit/test_message_history.py
index 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 MagicMock
import pytest
-from autogpt.agent import Agent
+from autogpt.agents import Agent
from autogpt.config import AIConfig
from autogpt.config.config import Config
from autogpt.llm.base import ChatModelResponse, ChatSequence, Message
diff --git a/tests/unit/test_web_search.py b/tests/unit/test_web_search.py
index 4f5143069b..790b1c2f67 100644
--- a/tests/unit/test_web_search.py
+++ b/tests/unit/test_web_search.py
@@ -3,7 +3,7 @@ import json
import pytest
from googleapiclient.errors import HttpError
-from autogpt.agent.agent import Agent
+from autogpt.agents.agent import Agent
from autogpt.commands.web_search import google, safe_google_results, web_search