yonikremer
commited on
Commit
•
6bcf2e3
1
Parent(s):
d029425
improved error-handling
Browse files- prompt_engeneering.py +2 -2
prompt_engeneering.py
CHANGED
@@ -18,7 +18,7 @@ def get_google_api_key():
|
|
18 |
"""Returns the Google API key from streamlit's secrets"""
|
19 |
try:
|
20 |
return secrets["google_search_api_key"]
|
21 |
-
except FileNotFoundError:
|
22 |
return os.environ["google_search_api_key"]
|
23 |
|
24 |
|
@@ -26,7 +26,7 @@ def get_google_cse_id():
|
|
26 |
"""Returns the Google CSE ID from streamlit's secrets"""
|
27 |
try:
|
28 |
return secrets["google_cse_id"]
|
29 |
-
except FileNotFoundError:
|
30 |
return os.environ["google_cse_id"]
|
31 |
|
32 |
|
|
|
18 |
"""Returns the Google API key from streamlit's secrets"""
|
19 |
try:
|
20 |
return secrets["google_search_api_key"]
|
21 |
+
except (FileNotFoundError, IsADirectoryError):
|
22 |
return os.environ["google_search_api_key"]
|
23 |
|
24 |
|
|
|
26 |
"""Returns the Google CSE ID from streamlit's secrets"""
|
27 |
try:
|
28 |
return secrets["google_cse_id"]
|
29 |
+
except (FileNotFoundError, IsADirectoryError):
|
30 |
return os.environ["google_cse_id"]
|
31 |
|
32 |
|