init
This commit is contained in:
@@ -1,27 +1,5 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
"""兼容导出:请优先使用 config 包"""
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
from config.settings import Config
|
||||
|
||||
class Config:
|
||||
"""Application configuration"""
|
||||
|
||||
# API Keys
|
||||
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
||||
|
||||
# Model configurations
|
||||
DEFAULT_MODEL = "gpt-4o"
|
||||
|
||||
# Application settings
|
||||
MAX_RETRIES = 3
|
||||
TIMEOUT = 30
|
||||
|
||||
@classmethod
|
||||
def validate_config(cls):
|
||||
"""Validate that required configuration is present"""
|
||||
if not cls.OPENAI_API_KEY:
|
||||
raise ValueError("OPENAI_API_KEY is required. Please set it in your .env file")
|
||||
|
||||
# Validate configuration on import
|
||||
Config.validate_config()
|
||||
__all__ = ["Config"]
|
||||
Reference in New Issue
Block a user