File size: 864 Bytes
56edde7
480f467
56edde7
480f467
 
 
 
 
 
 
 
 
 
 
 
 
56edde7
480f467
56edde7
480f467
 
1915c66
480f467
 
1915c66
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from pydantic_settings import BaseSettings

class Settings(BaseSettings):
    # Groq API Configuration
    groq_api_key: str = os.getenv("GROQ_API_KEY", "")
    groq_model: str = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile")
    
    # API Configuration
    api_title: str = "ICD-CPT Coding API"
    api_version: str = "1.0.0"
    api_description: str = "Medical coding assistant powered by Groq LLaMA 3.3 70B"
    
    class Config:
        env_file = ".env"
        case_sensitive = False

settings = Settings()

# Validate API key on startup
if not settings.groq_api_key:
    print("WARNING: GROQ_API_KEY is not set! API will not function properly.")
    print("Please set GROQ_API_KEY in Hugging Face Space secrets.")
else:
    print(f"Groq API Key loaded (length: {len(settings.groq_api_key)})")
    print(f"Using model: {settings.groq_model}")