Keeby-smilyai commited on
Commit
1d6374d
·
verified ·
1 Parent(s): af28159

Update backend.py

Browse files
Files changed (1) hide show
  1. backend.py +20 -21
backend.py CHANGED
@@ -87,34 +87,33 @@ ROLE_PROMPTS = {
87
  Analyze the user's request and provide a list of files to be created.
88
  Then, create the very first task for the Manager to execute.
89
  Respond ONLY with a JSON object with keys "plan" and "initial_task".
90
- Example: {"plan": {"files": ["app.py", "backend.py"]}, "initial_task": "Write the code for backend.py first, focusing on database functions."}""",
91
 
92
- "manager": """You are the Manager. You receive tasks and questions. Your job is to either:
93
- 1. Break down a task into a simple, single command for a worker (coder or tester).
94
- 2. Answer a worker's question clearly.
95
- 3. If you are stuck, ask the CEO for guidance.
96
- 4. When all work is done, decide to finish the project.
97
- Your available actions are: "delegate_to_worker", "answer_worker", "ask_ceo", "finish_project".
98
  Respond ONLY with a JSON object with "action" and "data".
99
- Example: {"action": "delegate_to_worker", "data": {"worker_type": "coder", "task": "Write the full Python code for the file `backend.py`."}}""",
100
-
 
 
 
101
  "worker_coder": """You are a Coder. Your only job is to write code based on the Manager's task.
102
- You have these actions available:
103
- 1. "write_code": To write the content of a file. The `code` field must contain the full, raw source code.
104
- 2. "read_file": To read an existing file for context.
105
- 3. "ask_manager": If you are stuck, need clarification, or the task is unclear.
106
- 4. "task_complete": When you have successfully finished the assigned task.
107
  Respond ONLY with a JSON object with "action" and "data".
108
  Example: {"action": "write_code", "data": {"file_path": "backend.py", "code": "import sqlite3..."}}""",
109
 
110
- "worker_tester": """You are a Tester. Your only job is to write tests based on the Manager's task.
111
- You have these actions available:
112
- 1. "write_test": To write the content of a test file.
113
- 2. "read_file": To read the source code you need to test.
114
- 3. "ask_manager": If you need clarification on what to test.
115
- 4. "task_complete": When you have finished writing the tests.
116
  Respond ONLY with a JSON object with "action" and "data".
117
- Example: {"action": "write_test", "data": {"file_path": "tests/test_backend.py", "code": "import pytest..."}}""",
118
  }
119
 
120
  # ------------------------------ FILE SYSTEM & AI TOOLS ------------------------------
 
87
  Analyze the user's request and provide a list of files to be created.
88
  Then, create the very first task for the Manager to execute.
89
  Respond ONLY with a JSON object with keys "plan" and "initial_task".
90
+ Example: {"plan": {"files": ["app.py", "backend.py", "tests/test_app.py"]}, "initial_task": "Start by writing the backend.py file with database functions."}""",
91
 
92
+ "manager": """You are the Manager. You receive tasks and questions. Your job is to:
93
+ 1. Break down work into small steps for workers
94
+ 2. After a worker completes a task, assign the NEXT logical task (code another file OR write tests)
95
+ 3. Only finish when ALL code and tests are complete
96
+ 4. If unsure, ask the CEO
97
+ Available actions: "delegate_to_worker", "answer_worker", "ask_ceo", "finish_project"
98
  Respond ONLY with a JSON object with "action" and "data".
99
+ Examples:
100
+ - {"action": "delegate_to_worker", "data": {"worker_type": "coder", "task": "Write the full Python code for app.py"}}
101
+ - {"action": "delegate_to_worker", "data": {"worker_type": "tester", "task": "Write unit tests for backend.py"}}
102
+ - {"action": "finish_project", "data": {}}""",
103
+
104
  "worker_coder": """You are a Coder. Your only job is to write code based on the Manager's task.
105
+ After completing a task, report "task_complete" - DO NOT decide what to do next.
106
+ The Manager will assign the next file to code.
107
+ Available actions: "write_code", "read_file", "ask_manager", "task_complete"
 
 
108
  Respond ONLY with a JSON object with "action" and "data".
109
  Example: {"action": "write_code", "data": {"file_path": "backend.py", "code": "import sqlite3..."}}""",
110
 
111
+ "worker_tester": """You are a Tester. Your only job is to write tests for existing code.
112
+ After completing test writing, report "task_complete".
113
+ The Manager will decide if more tests are needed or if the project can finish.
114
+ Available actions: "write_test", "read_file", "ask_manager", "task_complete"
 
 
115
  Respond ONLY with a JSON object with "action" and "data".
116
+ Example: {"action": "write_test", "data": {"file_path": "tests/test_backend.py", "code": "import pytest..."}}"""
117
  }
118
 
119
  # ------------------------------ FILE SYSTEM & AI TOOLS ------------------------------