Spaces:
Build error
Build error
Create utils.py
Browse files
utils.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from serpapi import GoogleSearch
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
def get_restaurant_info(query):
|
| 5 |
+
params = {
|
| 6 |
+
'q': query,
|
| 7 |
+
'api_key': 'YOUR_SERP_API_KEY'
|
| 8 |
+
}
|
| 9 |
+
search = GoogleSearch(params)
|
| 10 |
+
results = search.get_dict()
|
| 11 |
+
return results
|
| 12 |
+
|
| 13 |
+
def get_flight_info(destination):
|
| 14 |
+
# Fetch flight information from a travel API
|
| 15 |
+
return {"flights": [{"flight": "Flight1", "price": "$200"}]} # Mock Data
|
| 16 |
+
|
| 17 |
+
def get_hotel_info(destination):
|
| 18 |
+
# Fetch hotel information from a hotel API
|
| 19 |
+
return {"hotels": [{"hotel": "Hotel1", "price": "$100"}]} # Mock Data
|