Skip to content

Commit c27da16

Browse files
committed
Add API key debugging to check environment variable loading
1 parent dde76c3 commit c27da16

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

api/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@
6868
# Initialize components
6969
intent_parser = IntentParser()
7070
source_selector = SourceSelector()
71+
72+
# Debug API key status
73+
if GOV_API_KEY:
74+
logger.info(f"API key loaded: {GOV_API_KEY[:10]}...{GOV_API_KEY[-4:] if len(GOV_API_KEY) > 14 else 'short'}")
75+
else:
76+
logger.warning("No GOV_API_KEY found in environment variables")
77+
7178
query_planner = LiveQueryPlanner(DB_PATH, GOV_API_KEY) # Use live query planner
7279
answer_synthesizer = AnswerSynthesizer()
7380

@@ -255,6 +262,7 @@ async def health_check():
255262
"version": "3.0.0",
256263
"environment": ENVIRONMENT,
257264
"database": db_status,
265+
"api_key_status": "configured" if GOV_API_KEY else "missing",
258266
"uptime_seconds": time.time() - start_time
259267
}
260268

0 commit comments

Comments
 (0)