import gradio as gr from backend.core.chatbot import chatbot , reset_chatbot def launch_ui(): with gr.Blocks(title="🧠 ThesisMate") as demo: gr.Markdown("# 🧠 ThesisMate") gr.Markdown("""### **ThesisMate** is an AI-powered assistant that helps you brainstorm dissertation topics. After asking you a few key questions about your interests, field of study, and goals, ### it suggests **three tailored dissertation topics** to get your research started on the right track. """) chat_output = gr.Textbox(label="Bot response", lines=8) user_input = gr.Textbox(lines=2, placeholder="Respond Here") send_button = gr.Button("Send") clear_btn = gr.Button("🔄 Relaunch App") # 🔁 Auto trigger first question on launch demo.load(fn=chatbot, inputs=[], outputs=[chat_output]) # 🧠 Handle input after that send_button.click(fn=chatbot, inputs=[user_input], outputs=[chat_output]) clear_btn.click(fn=reset_chatbot, inputs=[], outputs=[chat_output]) demo.launch(show_api=True, share=False)