File size: 741 Bytes
bb0c63f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d16f09
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Configuration for the Enterprise AI Gateway
"""

import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# --- Configuration ---
SERVICE_API_KEY = os.getenv("SERVICE_API_KEY")
RATE_LIMIT = os.getenv("RATE_LIMIT", "10/minute")
ALLOWED_ORIGINS = os.getenv("ALLOWED_ORIGINS", "*").split(",")
ENABLE_PROMPT_INJECTION_CHECK = os.getenv("ENABLE_PROMPT_INJECTION_CHECK", "true").lower() == "true"

# --- Toxicity Thresholds (Approach B) ---
# Lower threshold = more sensitive (blocks more content)
# Default 0.5 for hate speech (more sensitive than general 0.7)
TOXICITY_THRESHOLD_DEFAULT = float(os.getenv("TOXICITY_THRESHOLD", "0.7"))
TOXICITY_THRESHOLD_HATE = float(os.getenv("TOXICITY_THRESHOLD_HATE", "0.5"))