venkat-srinivasan-nexusflow commited on
Commit
0a16124
Β·
verified Β·
1 Parent(s): 4093962

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +11 -1
tools.py CHANGED
@@ -259,6 +259,16 @@ class Tools:
259
 
260
  return self.sort_results(places, sort="distance", descending=False)
261
 
 
 
 
 
 
 
 
 
 
 
262
  def get_some_reviews(self, place_names: list, location: str = None):
263
  """
264
  Given an establishment (or place) name, return reviews about the establishment.
@@ -305,4 +315,4 @@ class Tools:
305
 
306
  random.shuffle(all_reviews)
307
 
308
- return all_reviews
 
259
 
260
  return self.sort_results(places, sort="distance", descending=False)
261
 
262
+ def irrelevant_query(self, user_query : str) -> str:
263
+ """
264
+ This function is designed to handle unrelated queries from the user.
265
+ If the user provides any input user query that is unrelated or unanswerable by the other APIs provided,
266
+ please use this function with the input user query as the string.
267
+
268
+ - user_query (str): The input string that is invalid.
269
+ """
270
+ return "This query is not answerable. Please provide queries regarding locations, reviews, or recommendations!"
271
+
272
  def get_some_reviews(self, place_names: list, location: str = None):
273
  """
274
  Given an establishment (or place) name, return reviews about the establishment.
 
315
 
316
  random.shuffle(all_reviews)
317
 
318
+ return all_reviews