Asapyams commited on
Commit
4bcbd19
Β·
verified Β·
1 Parent(s): 3de0945

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -13,6 +13,15 @@ import pandas as pd
13
  from tabulate import tabulate # pragma: no cover – fallback path
14
  import re
15
 
 
 
 
 
 
 
 
 
 
16
  # --- Constants ---
17
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
18
 
 
13
  from tabulate import tabulate # pragma: no cover – fallback path
14
  import re
15
 
16
+ # ─── Set your OpenAI API Key ─────────────────────────────────────────────────
17
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
18
+ if not OPENAI_API_KEY:
19
+ raise RuntimeError(
20
+ "Please set the OPENAI_API_KEY environment variable (e.g. export OPENAI_API_KEY=sk-…)"
21
+ )
22
+ openai.api_key = OPENAI_API_KEY
23
+ # ──────────────────────────────────────────────────────────────────────────────
24
+
25
  # --- Constants ---
26
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
27