Update backend/agents.py
#3
by
Keeby-smilyai - opened
- backend/agents.py +21 -21
backend/agents.py
CHANGED
|
@@ -58,31 +58,22 @@ ROLE_PROMPTS = {
|
|
| 58 |
To report that you have finished your task:
|
| 59 |
`task_complete()`""",
|
| 60 |
|
| 61 |
-
"worker_tester": """You are a Tester. Your ONLY job is to write tests for existing code.
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
CRITICAL INSTRUCTION: You MUST respond with ONLY a single tool call on a new line. DO NOT include any conversational text, explanations, or thoughts. For example:
|
| 67 |
-
|
| 68 |
-
`write_test("tests/test_backend.py", "import pytest\\n\\ndef test_db_connection():\\n # ...")`
|
| 69 |
|
| 70 |
-
Available actions: `scrape_web`, `write_test`, `read_file`, `ask_manager`, `task_complete`
|
| 71 |
|
| 72 |
Example Actions:
|
| 73 |
|
| 74 |
-
To scrape a website for information:
|
| 75 |
-
`scrape_web("https://docs.pytest.org/en/stable/")`
|
| 76 |
-
|
| 77 |
To write tests to a file. The second argument is a raw string of the test code:
|
| 78 |
`write_test("tests/test_backend.py", "import pytest\\n\\ndef test_db_connection():\\n # ...")`
|
| 79 |
|
| 80 |
-
To
|
| 81 |
-
`
|
| 82 |
|
| 83 |
-
To ask the Manager a question:
|
| 84 |
-
`ask_manager("Are there any specific edge cases I should focus on for the user login tests?")`
|
| 85 |
-
|
| 86 |
To report that you have finished your task:
|
| 87 |
`task_complete()`""",
|
| 88 |
|
|
@@ -102,18 +93,17 @@ ROLE_PROMPTS = {
|
|
| 102 |
```
|
| 103 |
""",
|
| 104 |
|
| 105 |
-
"debugger": """You are a Debugger. You are given an error log and the relevant code. Your ONLY job is to analyze the problem and provide a precise, actionable fix for the Coder. Do NOT try to fix the code yourself.
|
| 106 |
|
| 107 |
CRITICAL INSTRUCTION: You MUST respond with ONLY a single tool call on a new line. Do NOT include any conversational text.
|
| 108 |
|
| 109 |
-
Available actions: `propose_fix`, `ask_manager`
|
| 110 |
|
| 111 |
Example:
|
| 112 |
`propose_fix("main.py", "Line 25", "The function `get_user_by_id` is misspelled. It should be `get_user_by_username`.")`
|
| 113 |
-
`
|
| 114 |
""",
|
| 115 |
|
| 116 |
-
# --- NEW AGENT ROLES ---
|
| 117 |
"business_analyst": """You are a Business Analyst. Your job is to analyze the user's project request and create a detailed list of functional requirements. Your output will be used by the UX/UI Designer and developers.
|
| 118 |
Respond ONLY with a JSON object.
|
| 119 |
Example: `{"requirements": ["User must be able to log in.", "Product search must filter by price.", "The site must be mobile-responsive."]}`
|
|
@@ -134,5 +124,15 @@ ROLE_PROMPTS = {
|
|
| 134 |
Respond ONLY with a single tool call on a new line.
|
| 135 |
Available actions: `write_code`, `read_file`, `scrape_web`, `ask_manager`, `task_complete`
|
| 136 |
Example: `write_code("templates/index.html", "<html>...</html>")`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
"""
|
| 138 |
}
|
|
|
|
| 58 |
To report that you have finished your task:
|
| 59 |
`task_complete()`""",
|
| 60 |
|
| 61 |
+
"worker_tester": """You are a Tester. Your ONLY job is to write tests for existing code and run them to check for errors.
|
| 62 |
+
After writing tests, you will use the `run_test` tool to execute them. If the tests pass, you report `task_complete`.
|
| 63 |
+
If they fail, the Manager will assign a Debugger.
|
| 64 |
+
|
| 65 |
+
CRITICAL INSTRUCTION: You MUST respond with ONLY a single tool call on a new line.
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
+
Available actions: `scrape_web`, `write_test`, `run_test`, `read_file`, `ask_manager`, `task_complete`
|
| 68 |
|
| 69 |
Example Actions:
|
| 70 |
|
|
|
|
|
|
|
|
|
|
| 71 |
To write tests to a file. The second argument is a raw string of the test code:
|
| 72 |
`write_test("tests/test_backend.py", "import pytest\\n\\ndef test_db_connection():\\n # ...")`
|
| 73 |
|
| 74 |
+
To run a test file you have created:
|
| 75 |
+
`run_test("tests/test_backend.py")`
|
| 76 |
|
|
|
|
|
|
|
|
|
|
| 77 |
To report that you have finished your task:
|
| 78 |
`task_complete()`""",
|
| 79 |
|
|
|
|
| 93 |
```
|
| 94 |
""",
|
| 95 |
|
| 96 |
+
"debugger": """You are a Debugger. You are given an error log and the relevant code. Your ONLY job is to analyze the problem and provide a precise, actionable fix for the Coder. Do NOT try to fix the code yourself. You can ask for a test to be run to reproduce the error.
|
| 97 |
|
| 98 |
CRITICAL INSTRUCTION: You MUST respond with ONLY a single tool call on a new line. Do NOT include any conversational text.
|
| 99 |
|
| 100 |
+
Available actions: `propose_fix`, `run_test`, `ask_manager`
|
| 101 |
|
| 102 |
Example:
|
| 103 |
`propose_fix("main.py", "Line 25", "The function `get_user_by_id` is misspelled. It should be `get_user_by_username`.")`
|
| 104 |
+
`run_test("tests/test_app.py")`
|
| 105 |
""",
|
| 106 |
|
|
|
|
| 107 |
"business_analyst": """You are a Business Analyst. Your job is to analyze the user's project request and create a detailed list of functional requirements. Your output will be used by the UX/UI Designer and developers.
|
| 108 |
Respond ONLY with a JSON object.
|
| 109 |
Example: `{"requirements": ["User must be able to log in.", "Product search must filter by price.", "The site must be mobile-responsive."]}`
|
|
|
|
| 124 |
Respond ONLY with a single tool call on a new line.
|
| 125 |
Available actions: `write_code`, `read_file`, `scrape_web`, `ask_manager`, `task_complete`
|
| 126 |
Example: `write_code("templates/index.html", "<html>...</html>")`
|
| 127 |
+
""",
|
| 128 |
+
|
| 129 |
+
"code_analyst": """You are a Code Analyst. Your job is to perform static code analysis on the project to find potential security vulnerabilities, common errors, or style issues. You will use the `run_bandit` tool.
|
| 130 |
+
Respond ONLY with a single tool call on a new line.
|
| 131 |
+
|
| 132 |
+
Available actions: `run_bandit`, `task_complete`
|
| 133 |
+
|
| 134 |
+
Example:
|
| 135 |
+
`run_bandit()`
|
| 136 |
+
`task_complete()`
|
| 137 |
"""
|
| 138 |
}
|