File size: 909 Bytes
2399317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

# Function to recommend dishes based on preferences
def recommend_dishes(preferences):
    # Basic logic to recommend dishes (in reality, it could query a database)
    if "vegan" in preferences.lower():
        return "Recommended Vegan Dishes: Vegan Pizza, Vegan Burger"
    elif "spicy" in preferences.lower():
        return "Recommended Spicy Dishes: Spicy Chicken Wings, Spicy Tacos"
    else:
        return "Recommended Dishes: Margherita Pizza, Caesar Salad"

# Gradio interface for the interactive menu system
with gr.Blocks() as menu_app:
    preferences = gr.Textbox(label="Enter your dietary preferences (e.g., vegan, spicy)")
    recommend_button = gr.Button("Get Recommendations")
    recommendations_output = gr.Textbox(label="Recommended Dishes")
    
    recommend_button.click(fn=recommend_dishes, inputs=preferences, outputs=recommendations_output)

menu_app.launch()