bhavika24 commited on
Commit
2e9817a
·
verified ·
1 Parent(s): 82d3e6d

Upload engine.py

Browse files
Files changed (1) hide show
  1. engine.py +9 -1
engine.py CHANGED
@@ -29,7 +29,15 @@ def humanize(text):
29
  return f"Sure \n\n{text}"
30
 
31
  def friendly(text):
32
- return f"{text}\n\nIf you want, I can help you explore this further "
 
 
 
 
 
 
 
 
33
 
34
  def is_confirmation(text):
35
  return text.strip().lower() in ["yes", "yep", "yeah", "ok", "okay", "sure"]
 
29
  return f"Sure \n\n{text}"
30
 
31
  def friendly(text):
32
+ global LAST_SUGGESTED_DATE
33
+ if LAST_SUGGESTED_DATE:
34
+ return f"{text}\n\nLast data available is {LAST_SUGGESTED_DATE}"
35
+ else:
36
+ # If date not set yet, try to get it
37
+ date = get_latest_data_date()
38
+ if date:
39
+ return f"{text}\n\nLast data available is {date}"
40
+ return text
41
 
42
  def is_confirmation(text):
43
  return text.strip().lower() in ["yes", "yep", "yeah", "ok", "okay", "sure"]