File size: 758 Bytes
1441b40
 
 
 
 
 
 
 
c481ed9
 
 
 
1441b40
c481ed9
 
 
 
 
 
 
 
1441b40
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv()

class Settings:
    def __init__(self):
        self.GROQ_API_KEY = os.getenv("GROQ_API_KEY")
        self.MODEL_ID = os.getenv("MODEL_ID", "llama-3.3-70b-versatile")
        
        # Validate required environment variables
        if not self.GROQ_API_KEY:
            raise ValueError(
                "GROQ_API_KEY not found in environment variables. "
                "Please set it in Hugging Face Space Settings -> Repository secrets"
            )
        
        print(f"✅ Settings loaded successfully")
        print(f"✅ Model ID: {self.MODEL_ID}")
        print(f"✅ API Key configured: {self.GROQ_API_KEY[:10]}...")

settings = Settings()