Ankush Rana commited on
Commit
001ce51
·
1 Parent(s): f4cd0a0
Files changed (2) hide show
  1. app.py +1 -1
  2. tools.py +6 -6
app.py CHANGED
@@ -54,7 +54,7 @@ def completion(history, model, system_prompt, tools=None):
54
  "messages": messages,
55
  "stream": False,
56
  "max_tokens": 1000,
57
- "temperature": 0.01,
58
  "frequency_penalty": 1,
59
  "extra_body": {"repetition_penalty": 1.1},
60
  }
 
54
  "messages": messages,
55
  "stream": False,
56
  "max_tokens": 1000,
57
+ "temperature": 0.15,
58
  "frequency_penalty": 1,
59
  "extra_body": {"repetition_penalty": 1.1},
60
  }
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["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,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["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,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["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)]
 
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
  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
  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)]