vbanwari commited on
Commit
274326e
·
verified ·
1 Parent(s): 56e22cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -453,6 +453,9 @@ def handle_analyze(resume_text: str, job_text: str, provider: str, api_key: str,
453
  def handle_generate(resume_text: str, job_desc: str, provider: str, api_key: str, model_name: str, template_style: str, company: str, position: str):
454
  if not (resume_text and job_desc):
455
  return "❌ Missing resume or job description.", "", "", "N/A", "", []
 
 
 
456
 
457
  if not api_key:
458
  return "❌ API key required.", "", "", "N/A", "", []
 
453
  def handle_generate(resume_text: str, job_desc: str, provider: str, api_key: str, model_name: str, template_style: str, company: str, position: str):
454
  if not (resume_text and job_desc):
455
  return "❌ Missing resume or job description.", "", "", "N/A", "", []
456
+
457
+ # Fallback to environment variable if UI key is empty
458
+ api_key = api_key or os.environ.get("API_KEY", "")
459
 
460
  if not api_key:
461
  return "❌ API key required.", "", "", "N/A", "", []