Spaces:
Running
Running
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -104,10 +104,14 @@ class get_hotel_facilities(ToolBase):
|
|
| 104 |
|
| 105 |
@tool_register
|
| 106 |
class get_restaurants_info(ToolBase):
|
| 107 |
-
"""Provides a list of
|
| 108 |
|
| 109 |
@classmethod
|
| 110 |
def invoke(cls, input: Dict) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
return json_data["restaurants"]
|
| 112 |
|
| 113 |
|
|
@@ -212,10 +216,6 @@ class make_reservation(ToolBase):
|
|
| 212 |
guests = input.get("guests", None)
|
| 213 |
user_id = input.get("user_id", None)
|
| 214 |
|
| 215 |
-
if len(missing):
|
| 216 |
-
value = ", ".join(missing)
|
| 217 |
-
return f"Unable to complete the reservation. The following required arguments are missing:{value}."
|
| 218 |
-
|
| 219 |
missing = []
|
| 220 |
if not room_type:
|
| 221 |
missing.append("room_type")
|
|
@@ -228,6 +228,12 @@ class make_reservation(ToolBase):
|
|
| 228 |
if not user_id:
|
| 229 |
missing.append("user_id")
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
instance = cls(**input)
|
| 232 |
room_type = instance.room_type
|
| 233 |
check_in_date = instance.check_in_date
|
|
|
|
| 104 |
|
| 105 |
@tool_register
|
| 106 |
class get_restaurants_info(ToolBase):
|
| 107 |
+
"""Provides a list of available restaurants with their information."""
|
| 108 |
|
| 109 |
@classmethod
|
| 110 |
def invoke(cls, input: Dict) -> str:
|
| 111 |
+
"""
|
| 112 |
+
Play a playlist by its name, starting with the first or a random song.
|
| 113 |
+
"""
|
| 114 |
+
|
| 115 |
return json_data["restaurants"]
|
| 116 |
|
| 117 |
|
|
|
|
| 216 |
guests = input.get("guests", None)
|
| 217 |
user_id = input.get("user_id", None)
|
| 218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
missing = []
|
| 220 |
if not room_type:
|
| 221 |
missing.append("room_type")
|
|
|
|
| 228 |
if not user_id:
|
| 229 |
missing.append("user_id")
|
| 230 |
|
| 231 |
+
if len(missing):
|
| 232 |
+
value = ", ".join(missing)
|
| 233 |
+
return f"Unable to complete the reservation. The following required arguments are missing:{value}."
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
|
| 237 |
instance = cls(**input)
|
| 238 |
room_type = instance.room_type
|
| 239 |
check_in_date = instance.check_in_date
|