studychatbot / chatbot_ui.py
MissieMcCown's picture
Update chatbot_ui.py
ceda1d7 verified
raw
history blame
752 Bytes
import gradio as gr # For building the chatbot UI
# Simplified chatbot response function
def chatbot_response(user_input):
return "You said: " + user_input
# Gradio interface setup
with gr.Blocks() as demo:
gr.Markdown("# Study Assistance Chatbot")
gr.Markdown("Ask me anything related to your academic studies.")
chatbot = gr.Chatbot() # Chat history UI
user_input = gr.Textbox(label="Enter your question here:", placeholder="Type your question...") # Textbox for user input
submit_button = gr.Button("Submit") # Submit button for user input
# Submit action - to update chat with response
submit_button.click(chatbot_response, inputs=user_input, outputs=chatbot)
# Launch the Gradio app
demo.launch()