Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -111,11 +111,6 @@ st.markdown("""
|
|
111 |
.animated-button:hover {
|
112 |
background-color: #00CC00;
|
113 |
}
|
114 |
-
@keyframes pulse {
|
115 |
-
0% { transform: scale(1); }
|
116 |
-
50% { transform: scale(1.05); }
|
117 |
-
100% { transform: scale(1); }
|
118 |
-
}
|
119 |
.input-container {
|
120 |
margin-bottom: 20px;
|
121 |
}
|
@@ -135,15 +130,15 @@ def clear_chat():
|
|
135 |
st.session_state['real_time_qa_support'] = ""
|
136 |
st.session_state['mental_health_check_in'] = ""
|
137 |
|
138 |
-
# Add Clear Chat button
|
139 |
-
if st.button(
|
140 |
clear_chat()
|
141 |
|
142 |
# Personalized Learning Assistant
|
143 |
st.header("Personalized Learning Assistant")
|
144 |
with st.form(key="learning_form"):
|
145 |
topic_input = st.text_input("Enter a topic you want to learn about", key="topic_input", placeholder="e.g., Quantum Mechanics")
|
146 |
-
submit_button = st.form_submit_button("Generate Learning Material"
|
147 |
if submit_button:
|
148 |
if topic_input:
|
149 |
st.write(personalized_learning_assistant(topic_input))
|
@@ -154,7 +149,7 @@ with st.form(key="learning_form"):
|
|
154 |
st.header("AI Coding Mentor")
|
155 |
with st.form(key="coding_form"):
|
156 |
code_input = st.text_area("Paste your code snippet", key="code_input", placeholder="e.g., for i in range(10): print(i)")
|
157 |
-
submit_button = st.form_submit_button("Get Coding Assistance"
|
158 |
if submit_button:
|
159 |
if code_input:
|
160 |
st.write(ai_coding_mentor(code_input))
|
@@ -165,7 +160,7 @@ with st.form(key="coding_form"):
|
|
165 |
st.header("Smart Document Summarizer")
|
166 |
with st.form(key="summary_form"):
|
167 |
doc_input = st.text_area("Paste the text of the document", key="doc_input", placeholder="e.g., Quantum computing is...")
|
168 |
-
submit_button = st.form_submit_button("Summarize Document"
|
169 |
if submit_button:
|
170 |
if doc_input:
|
171 |
st.write(smart_document_summarizer(doc_input))
|
@@ -176,7 +171,7 @@ with st.form(key="summary_form"):
|
|
176 |
st.header("Interactive Study Planner")
|
177 |
with st.form(key="planner_form"):
|
178 |
schedule_input = st.text_area("Enter your exam schedule", key="schedule_input", placeholder="e.g., 3 exams in 1 week")
|
179 |
-
submit_button = st.form_submit_button("Generate Study Plan"
|
180 |
if submit_button:
|
181 |
if schedule_input:
|
182 |
st.write(interactive_study_planner(schedule_input))
|
@@ -187,7 +182,7 @@ with st.form(key="planner_form"):
|
|
187 |
st.header("Real-Time Q&A Support")
|
188 |
with st.form(key="qa_form"):
|
189 |
question_input = st.text_input("Ask any academic question", key="question_input", placeholder="e.g., What is Newton's second law?")
|
190 |
-
submit_button = st.form_submit_button("Get Answer"
|
191 |
if submit_button:
|
192 |
if question_input:
|
193 |
st.write(real_time_qa_support(question_input))
|
@@ -198,7 +193,7 @@ with st.form(key="qa_form"):
|
|
198 |
st.header("Mental Health Check-In")
|
199 |
with st.form(key="checkin_form"):
|
200 |
feelings_input = st.text_area("How are you feeling?", key="feelings_input", placeholder="e.g., Stressed about exams")
|
201 |
-
submit_button = st.form_submit_button("Check In"
|
202 |
if submit_button:
|
203 |
if feelings_input:
|
204 |
st.write(mental_health_check_in(feelings_input))
|
|
|
111 |
.animated-button:hover {
|
112 |
background-color: #00CC00;
|
113 |
}
|
|
|
|
|
|
|
|
|
|
|
114 |
.input-container {
|
115 |
margin-bottom: 20px;
|
116 |
}
|
|
|
130 |
st.session_state['real_time_qa_support'] = ""
|
131 |
st.session_state['mental_health_check_in'] = ""
|
132 |
|
133 |
+
# Add Clear Chat button using HTML
|
134 |
+
if st.markdown("<button class='animated-button' onclick='window.location.reload()'>Clear All</button>", unsafe_allow_html=True):
|
135 |
clear_chat()
|
136 |
|
137 |
# Personalized Learning Assistant
|
138 |
st.header("Personalized Learning Assistant")
|
139 |
with st.form(key="learning_form"):
|
140 |
topic_input = st.text_input("Enter a topic you want to learn about", key="topic_input", placeholder="e.g., Quantum Mechanics")
|
141 |
+
submit_button = st.form_submit_button("Generate Learning Material")
|
142 |
if submit_button:
|
143 |
if topic_input:
|
144 |
st.write(personalized_learning_assistant(topic_input))
|
|
|
149 |
st.header("AI Coding Mentor")
|
150 |
with st.form(key="coding_form"):
|
151 |
code_input = st.text_area("Paste your code snippet", key="code_input", placeholder="e.g., for i in range(10): print(i)")
|
152 |
+
submit_button = st.form_submit_button("Get Coding Assistance")
|
153 |
if submit_button:
|
154 |
if code_input:
|
155 |
st.write(ai_coding_mentor(code_input))
|
|
|
160 |
st.header("Smart Document Summarizer")
|
161 |
with st.form(key="summary_form"):
|
162 |
doc_input = st.text_area("Paste the text of the document", key="doc_input", placeholder="e.g., Quantum computing is...")
|
163 |
+
submit_button = st.form_submit_button("Summarize Document")
|
164 |
if submit_button:
|
165 |
if doc_input:
|
166 |
st.write(smart_document_summarizer(doc_input))
|
|
|
171 |
st.header("Interactive Study Planner")
|
172 |
with st.form(key="planner_form"):
|
173 |
schedule_input = st.text_area("Enter your exam schedule", key="schedule_input", placeholder="e.g., 3 exams in 1 week")
|
174 |
+
submit_button = st.form_submit_button("Generate Study Plan")
|
175 |
if submit_button:
|
176 |
if schedule_input:
|
177 |
st.write(interactive_study_planner(schedule_input))
|
|
|
182 |
st.header("Real-Time Q&A Support")
|
183 |
with st.form(key="qa_form"):
|
184 |
question_input = st.text_input("Ask any academic question", key="question_input", placeholder="e.g., What is Newton's second law?")
|
185 |
+
submit_button = st.form_submit_button("Get Answer")
|
186 |
if submit_button:
|
187 |
if question_input:
|
188 |
st.write(real_time_qa_support(question_input))
|
|
|
193 |
st.header("Mental Health Check-In")
|
194 |
with st.form(key="checkin_form"):
|
195 |
feelings_input = st.text_area("How are you feeling?", key="feelings_input", placeholder="e.g., Stressed about exams")
|
196 |
+
submit_button = st.form_submit_button("Check In")
|
197 |
if submit_button:
|
198 |
if feelings_input:
|
199 |
st.write(mental_health_check_in(feelings_input))
|