Spaces:
Runtime error
Runtime error
Ajey95
commited on
Commit
·
b945b4a
1
Parent(s):
3ebcca3
Fix: added helpers.py
Browse files- utils/helpers.py +19 -9
utils/helpers.py
CHANGED
|
@@ -7,6 +7,7 @@ import json
|
|
| 7 |
import os
|
| 8 |
import random
|
| 9 |
from datetime import datetime
|
|
|
|
| 10 |
|
| 11 |
def load_quotes():
|
| 12 |
"""Load inspirational quotes from Gita/Vedas"""
|
|
@@ -36,18 +37,27 @@ def load_quotes():
|
|
| 36 |
return default_quotes
|
| 37 |
|
| 38 |
def get_greeting():
|
| 39 |
-
"""
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
else:
|
| 49 |
return "🌙 शुभ रात्रि (Good Night)! Late night study session?"
|
| 50 |
|
|
|
|
| 51 |
def format_indian_text(text, add_emojis=True):
|
| 52 |
"""Format text with Indian cultural elements"""
|
| 53 |
if add_emojis:
|
|
|
|
| 7 |
import os
|
| 8 |
import random
|
| 9 |
from datetime import datetime
|
| 10 |
+
from zoneinfo import ZoneInfo
|
| 11 |
|
| 12 |
def load_quotes():
|
| 13 |
"""Load inspirational quotes from Gita/Vedas"""
|
|
|
|
| 37 |
return default_quotes
|
| 38 |
|
| 39 |
def get_greeting():
|
| 40 |
+
"""
|
| 41 |
+
Returns a time-of-day appropriate greeting in English and Hindi,
|
| 42 |
+
specifically for the Indian Standard Time (IST) timezone.
|
| 43 |
+
"""
|
| 44 |
+
# Define the Indian Standard Time timezone
|
| 45 |
+
ist_timezone = ZoneInfo("Asia/Kolkata")
|
| 46 |
+
|
| 47 |
+
# Get the current time in the IST timezone
|
| 48 |
+
current_time_ist = datetime.now(ist_timezone)
|
| 49 |
+
current_hour = current_time_ist.hour
|
| 50 |
+
|
| 51 |
+
if 5 <= current_hour < 12:
|
| 52 |
+
return "☀️ सुप्रभात (Good Morning)! Ready to start the day?"
|
| 53 |
+
elif 12 <= current_hour < 17:
|
| 54 |
+
return "☀️ नमस्कार (Good Afternoon)! Time for a study session?"
|
| 55 |
+
elif 17 <= current_hour < 21:
|
| 56 |
+
return "🌇 शुभ संध्या (Good Evening)! Wrapping up your studies?"
|
| 57 |
else:
|
| 58 |
return "🌙 शुभ रात्रि (Good Night)! Late night study session?"
|
| 59 |
|
| 60 |
+
|
| 61 |
def format_indian_text(text, add_emojis=True):
|
| 62 |
"""Format text with Indian cultural elements"""
|
| 63 |
if add_emojis:
|