Nexari-Server / cognitive_engine.py
Nexari-Research's picture
Update cognitive_engine.py
3349518 verified
from datetime import datetime
import pytz
def get_time_context():
IST = pytz.timezone('Asia/Kolkata')
now = datetime.now(IST)
return f"### REAL-TIME INFO ###\nCurrent Time: {now.strftime('%I:%M %p')}\nDay: {now.strftime('%A')}\nDate: {now.strftime('%d %B %Y')}"
def get_thinking_strategy(is_complex=False, detail=False, min_words_hint: int = None):
if is_complex or detail:
base = (
"### STRATEGY: STRUCTURED & DETAILED ###\n"
"If complex or user requested detail, provide a short '🧠 Plan:' (max 2 lines),\n"
"then a numbered, step-by-step '💡 Answer:' with clear numbered lines. "
"Do NOT leak chain-of-thought.\n"
"Style: Use natural phrasing, contractions where appropriate, and 0-2 emojis as suggested.\n"
)
else:
base = (
"### STRATEGY: CONCISE ###\n"
"Keep responses friendly and brief but avoid single-sentence robotic replies. Offer a one-line suggestion and a follow-up question.\n"
"Style: Prefer natural phrasing and 0-2 emojis as suggested.\n"
)
if min_words_hint:
base += f"MINIMUM_WORD_GOAL: Please aim for at least ~{min_words_hint} words unless user explicitly asks for 'short'.\n"
return base