Spaces:
Sleeping
Sleeping
Upload engine.py
Browse files
engine.py
CHANGED
|
@@ -29,7 +29,15 @@ def humanize(text):
|
|
| 29 |
return f"Sure \n\n{text}"
|
| 30 |
|
| 31 |
def friendly(text):
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|