Ankush Rana commited on
Commit
fe003ff
·
1 Parent(s): bd634a3
Files changed (1) hide show
  1. tools.py +8 -8
tools.py CHANGED
@@ -373,15 +373,15 @@ class modify_reservation(ToolBase):
373
  room = rooms[random.randint(0, len(rooms))]
374
  room_number = room["room_number"]
375
  else:
376
- room_number = reservations["reservation_id"]["room_number"]
377
 
378
 
379
- reservations["reservation_id"]["guests"] = guests if guests else reservations["reservation_id"]["guests"]
380
- reservations["reservation_id"]["check_in_date"] = new_check_in_date if new_check_in_date else reservations["reservation_id"]["check_in_date"]
381
- reservations["reservation_id"]["check_out_date"] = new_check_out_date if new_check_out_date else reservations["reservation_id"]["check_out_date"]
382
- reservations["reservation_id"]["room_type"] = new_room_type if new_room_type else reservations["reservation_id"]["room_type"]
383
- reservations["reservation_id"]["room_number"] = room_number
384
- tmp_data = reservations["reservation_id"]
385
  return f"The reservation {reservation_id} is modified correctly: {json.dumps(tmp_data)}"
386
 
387
  @tool_register
@@ -409,5 +409,5 @@ class reservation_details(ToolBase):
409
  return f"There is no reservations with the id: {reservation_id}"
410
 
411
 
412
- tmp_data = copy.deepcopy(reservations["reservation_id"])
413
  return json.dumps(tmp_data)
 
373
  room = rooms[random.randint(0, len(rooms))]
374
  room_number = room["room_number"]
375
  else:
376
+ room_number = reservations[reservation_id]["room_number"]
377
 
378
 
379
+ reservations[reservation_id]["guests"] = guests if guests else reservations[reservation_id]["guests"]
380
+ reservations[reservation_id]["check_in_date"] = new_check_in_date if new_check_in_date else reservations[reservation_id]["check_in_date"]
381
+ reservations[reservation_id]["check_out_date"] = new_check_out_date if new_check_out_date else reservations[reservation_id]["check_out_date"]
382
+ reservations[reservation_id]["room_type"] = new_room_type if new_room_type else reservations[reservation_id]["room_type"]
383
+ reservations[reservation_id]["room_number"] = room_number
384
+ tmp_data = reservations[reservation_id]
385
  return f"The reservation {reservation_id} is modified correctly: {json.dumps(tmp_data)}"
386
 
387
  @tool_register
 
409
  return f"There is no reservations with the id: {reservation_id}"
410
 
411
 
412
+ tmp_data = copy.deepcopy(reservations[reservation_id])
413
  return json.dumps(tmp_data)