Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def travel_bot(destination, budget, interests):
|
| 4 |
+
itinerary = f"You’re heading to {destination}! "
|
| 5 |
+
if budget.lower() == "luxury":
|
| 6 |
+
itinerary += "Enjoy 5-star accommodations and fine dining. "
|
| 7 |
+
elif budget.lower() == "budget":
|
| 8 |
+
itinerary += "Affordable stays and local eats are a great choice. "
|
| 9 |
+
|
| 10 |
+
itinerary += f"We’ll include activities based on your interests in {interests}. Get ready for an adventure!"
|
| 11 |
+
|
| 12 |
+
return itinerary
|
| 13 |
+
|
| 14 |
+
# Create Gradio chatbot
|
| 15 |
+
iface = gr.Interface(
|
| 16 |
+
fn=travel_bot,
|
| 17 |
+
inputs=["text", "text", "text"],
|
| 18 |
+
outputs="text",
|
| 19 |
+
title="Personalized Travel Itinerary Bot",
|
| 20 |
+
description="Enter destination, budget, and interests to get a personalized itinerary!"
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
iface.launch()
|