Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,18 +34,18 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
-
def
|
38 |
"""Fetches the most suitable 10 hotels in a given location and price range.
|
39 |
|
40 |
Args:
|
41 |
-
location
|
42 |
-
|
43 |
|
44 |
Returns:
|
45 |
list: A list of dictionaries containing hotel titles, URLs, and snippets.
|
46 |
"""
|
47 |
try:
|
48 |
-
query = f"best hotels in {location} in {
|
49 |
|
50 |
with DuckDuckGoSearchTool as ddgs:
|
51 |
results = ddgs.text(query, max_results=10)
|
|
|
34 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
35 |
|
36 |
@tool
|
37 |
+
def find_hotels(location: str, price_range: str) -> list:
|
38 |
"""Fetches the most suitable 10 hotels in a given location and price range.
|
39 |
|
40 |
Args:
|
41 |
+
location: A string representation of city or area where hotels should be searched. (e.g. 'America', 'Italy', 'Miami', 'Paris')
|
42 |
+
price_range: A string representation of the preferred price range (e.g., 'budget', 'mid-range', 'luxury').
|
43 |
|
44 |
Returns:
|
45 |
list: A list of dictionaries containing hotel titles, URLs, and snippets.
|
46 |
"""
|
47 |
try:
|
48 |
+
query = f"best hotels in {location} in {price_range} range"
|
49 |
|
50 |
with DuckDuckGoSearchTool as ddgs:
|
51 |
results = ddgs.text(query, max_results=10)
|