iukhan commited on
Commit
3f3be2f
·
verified ·
1 Parent(s): 401ffe2

Create restaurant_app_deployment.py

Browse files
Files changed (1) hide show
  1. restaurant_app_deployment.py +49 -0
restaurant_app_deployment.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from restaurant_order_management import process_order
3
+ from restaurant_table_reservation import reserve_table
4
+ from restaurant_menu_system import recommend_dishes
5
+ from restaurant_feedback_analysis import analyze_feedback
6
+ from restaurant_chatbot import chat
7
+
8
+ # Combine all features into one app
9
+ with gr.Blocks() as restaurant_app:
10
+
11
+ # Tab for Order Management
12
+ with gr.Tab("Order Management"):
13
+ table_number = gr.Number(label="Table Number")
14
+ order_items = gr.Textbox(label="Order Items (e.g., Pizza, Pasta)")
15
+ order_button = gr.Button("Place Order")
16
+ order_output = gr.Textbox(label="Order Status")
17
+ order_button.click(fn=process_order, inputs=[table_number, order_items], outputs=order_output)
18
+
19
+ # Tab for Table Reservations
20
+ with gr.Tab("Table Reservations"):
21
+ date = gr.Date(label="Select Date")
22
+ time = gr.Time(label="Select Time")
23
+ guests = gr.Number(label="Number of Guests")
24
+ reserve_button = gr.Button("Reserve Table")
25
+ reserve_output = gr.Textbox(label="Reservation Status")
26
+ reserve_button.click(fn=reserve_table, inputs=[date, time, guests], outputs=reserve_output)
27
+
28
+ # Tab for Menu Recommendations
29
+ with gr.Tab("Menu Recommendations"):
30
+ preferences = gr.Textbox(label="Enter your dietary preferences")
31
+ recommend_button = gr.Button("Get Recommendations")
32
+ recommendations_output = gr.Textbox(label="Recommended Dishes")
33
+ recommend_button.click(fn=recommend_dishes, inputs=preferences, outputs=recommendations_output)
34
+
35
+ # Tab for Feedback Sentiment Analysis
36
+ with gr.Tab("Feedback Analysis"):
37
+ feedback = gr.Textbox(label="Customer Feedback")
38
+ analyze_button = gr.Button("Analyze Feedback")
39
+ sentiment_output = gr.Textbox(label="Sentiment Analysis")
40
+ analyze_button.click(fn=analyze_feedback, inputs=feedback, outputs=sentiment_output)
41
+
42
+ # Tab for Chatbot
43
+ with gr.Tab("Chatbot"):
44
+ user_input = gr.Textbox(label="Ask me anything")
45
+ chat_button = gr.Button("Send")
46
+ chatbot_output = gr.Textbox(label="Chatbot Response")
47
+ chat_button.click(fn=chat, inputs=user_input, outputs=chatbot_output)
48
+
49
+ restaurant_app.launch()