Spaces:
Sleeping
Sleeping
Update chatbot_ui.py
Browse files2 unmodified lines345678910111213142 unmodified lines17181920212223242511 unmodified lines373839402 unmodified lines# Chatbot response functiondef chatbot_response(user_input):user_input = user_input.strip().lower()# Handle time management and study tipsif "time management" in user_input:return "Time management is key! Try creating a prioritized to-do list and setting specific study blocks."elif "study tips" in user_input:tips = ["Take regular breaks while studying to stay focused.",2 unmodified lines]return random.choice(tips)elif "hello" in user_input or "hi" in user_input:return "Hello! How can I assist you with your studies today?"else:return "I'm here to assist with general academic questions. Feel free to ask about study tips, time management, or anything else!"11 unmodified lines# Launch the Gradio appdemo.launch()2 unmodified lines345678910111213141516171819202 unmodified lines2324252627282911 unmodified lines4142432 unmodified lines# Chatbot response functiondef chatbot_response(user_input):# Ensure the input is in lowercase and stripped of extra spacesuser_input = user_input.strip().lower()# Define responses for specific queriesif "hello" in user_input or "hi" in user_input:return "Hello! How can I help you with your studies today?"# Handle time management queryelif "time management" in user_input:return "Time management is key! Try creating a prioritized to-do list and setting specific study blocks."# Handle study tips queryelif "study tips" in user_input:tips = ["Take regular breaks while studying to stay focused.",2 unmodified lines]return random.choice(tips)# If input doesn't match predefined querieselse:return "I'm here to assist with general academic questions. Feel free to ask about study tips, time management, or anything else!"11 unmodified lines# Launch the Gradio appdemo.launch()
chatbot_ui.py+9-6