Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,12 @@ st.title("🎶 Mood-Based Indian Song Player")
|
|
8 |
# Sidebar for user input
|
9 |
st.sidebar.header("Enter Your Input")
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# Text input for user's mood and context
|
15 |
user_input = st.text_input("Enter your mood and context:",
|
@@ -88,7 +92,7 @@ if user_input and gemini_api_key:
|
|
88 |
elif not user_input:
|
89 |
st.warning("Please enter your mood and context.")
|
90 |
elif not gemini_api_key:
|
91 |
-
st.warning("
|
92 |
|
93 |
# Display the playlist
|
94 |
st.sidebar.header("Your Playlist")
|
|
|
8 |
# Sidebar for user input
|
9 |
st.sidebar.header("Enter Your Input")
|
10 |
|
11 |
+
# Retrieve Gemini API key from secrets
|
12 |
+
try:
|
13 |
+
gemini_api_key = st.secrets["GEMINI_API_KEY"]
|
14 |
+
except KeyError:
|
15 |
+
st.error("Gemini API key not found in secrets. Please configure it in your Streamlit secrets.")
|
16 |
+
gemini_api_key = None
|
17 |
|
18 |
# Text input for user's mood and context
|
19 |
user_input = st.text_input("Enter your mood and context:",
|
|
|
92 |
elif not user_input:
|
93 |
st.warning("Please enter your mood and context.")
|
94 |
elif not gemini_api_key:
|
95 |
+
st.warning("Unable to retrieve Gemini API key. Please check your Streamlit secrets configuration.")
|
96 |
|
97 |
# Display the playlist
|
98 |
st.sidebar.header("Your Playlist")
|