How do I get structured JSON back from a run?
output is free text, so ask for structure explicitly:
"When done, save a file named result.json as an output with this shape: {"tests_passed": number, "tests_failed": number, "notes": string}. Reply with only 'done'."
Then read it:
run = requests.get(f"{BASE}/v1/runs/{run_id}?include=files", headers=headers).json()
result = json.loads(next(f["content"] for f in run["files"] if f["name"] == "result.json"))
Validate the JSON in your code: treat it like any untrusted input.
Learn more#
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.