rms / app.py
iukhan's picture
Rename restaurant_app_deployment.py to app.py
99a959c verified
import gradio as gr
from restaurant_order_management import process_order
from restaurant_table_reservation import reserve_table
from restaurant_menu_system import recommend_dishes
from restaurant_feedback_analysis import analyze_feedback
from restaurant_chatbot import chat
# Combine all features into one app
with gr.Blocks() as restaurant_app:
# Tab for Order Management
with gr.Tab("Order Management"):
table_number = gr.Number(label="Table Number")
order_items = gr.Textbox(label="Order Items (e.g., Pizza, Pasta)")
order_button = gr.Button("Place Order")
order_output = gr.Textbox(label="Order Status")
order_button.click(fn=process_order, inputs=[table_number, order_items], outputs=order_output)
# Tab for Table Reservations
with gr.Tab("Table Reservations"):
date = gr.Date(label="Select Date")
time = gr.Time(label="Select Time")
guests = gr.Number(label="Number of Guests")
reserve_button = gr.Button("Reserve Table")
reserve_output = gr.Textbox(label="Reservation Status")
reserve_button.click(fn=reserve_table, inputs=[date, time, guests], outputs=reserve_output)
# Tab for Menu Recommendations
with gr.Tab("Menu Recommendations"):
preferences = gr.Textbox(label="Enter your dietary preferences")
recommend_button = gr.Button("Get Recommendations")
recommendations_output = gr.Textbox(label="Recommended Dishes")
recommend_button.click(fn=recommend_dishes, inputs=preferences, outputs=recommendations_output)
# Tab for Feedback Sentiment Analysis
with gr.Tab("Feedback Analysis"):
feedback = gr.Textbox(label="Customer Feedback")
analyze_button = gr.Button("Analyze Feedback")
sentiment_output = gr.Textbox(label="Sentiment Analysis")
analyze_button.click(fn=analyze_feedback, inputs=feedback, outputs=sentiment_output)
# Tab for Chatbot
with gr.Tab("Chatbot"):
user_input = gr.Textbox(label="Ask me anything")
chat_button = gr.Button("Send")
chatbot_output = gr.Textbox(label="Chatbot Response")
chat_button.click(fn=chat, inputs=user_input, outputs=chatbot_output)
restaurant_app.launch()