Himanshu Gangwar
Fix app initialization and port configuration for HF Spaces
4616482
raw
history blame contribute delete
625 Bytes
import os
from dotenv import load_dotenv
load_dotenv()
class Settings:
PROJECT_NAME: str = "Autonomous Data Analyst Agent"
GROQ_API_KEY: str = os.getenv("GROQ_API_KEY", "")
DATABASE_URL: str = os.getenv("DATABASE_URL", "sqlite:///./test.db")
def validate(self):
"""Validate that required settings are present"""
if not self.GROQ_API_KEY:
print("⚠️ WARNING: GROQ_API_KEY not set. Please add it to Hugging Face Spaces secrets.")
print(" The app will start but queries will fail until the API key is configured.")
settings = Settings()
settings.validate()