Ankush Rana commited on
Commit
dd900d1
·
1 Parent(s): 2f01ff2
Files changed (1) hide show
  1. tools.py +6 -6
tools.py CHANGED
@@ -222,9 +222,9 @@ class check_room_availability(ToolBase):
222
  if len(rooms) == 0:
223
  return f"There is no room exists with room type {room_type}"
224
 
225
- rooms2 = [room for room in rooms if guests <= room["number_of_guests"]]
226
  if len(rooms2) == 0:
227
- max_guests = json_data["room_types"][room_type]["number_of_guests"]
228
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
229
 
230
  return rooms2
@@ -281,9 +281,9 @@ class make_reservation(ToolBase):
281
  if len(rooms) == 0:
282
  return f"There is no room exists with room type {room_type}"
283
 
284
- rooms2 = [room for room in rooms if guests <= room["number_of_guests"]]
285
  if len(rooms2) == 0:
286
- max_guests = json_data["room_types"][room_type]["number_of_guests"]
287
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
288
 
289
  room = rooms2[random.randint(0, len(rooms2) - 1)]
@@ -382,9 +382,9 @@ class modify_reservation(ToolBase):
382
  if len(rooms) == 0:
383
  return f"There is no room exists with room type {new_room_type}"
384
 
385
- rooms = [room for room in rooms if guests <= room["number_of_guests"]]
386
  if len(rooms) == 0:
387
- max_guests = json_data["room_types"][new_room_type]["number_of_guests"]
388
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
389
 
390
  room = rooms[random.randint(0, len(rooms) - 1)]
 
222
  if len(rooms) == 0:
223
  return f"There is no room exists with room type {room_type}"
224
 
225
+ rooms2 = [room for room in rooms if guests <= room["guests"]]
226
  if len(rooms2) == 0:
227
+ max_guests = json_data["room_types"][room_type]["guests"]
228
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
229
 
230
  return rooms2
 
281
  if len(rooms) == 0:
282
  return f"There is no room exists with room type {room_type}"
283
 
284
+ rooms2 = [room for room in rooms if guests <= room["guests"]]
285
  if len(rooms2) == 0:
286
+ max_guests = json_data["room_types"][room_type]["guests"]
287
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
288
 
289
  room = rooms2[random.randint(0, len(rooms2) - 1)]
 
382
  if len(rooms) == 0:
383
  return f"There is no room exists with room type {new_room_type}"
384
 
385
+ rooms = [room for room in rooms if guests <= room["guests"]]
386
  if len(rooms) == 0:
387
+ max_guests = json_data["room_types"][new_room_type]["guests"]
388
  return f"The number of guest is superior then the availibilty, maximum is {max_guests}"
389
 
390
  room = rooms[random.randint(0, len(rooms) - 1)]