File size: 760 Bytes
cedbd5e
c800729
 
cedbd5e
 
 
 
 
 
 
 
c800729
cedbd5e
 
 
 
 
 
 
 
 
 
c800729
cedbd5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# app.py
import gradio as gr

def chatbot_response(message):
    # Simple response logic
    responses = {
        "book a hotel": "Sure! What date and location?",
        "check availability": "Let me check the availability...",
        "hotel pricing": "Here are the pricing options...",
    }
    return responses.get(message.lower(), "Sorry, I didn't understand that.")

with gr.Blocks() as chatbot:
    gr.Markdown("# Hotel Booking Chatbot")
    with gr.Row():
        message_input = gr.Textbox(label="Your Message")
    with gr.Row():
        submit_button = gr.Button("Send")
    with gr.Row():
        output = gr.Textbox(label="Chatbot Response")
    
    submit_button.click(chatbot_response, inputs=message_input, outputs=output)

chatbot.launch()