Spaces:
Sleeping
Sleeping
Download evaluate.py from largebunny/Automatron: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/largebunny/Automatron/resolve/main/evaluate.py
- Command line
-
hf download hf://spaces/largebunny/Automatron/evaluate.py
-
curl -L -o evaluate.py https://huggingface.co/spaces/largebunny/Automatron/resolve/main/evaluate.py
626 Bytes
| from cyber_env.env import DevSecOpsEnv | |
| from cyber_env.schemas import ReadFileAction, SearchReplaceAction, RunSecurityScanAction, RunUnitTestsAction | |
| # Initialize the env | |
| env = DevSecOpsEnv(task_name="task_1") | |
| # Example actions | |
| action1 = ReadFileAction(filepath="app.py") | |
| env.step(action1) | |
| action2 = SearchReplaceAction(filepath="app.py", old_snippet='API_KEY = "sk-1234567890abcdef"', new_snippet="API_KEY = os.getenv('API_KEY')") | |
| env.step(action2) | |
| action3 = RunSecurityScanAction() | |
| env.step(action3) | |
| action4 = RunUnitTestsAction() | |
| env.step(action4) | |
| # Print Final Score | |
| print("Final Score:", env.score()) # Should be 1.0 |