Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -156,6 +156,15 @@ selected_tool = st.sidebar.radio(
|
|
| 156 |
# Display tool based on selection
|
| 157 |
st.title("EduNexus :book:")
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
if selected_tool == "Personalized Learning Assistant":
|
| 160 |
st.header("Personalized Learning Assistant")
|
| 161 |
with st.form(key="learning_form"):
|
|
@@ -164,8 +173,8 @@ if selected_tool == "Personalized Learning Assistant":
|
|
| 164 |
if submit_button:
|
| 165 |
explanation = personalized_learning_assistant(topic_input)
|
| 166 |
st.session_state['responses']['personalized_learning_assistant'] = explanation
|
| 167 |
-
|
| 168 |
-
|
| 169 |
|
| 170 |
elif selected_tool == "AI Coding Mentor":
|
| 171 |
st.header("AI Coding Mentor")
|
|
@@ -175,8 +184,8 @@ elif selected_tool == "AI Coding Mentor":
|
|
| 175 |
if submit_button:
|
| 176 |
review = ai_coding_mentor(code_input)
|
| 177 |
st.session_state['responses']['ai_coding_mentor'] = review
|
| 178 |
-
|
| 179 |
-
|
| 180 |
|
| 181 |
elif selected_tool == "Smart Document Summarizer":
|
| 182 |
st.header("Smart Document Summarizer")
|
|
@@ -186,8 +195,8 @@ elif selected_tool == "Smart Document Summarizer":
|
|
| 186 |
if submit_button:
|
| 187 |
summary = smart_document_summarizer(document_input)
|
| 188 |
st.session_state['responses']['smart_document_summarizer'] = summary
|
| 189 |
-
|
| 190 |
-
|
| 191 |
|
| 192 |
elif selected_tool == "Interactive Study Planner":
|
| 193 |
st.header("Interactive Study Planner")
|
|
@@ -197,8 +206,8 @@ elif selected_tool == "Interactive Study Planner":
|
|
| 197 |
if submit_button:
|
| 198 |
plan = interactive_study_planner(exam_schedule_input)
|
| 199 |
st.session_state['responses']['interactive_study_planner'] = plan
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
elif selected_tool == "Real-Time Q&A Support":
|
| 204 |
st.header("Real-Time Q&A Support")
|
|
@@ -208,8 +217,8 @@ elif selected_tool == "Real-Time Q&A Support":
|
|
| 208 |
if submit_button:
|
| 209 |
answer = real_time_qa_support(question_input)
|
| 210 |
st.session_state['responses']['real_time_qa_support'] = answer
|
| 211 |
-
|
| 212 |
-
|
| 213 |
|
| 214 |
elif selected_tool == "Mental Health Check-In":
|
| 215 |
st.header("Mental Health Check-In")
|
|
@@ -219,12 +228,12 @@ elif selected_tool == "Mental Health Check-In":
|
|
| 219 |
if submit_button:
|
| 220 |
advice = mental_health_check_in(feelings_input)
|
| 221 |
st.session_state['responses']['mental_health_check_in'] = advice
|
| 222 |
-
|
| 223 |
-
|
| 224 |
|
| 225 |
# Footer with acknowledgments
|
| 226 |
st.markdown("""
|
| 227 |
-
<footer style="background-color: #1e1e2f; padding:
|
| 228 |
<p>© 2024 EduNexus. All Rights Reserved.</p>
|
| 229 |
<p>Created with ❤️ by [Your Name]</p>
|
| 230 |
<p><a href="mailto:[email protected]" style="color: #ff9a8b;">Contact Us</a></p>
|
|
|
|
| 156 |
# Display tool based on selection
|
| 157 |
st.title("EduNexus :book:")
|
| 158 |
|
| 159 |
+
# Common function to display response and download button
|
| 160 |
+
def display_response(response_key, response):
|
| 161 |
+
st.write(response)
|
| 162 |
+
st.download_button(
|
| 163 |
+
"Download Response",
|
| 164 |
+
response,
|
| 165 |
+
file_name=f"{response_key}.txt"
|
| 166 |
+
)
|
| 167 |
+
|
| 168 |
if selected_tool == "Personalized Learning Assistant":
|
| 169 |
st.header("Personalized Learning Assistant")
|
| 170 |
with st.form(key="learning_form"):
|
|
|
|
| 173 |
if submit_button:
|
| 174 |
explanation = personalized_learning_assistant(topic_input)
|
| 175 |
st.session_state['responses']['personalized_learning_assistant'] = explanation
|
| 176 |
+
if st.session_state['responses']['personalized_learning_assistant']:
|
| 177 |
+
display_response("personalized_learning_assistant", st.session_state['responses']['personalized_learning_assistant'])
|
| 178 |
|
| 179 |
elif selected_tool == "AI Coding Mentor":
|
| 180 |
st.header("AI Coding Mentor")
|
|
|
|
| 184 |
if submit_button:
|
| 185 |
review = ai_coding_mentor(code_input)
|
| 186 |
st.session_state['responses']['ai_coding_mentor'] = review
|
| 187 |
+
if st.session_state['responses']['ai_coding_mentor']:
|
| 188 |
+
display_response("ai_coding_mentor", st.session_state['responses']['ai_coding_mentor'])
|
| 189 |
|
| 190 |
elif selected_tool == "Smart Document Summarizer":
|
| 191 |
st.header("Smart Document Summarizer")
|
|
|
|
| 195 |
if submit_button:
|
| 196 |
summary = smart_document_summarizer(document_input)
|
| 197 |
st.session_state['responses']['smart_document_summarizer'] = summary
|
| 198 |
+
if st.session_state['responses']['smart_document_summarizer']:
|
| 199 |
+
display_response("smart_document_summarizer", st.session_state['responses']['smart_document_summarizer'])
|
| 200 |
|
| 201 |
elif selected_tool == "Interactive Study Planner":
|
| 202 |
st.header("Interactive Study Planner")
|
|
|
|
| 206 |
if submit_button:
|
| 207 |
plan = interactive_study_planner(exam_schedule_input)
|
| 208 |
st.session_state['responses']['interactive_study_planner'] = plan
|
| 209 |
+
if st.session_state['responses']['interactive_study_planner']:
|
| 210 |
+
display_response("interactive_study_planner", st.session_state['responses']['interactive_study_planner'])
|
| 211 |
|
| 212 |
elif selected_tool == "Real-Time Q&A Support":
|
| 213 |
st.header("Real-Time Q&A Support")
|
|
|
|
| 217 |
if submit_button:
|
| 218 |
answer = real_time_qa_support(question_input)
|
| 219 |
st.session_state['responses']['real_time_qa_support'] = answer
|
| 220 |
+
if st.session_state['responses']['real_time_qa_support']:
|
| 221 |
+
display_response("real_time_qa_support", st.session_state['responses']['real_time_qa_support'])
|
| 222 |
|
| 223 |
elif selected_tool == "Mental Health Check-In":
|
| 224 |
st.header("Mental Health Check-In")
|
|
|
|
| 228 |
if submit_button:
|
| 229 |
advice = mental_health_check_in(feelings_input)
|
| 230 |
st.session_state['responses']['mental_health_check_in'] = advice
|
| 231 |
+
if st.session_state['responses']['mental_health_check_in']:
|
| 232 |
+
display_response("mental_health_check_in", st.session_state['responses']['mental_health_check_in'])
|
| 233 |
|
| 234 |
# Footer with acknowledgments
|
| 235 |
st.markdown("""
|
| 236 |
+
<footer style="background-color: #1e1e2f; padding: 5px; text-align: center; color: #ffffff;">
|
| 237 |
<p>© 2024 EduNexus. All Rights Reserved.</p>
|
| 238 |
<p>Created with ❤️ by [Your Name]</p>
|
| 239 |
<p><a href="mailto:[email protected]" style="color: #ff9a8b;">Contact Us</a></p>
|