Refactor/move singleton out of config module (#3161)

This commit is contained in:
James Collins
2023-04-24 15:24:57 -07:00
committed by GitHub
parent 83b91a31bc
commit dfcbf6eee6
8 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View File

@@ -20,6 +20,7 @@ log-ingestion.txt
logs logs
*.log *.log
*.mp3 *.mp3
mem.sqlite3
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/

View File

@@ -1,10 +1,11 @@
"""Agent manager for managing GPT agents""" """Agent manager for managing GPT agents"""
from __future__ import annotations 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 Config
from autogpt.llm_utils import create_chat_completion from autogpt.llm_utils import create_chat_completion
from autogpt.singleton import Singleton
from autogpt.types.openai import Message from autogpt.types.openai import Message

View File

@@ -3,12 +3,9 @@ This module contains the configuration classes for AutoGPT.
""" """
from autogpt.config.ai_config import AIConfig from autogpt.config.ai_config import AIConfig
from autogpt.config.config import Config, check_openai_api_key from autogpt.config.config import Config, check_openai_api_key
from autogpt.config.singleton import AbstractSingleton, Singleton
__all__ = [ __all__ = [
"check_openai_api_key", "check_openai_api_key",
"AbstractSingleton",
"AIConfig", "AIConfig",
"Config", "Config",
"Singleton",
] ]

View File

@@ -8,7 +8,7 @@ from auto_gpt_plugin_template import AutoGPTPluginTemplate
from colorama import Fore from colorama import Fore
from dotenv import load_dotenv from dotenv import load_dotenv
from autogpt.config.singleton import Singleton from autogpt.singleton import Singleton
load_dotenv(verbose=True, override=True) load_dotenv(verbose=True, override=True)

View File

@@ -10,7 +10,8 @@ from logging import LogRecord
from colorama import Fore, Style from colorama import Fore, Style
from autogpt.config import Config, Singleton from autogpt.config import Config
from autogpt.singleton import Singleton
from autogpt.speech import say_text from autogpt.speech import say_text
CFG = Config() CFG = Config()

View File

@@ -1,7 +1,8 @@
"""Base class for memory providers.""" """Base class for memory providers."""
import abc import abc
from autogpt.config import AbstractSingleton, Config from autogpt.config import Config
from autogpt.singleton import AbstractSingleton
cfg = Config() cfg = Config()

View File

@@ -2,7 +2,7 @@
import abc import abc
from threading import Lock from threading import Lock
from autogpt.config import AbstractSingleton from autogpt.singleton import AbstractSingleton
class VoiceBase(AbstractSingleton): class VoiceBase(AbstractSingleton):