Spaces:
Running
Running
Update tools.py
Browse files
tools.py
CHANGED
@@ -185,7 +185,7 @@ class check_room_availability(ToolBase):
|
|
185 |
check_out_date = instance.check_out_date
|
186 |
guests = instance.guests
|
187 |
|
188 |
-
rooms = [room for room in json_data["accomodations"] if room_type in room["type"]]
|
189 |
if len(rooms) == 0:
|
190 |
return f"There is no room exists with room type {room_type}"
|
191 |
|
@@ -233,7 +233,6 @@ class make_reservation(ToolBase):
|
|
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
|
@@ -241,7 +240,7 @@ class make_reservation(ToolBase):
|
|
241 |
guests = instance.guests
|
242 |
user_id = instance.user_id
|
243 |
|
244 |
-
rooms = [room for room in json_data["accomodations"] if room_type in room["type"]]
|
245 |
if len(rooms) == 0:
|
246 |
return f"There is no room exists with room type {room_type}"
|
247 |
|
@@ -418,4 +417,4 @@ class get_reservation_details(ToolBase):
|
|
418 |
|
419 |
tmp_data = copy.deepcopy(reservations["reservation_id"])
|
420 |
tmp_data.pop("user_id")
|
421 |
-
return json.dumps(tmp_data)
|
|
|
185 |
check_out_date = instance.check_out_date
|
186 |
guests = instance.guests
|
187 |
|
188 |
+
rooms = [room for room in json_data["accomodations"]["rooms"] if room_type in room["type"]]
|
189 |
if len(rooms) == 0:
|
190 |
return f"There is no room exists with room type {room_type}"
|
191 |
|
|
|
233 |
return f"Unable to complete the reservation. The following required arguments are missing:{value}."
|
234 |
|
235 |
|
|
|
236 |
instance = cls(**input)
|
237 |
room_type = instance.room_type
|
238 |
check_in_date = instance.check_in_date
|
|
|
240 |
guests = instance.guests
|
241 |
user_id = instance.user_id
|
242 |
|
243 |
+
rooms = [room for room in json_data["accomodations"]["rooms"] if room_type in room["type"]]
|
244 |
if len(rooms) == 0:
|
245 |
return f"There is no room exists with room type {room_type}"
|
246 |
|
|
|
417 |
|
418 |
tmp_data = copy.deepcopy(reservations["reservation_id"])
|
419 |
tmp_data.pop("user_id")
|
420 |
+
return json.dumps(tmp_data)
|