Spaces:
Runtime error
Runtime error
Update core/ai_engine.py
Browse files- core/ai_engine.py +2 -1
core/ai_engine.py
CHANGED
|
@@ -166,6 +166,7 @@ def smart_schedule_tasks(
|
|
| 166 |
patterns = user_context.get("learned_patterns", {})
|
| 167 |
feedback = user_context.get("scheduling_feedback", {})
|
| 168 |
|
|
|
|
| 169 |
context_block = f"""CURRENT DATE/TIME: {current_dt.strftime('%Y-%m-%d %H:%M')} ({current_dt.strftime('%A')})
|
| 170 |
TODAY: {today.isoformat()} | TOMORROW: {tomorrow.isoformat()}
|
| 171 |
NEXT 7 DAYS: {', '.join(next_7)}
|
|
@@ -188,7 +189,7 @@ HISTORY:
|
|
| 188 |
- Avg completion: {round(feedback.get('avg_completion_rate', 0) * 100)}%
|
| 189 |
|
| 190 |
GOALS:
|
| 191 |
-
{
|
| 192 |
|
| 193 |
tasks_block = json.dumps([{
|
| 194 |
"task_id": t.get("id", t.get("task_id")),
|
|
|
|
| 166 |
patterns = user_context.get("learned_patterns", {})
|
| 167 |
feedback = user_context.get("scheduling_feedback", {})
|
| 168 |
|
| 169 |
+
goals_lines = "\n".join(f"- {g}" for g in (user_goals or [])) or "(none set)"
|
| 170 |
context_block = f"""CURRENT DATE/TIME: {current_dt.strftime('%Y-%m-%d %H:%M')} ({current_dt.strftime('%A')})
|
| 171 |
TODAY: {today.isoformat()} | TOMORROW: {tomorrow.isoformat()}
|
| 172 |
NEXT 7 DAYS: {', '.join(next_7)}
|
|
|
|
| 189 |
- Avg completion: {round(feedback.get('avg_completion_rate', 0) * 100)}%
|
| 190 |
|
| 191 |
GOALS:
|
| 192 |
+
{goals_lines}"""
|
| 193 |
|
| 194 |
tasks_block = json.dumps([{
|
| 195 |
"task_id": t.get("id", t.get("task_id")),
|