Spaces:
Runtime error
Runtime error
Update cognitive_engine.py
Browse files- cognitive_engine.py +9 -6
cognitive_engine.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
cognitive_engine.py - thinking strategy
|
| 3 |
-
- Supports 'detail' flag to request numbered/detailed answers
|
| 4 |
"""
|
| 5 |
|
| 6 |
from datetime import datetime
|
|
@@ -12,14 +11,18 @@ def get_time_context():
|
|
| 12 |
return f"### REAL-TIME INFO ###\nCurrent Time: {now.strftime('%I:%M %p')}\nDay: {now.strftime('%A')}\nDate: {now.strftime('%d %B %Y')}"
|
| 13 |
|
| 14 |
def get_thinking_strategy(is_complex=False, detail=False):
|
|
|
|
|
|
|
|
|
|
| 15 |
if is_complex or detail:
|
| 16 |
return (
|
| 17 |
-
"### STRATEGY: STRUCTURED &
|
| 18 |
-
"If
|
| 19 |
-
"then
|
|
|
|
| 20 |
)
|
| 21 |
else:
|
| 22 |
return (
|
| 23 |
"### STRATEGY: CONCISE ###\n"
|
| 24 |
-
"
|
| 25 |
)
|
|
|
|
| 1 |
"""
|
| 2 |
+
cognitive_engine.py - thinking strategy with `detail` flag
|
|
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
from datetime import datetime
|
|
|
|
| 11 |
return f"### REAL-TIME INFO ###\nCurrent Time: {now.strftime('%I:%M %p')}\nDay: {now.strftime('%A')}\nDate: {now.strftime('%d %B %Y')}"
|
| 12 |
|
| 13 |
def get_thinking_strategy(is_complex=False, detail=False):
|
| 14 |
+
"""
|
| 15 |
+
If detail==True, instruct model to produce a numbered, stepwise, longer answer.
|
| 16 |
+
"""
|
| 17 |
if is_complex or detail:
|
| 18 |
return (
|
| 19 |
+
"### STRATEGY: STRUCTURED & DETAILED ###\n"
|
| 20 |
+
"If complex or user requested detail, provide a short '🧠 Plan:' (max 2 lines),\n"
|
| 21 |
+
"then a numbered, step-by-step '💡 Answer:' with clear numbered lines. "
|
| 22 |
+
"Aim for thorough coverage if requested by user. Do NOT leak chain-of-thought."
|
| 23 |
)
|
| 24 |
else:
|
| 25 |
return (
|
| 26 |
"### STRATEGY: CONCISE ###\n"
|
| 27 |
+
"Keep responses friendly and brief. Offer a one-line suggestion and a follow-up question."
|
| 28 |
)
|