Nexari-Server / cognitive_engine.py
Nexari-Research's picture
Update cognitive_engine.py
49afcdd verified
raw
history blame
1.07 kB
"""
cognitive_engine.py - thinking strategy with `detail` flag
"""
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):
"""
If detail==True, instruct model to produce a numbered, stepwise, longer answer.
"""
if is_complex or detail:
return (
"### 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. "
"Aim for thorough coverage if requested by user. Do NOT leak chain-of-thought."
)
else:
return (
"### STRATEGY: CONCISE ###\n"
"Keep responses friendly and brief. Offer a one-line suggestion and a follow-up question."
)