Spaces:
Sleeping
Sleeping
Create run.py
Browse files
run.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from macg.llm import ManualLLM
|
| 2 |
+
from macg.agents.coder import CoderAgent
|
| 3 |
+
from macg.agents.reviewer import ReviewerAgent
|
| 4 |
+
from macg.agents.tester import TesterAgent
|
| 5 |
+
from macg.orchestrator import Orchestrator
|
| 6 |
+
|
| 7 |
+
def main() -> None:
|
| 8 |
+
llm = ManualLLM()
|
| 9 |
+
coder = CoderAgent(llm)
|
| 10 |
+
reviewer = ReviewerAgent(llm=None) # start small: static review only
|
| 11 |
+
tester = TesterAgent(llm)
|
| 12 |
+
orch = Orchestrator(coder, reviewer, tester)
|
| 13 |
+
|
| 14 |
+
task = "Implement a function fizzbuzz(n: int) -> list[str] that returns 1..n with Fizz/Buzz rules."
|
| 15 |
+
result = orch.run(task, max_iters=2)
|
| 16 |
+
|
| 17 |
+
print("\n" + "="*80)
|
| 18 |
+
print("PASSED:", result.passed)
|
| 19 |
+
print("ITER:", result.iteration)
|
| 20 |
+
print("-"*80)
|
| 21 |
+
print("REVIEW NOTES:\n", result.review_notes)
|
| 22 |
+
print("-"*80)
|
| 23 |
+
print("CODE:\n", result.code)
|
| 24 |
+
print("-"*80)
|
| 25 |
+
print("TESTS:\n", result.tests)
|
| 26 |
+
print("-"*80)
|
| 27 |
+
print("TEST REPORT:\n", result.test_report)
|
| 28 |
+
print("="*80)
|
| 29 |
+
|
| 30 |
+
if __name__ == "__main__":
|
| 31 |
+
main()
|