-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (24 loc) · 1.08 KB
/
Copy pathmain.py
File metadata and controls
31 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from agents.deploy_bot import get_deploybot_agent
from agents.debug_bot import get_debugbot_agent
from agents.test_bot import get_testbot_agent
from agents.sec_bot import get_secbot_agent
def auto_devops_pipeline():
print("AutoDevOps Pipeline Starting \n")
debugbot = get_debugbot_agent()
buggy_code = "def divide(a, b): return a / b"
error_message = "ZeroDivisionError: division by zero"
fix_prompt = f"Fix this code: {buggy_code}. Suggestion: Handle {error_message} with try/except."
fixed_code = debugbot.run(fix_prompt)
secbot = get_secbot_agent()
sec_result = secbot.run(fixed_code)
testbot = get_testbot_agent()
test_result = testbot.run(fixed_code)
deploybot = get_deploybot_agent()
deploy_result = deploybot.run("Deploy the image 'autodevops/api:latest'")
print("\nDebugBot Output:\n", fixed_code)
print("\nSecBot Output:\n", sec_result)
print("\nTestBot Output:\n", test_result)
print("\nDeployBot Output:\n", deploy_result)
print("\nAutoDevOps Simulation Complete!")
if __name__ == "__main__":
auto_devops_pipeline()