File size: 752 Bytes
a96fdb7
 
ceda1d7
3fd078e
ceda1d7
a96fdb7
c0ca368
a96fdb7
 
4f2661c
a96fdb7
c0ca368
 
 
ac5a27a
3fd078e
 
a96fdb7
 
 
ceda1d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()