File size: 537 Bytes
55957bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from dotenv import load_dotenv

# Load .env file if it exists (for local testing)
load_dotenv()

# Get keys from System Environment (for Cloud) OR .env (for Local)
OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY")
BRAVE_API_KEY = os.getenv("BRAVE_API_KEY")

# Check if keys are missing
if not OPENROUTER_API_KEY:
    raise ValueError("⚠️ Error: OPENROUTER_API_KEY not found. Please add it to your Hugging Face Secrets.")

if not BRAVE_API_KEY:
    print("⚠️ Warning: BRAVE_API_KEY not found. Search might not work.")