Spaces:
Sleeping
Sleeping
vivek-sps commited on
Commit ·
38d75be
1
Parent(s): e98646b
algo updated 2
Browse files
config.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Configuration file for the AI Resume Search application
|
| 3 |
+
"""
|
| 4 |
+
import os
|
| 5 |
+
from dotenv import load_dotenv
|
| 6 |
+
|
| 7 |
+
# Load environment variables
|
| 8 |
+
load_dotenv()
|
| 9 |
+
|
| 10 |
+
# OpenAI Configuration
|
| 11 |
+
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
| 12 |
+
|
| 13 |
+
# Application Configuration
|
| 14 |
+
DEBUG = os.getenv('DEBUG', 'false').lower() == 'true'
|
| 15 |
+
CACHE_FILE = "embeddings_cache.pkl"
|
| 16 |
+
|
| 17 |
+
# Validation
|
| 18 |
+
def validate_config():
|
| 19 |
+
"""Validate that required configuration is present"""
|
| 20 |
+
if not OPENAI_API_KEY:
|
| 21 |
+
raise ValueError(
|
| 22 |
+
"OPENAI_API_KEY not found in environment variables. "
|
| 23 |
+
"Please set it in your .env file or environment variables. "
|
| 24 |
+
"Get your API key from: https://platform.openai.com/api-keys"
|
| 25 |
+
)
|
| 26 |
+
return True
|