Spaces:
Sleeping
Sleeping
Update planner.py
Browse files- planner.py +17 -13
planner.py
CHANGED
|
@@ -19,17 +19,21 @@ def generate_task_plan(goal: str) -> str:
|
|
| 19 |
{
|
| 20 |
"role": "user",
|
| 21 |
"content": (
|
| 22 |
-
"You are a
|
| 23 |
-
"
|
| 24 |
-
"-
|
| 25 |
-
"-
|
| 26 |
-
"-
|
| 27 |
-
"-
|
| 28 |
-
"-
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
}
|
| 35 |
]
|
|
@@ -38,8 +42,8 @@ def generate_task_plan(goal: str) -> str:
|
|
| 38 |
response = client.chat.completions.create(
|
| 39 |
model="Qwen/Qwen2.5-Coder-7B-Instruct",
|
| 40 |
messages=messages,
|
| 41 |
-
max_tokens=
|
| 42 |
-
temperature=0.
|
| 43 |
top_p=0.95,
|
| 44 |
stream=False
|
| 45 |
)
|
|
|
|
| 19 |
{
|
| 20 |
"role": "user",
|
| 21 |
"content": (
|
| 22 |
+
"You are a strict project planner. Break down the following goal into actionable tasks.\n\n"
|
| 23 |
+
"RULES:\n"
|
| 24 |
+
"- The project must be COMPLETE within the timeframe stated in the goal.\n"
|
| 25 |
+
"- If the goal says 'in 2 weeks', you have EXACTLY 14 days — NO task can be due after Day 14.\n"
|
| 26 |
+
"- All deadlines must be between Day 1 and Day 14 (inclusive).\n"
|
| 27 |
+
"- Do NOT invent extra days. If the goal says 'in X days/weeks', convert it to total days and respect it.\n"
|
| 28 |
+
"- Number tasks clearly (1., 2., 3., ...).\n"
|
| 29 |
+
"- For each task, include: 'Due: Day N', 'Depends on: ...', and a short description.\n"
|
| 30 |
+
"- Keep tasks realistic and parallelizable where possible.\n"
|
| 31 |
+
"- NEVER output a task with 'Due: Day 15' or beyond if the limit is 14 days.\n\n"
|
| 32 |
+
"Example (for a 5-day goal):\n"
|
| 33 |
+
"1. Draft requirements - Due: Day 1 - Depends on: None\n"
|
| 34 |
+
" Description: ...\n\n"
|
| 35 |
+
f"GOAL TO PLAN: \"{goal}\"\n\n"
|
| 36 |
+
"Now generate the plan. STRICTLY FOLLOW THE TIME LIMIT."
|
| 37 |
)
|
| 38 |
}
|
| 39 |
]
|
|
|
|
| 42 |
response = client.chat.completions.create(
|
| 43 |
model="Qwen/Qwen2.5-Coder-7B-Instruct",
|
| 44 |
messages=messages,
|
| 45 |
+
max_tokens=2048,
|
| 46 |
+
temperature=0.3,
|
| 47 |
top_p=0.95,
|
| 48 |
stream=False
|
| 49 |
)
|