Download test_api.py from Himasree/sre-bench: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/spaces/Himasree/sre-bench/resolve/main/test_api.py
- Command line
-
hf download hf://spaces/Himasree/sre-bench/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/Himasree/sre-bench/resolve/main/test_api.py
583 Bytes
| import requests | |
| import json | |
| base_url = "http://127.0.0.1:7860" | |
| print("--- Testing Reset ---") | |
| reset_payload = {"task_name": "alert-classifier", "seed": 42} | |
| r = requests.post(f"{base_url}/reset", json=reset_payload) | |
| print(f"Status: {r.status_code}") | |
| print(f"Body: {r.text}") | |
| if r.status_code == 200: | |
| print("\n--- Testing Step ---") | |
| step_payload = { | |
| "action": { | |
| "tool": "list_alerts", | |
| "params": {} | |
| } | |
| } | |
| r = requests.post(f"{base_url}/step", json=step_payload) | |
| print(f"Status: {r.status_code}") | |
| print(f"Body: {r.text}") | |