parashu17 commited on
Commit
29083b9
·
verified ·
1 Parent(s): b5f9232

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -8,6 +8,18 @@ st.title("RX Pizzeria")
8
  openai.api_key = st.secrets["OPENAI_API_KEY"]
9
  grounding = st.secrets["GROUNDING"]
10
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  image = Image.open('logo.png')
12
 
13
  st.image(image)
 
8
  openai.api_key = st.secrets["OPENAI_API_KEY"]
9
  grounding = st.secrets["GROUNDING"]
10
 
11
+ # NEW:
12
+ import os
13
+ openai.api_key = os.getenv("OPENAI_API_KEY")
14
+ grounding = os.getenv("GROUNDING")
15
+
16
+ if not openai.api_key:
17
+ st.error("OPENAI_API_KEY not found. Add it under Settings → Variables and secrets.")
18
+ st.stop()
19
+ if not grounding:
20
+ st.error("GROUNDING not found. Add it under Settings → Variables and secrets.")
21
+ st.stop()
22
+
23
  image = Image.open('logo.png')
24
 
25
  st.image(image)