forked from DiscursiveNetworks/FOO_QtPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_config_load.py
More file actions
38 lines (31 loc) · 1.1 KB
/
test_config_load.py
File metadata and controls
38 lines (31 loc) · 1.1 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
import json
import os
from dotenv import load_dotenv
# Load environment variables from .env
load_dotenv()
# Path to your JSON config file
config_path = "WA25/config_Guevara_NIH.json"
# Step 1: Load the config file
try:
with open(config_path, "r") as f:
config = json.load(f)
print("✅ Config file loaded successfully.")
except Exception as e:
print("❌ Error loading config file:", e)
exit(1)
# Step 2: Check a few key fields
print("\n📂 CONFIG SUMMARY:")
print(f"Project name: {config['CONFIG'].get('project_name', 'N/A')}")
print(f"Author: {config['CONFIG'].get('author', 'N/A')}")
print(f"CWD: {config['CONFIG'].get('CWD', 'N/A')}")
# Step 3: Check if API keys are set in environment
anthropic_key = os.getenv("ANTHROPIC_API_KEY")
openai_key = os.getenv("OPENAI_API_KEY")
if anthropic_key:
print("\n🔑 Anthropic API key found.")
else:
print("\n⚠️ Anthropic API key not found. Check your .env file or environment variables.")
if openai_key:
print("🔑 OpenAI API key found.")
else:
print("⚠️ OpenAI API key not found. Check your .env file or environment variables.")