Rahul-8799 commited on
Commit
7d8d0a2
·
verified ·
1 Parent(s): 8b2be02

Create run_pipeline_and_save.py

Browse files
Files changed (1) hide show
  1. utils/run_pipeline_and_save.py +37 -0
utils/run_pipeline_and_save.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from agents import (
2
+ product_manager_agent,
3
+ project_manager_agent,
4
+ software_architect_agent,
5
+ software_engineer_agent,
6
+ quality_assurance_agent,
7
+ )
8
+ import os
9
+ import json
10
+
11
+ os.makedirs("output", exist_ok=True)
12
+
13
+ def run_pipeline_and_save(prompt):
14
+ log = []
15
+
16
+ pm_out = product_manager_agent.run(prompt)
17
+ log.append({"Product Manager": pm_out})
18
+
19
+ proj_out = project_manager_agent.run(pm_out)
20
+ log.append({"Project Manager": proj_out})
21
+
22
+ arch_out = software_architect_agent.run(proj_out)
23
+ log.append({"Software Architect": arch_out})
24
+
25
+ eng_out = software_engineer_agent.run(arch_out)
26
+ log.append({"Software Engineer": eng_out})
27
+
28
+ qa_out = quality_assurance_agent.run(eng_out)
29
+ log.append({"QA": qa_out})
30
+
31
+ with open("output/agent_log.json", "w") as f:
32
+ json.dump(log, f, indent=2)
33
+
34
+ with open("output/final_output.html", "w") as f:
35
+ f.write(eng_out)
36
+
37
+ return log, eng_out