Spaces:
Sleeping
Sleeping

refactor: improve code readability and structure in OpenAI integration tests and services, update requirements for consistency
f5c3d9c
import os | |
from pydantic_settings import BaseSettings | |
from typing import List | |
from dotenv import load_dotenv | |
load_dotenv() | |
class Settings(BaseSettings): | |
""" | |
Application settings configuration | |
""" | |
PROJECT_NAME: str = "FastAPI Starter Kit" | |
VERSION: str = "1.0.0" | |
API_V1_STR: str = "/api/v1" | |
# CORS settings | |
ALLOWED_HOSTS: List[str] = [ | |
"localhost", | |
"127.0.0.1", | |
"0.0.0.0", | |
"http://localhost:3000", | |
"http://127.0.0.1:3000", | |
"http://localhost:8000", | |
"http://127.0.0.1:8000", | |
] | |
# Database settings | |
DATABASE_URL: str = "sqlite:///./app.db" | |
# Security settings | |
SECRET_KEY: str = "your-secret-key-here-change-in-production" | |
ALGORITHM: str = "HS256" | |
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 | |
# OpenAI settings | |
OPENAI_API_KEY: str = os.getenv("OPENAI_API_KEY", "") | |
class Config: | |
env_file = ".env" | |
case_sensitive = True | |
settings = Settings() | |