Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,9 @@ st.title('Google Knowledge Graph Search')
|
|
16 |
# Try to fetch API key from secrets.toml
|
17 |
api_key = st.secrets.get("gkg", {}).get("api_key") if isinstance(st.secrets.get("gkg", {}), dict) else None
|
18 |
|
19 |
-
|
|
|
|
|
20 |
|
21 |
search_query = st.text_input('Enter Search Query:', 'Python Programming')
|
22 |
output_count = st.slider('Number of Results:', min_value=1, max_value=10, value=1)
|
|
|
16 |
# Try to fetch API key from secrets.toml
|
17 |
api_key = st.secrets.get("gkg", {}).get("api_key") if isinstance(st.secrets.get("gkg", {}), dict) else None
|
18 |
|
19 |
+
# If not found, ask for it
|
20 |
+
if not api_key:
|
21 |
+
api_key = st.text_input('Enter your Google API Key:', type="password")
|
22 |
|
23 |
search_query = st.text_input('Enter Search Query:', 'Python Programming')
|
24 |
output_count = st.slider('Number of Results:', min_value=1, max_value=10, value=1)
|