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/move singleton out of config module (#3161)
James Collinsdfcbf6eee64f
diff --git a/.gitignore b/.gitignoreindex 1ac55f6b93..816cdb0c8f 100644--- a/.gitignore+++ b/.gitignore@@ -20,6 +20,7 @@ log-ingestion.txtlogs*.log*.mp3+mem.sqlite3# Byte-compiled / optimized / DLL files__pycache__/diff --git a/autogpt/agent/agent_manager.py b/autogpt/agent/agent_manager.pyindex 9a62ef61ec..257127a303 100644--- a/autogpt/agent/agent_manager.py+++ b/autogpt/agent/agent_manager.py@@ -1,10 +1,11 @@"""Agent manager for managing GPT agents"""from __future__ import annotations-from typing import List, Union+from typing import List-from autogpt.config.config import Config, Singleton+from autogpt.config.config import Configfrom autogpt.llm_utils import create_chat_completion+from autogpt.singleton import Singletonfrom autogpt.types.openai import Messagediff --git a/autogpt/config/__init__.py b/autogpt/config/__init__.pyindex 726b6dcf3d..9bdd98e215 100644--- a/autogpt/config/__init__.py+++ b/autogpt/config/__init__.py@@ -3,12 +3,9 @@ This module contains the configuration classes for AutoGPT."""from autogpt.config.ai_config import AIConfigfrom autogpt.config.config import Config, check_openai_api_key-from autogpt.config.singleton import AbstractSingleton, Singleton__all__ = ["check_openai_api_key",- "AbstractSingleton","AIConfig","Config",- "Singleton",]diff --git a/autogpt/config/config.py b/autogpt/config/config.pyindex 600c31041b..101f2919f3 100644--- a/autogpt/config/config.py+++ b/autogpt/config/config.py@@ -8,7 +8,7 @@ from auto_gpt_plugin_template import AutoGPTPluginTemplatefrom colorama import Forefrom dotenv import load_dotenv-from autogpt.config.singleton import Singleton+from autogpt.singleton import Singletonload_dotenv(verbose=True, override=True)diff --git a/autogpt/logs.py b/autogpt/logs.pyindex 35037404a9..9d66193326 100644--- a/autogpt/logs.py+++ b/autogpt/logs.py@@ -10,7 +10,8 @@ from logging import LogRecordfrom colorama import Fore, Style-from autogpt.config import Config, Singleton+from autogpt.config import Config+from autogpt.singleton import Singletonfrom autogpt.speech import say_textCFG = Config()diff --git a/autogpt/memory/base.py b/autogpt/memory/base.pyindex b625246403..83d807506a 100644--- a/autogpt/memory/base.py+++ b/autogpt/memory/base.py@@ -1,7 +1,8 @@"""Base class for memory providers."""import abc-from autogpt.config import AbstractSingleton, Config+from autogpt.config import Config+from autogpt.singleton import AbstractSingletoncfg = Config()diff --git a/autogpt/config/singleton.py b/autogpt/singleton.pysimilarity index 100%rename from autogpt/config/singleton.pyrename to autogpt/singleton.pydiff --git a/autogpt/speech/base.py b/autogpt/speech/base.pyindex d74fa51be7..7adcc37d54 100644--- a/autogpt/speech/base.py+++ b/autogpt/speech/base.py@@ -2,7 +2,7 @@import abcfrom threading import Lock-from autogpt.config import AbstractSingleton+from autogpt.singleton import AbstractSingletonclass VoiceBase(AbstractSingleton):