structured output — making the model return json7 / 9
schemas, pydantic, and validation — making the model return real data
The model returned "5" (a string) for severity instead of 5 (an
int). The assert isinstance(...) check on line 6 fails. Fix line 4
so the script coerces severity to an int before validating.
Expected output:
severity: 5
The break is on line 4 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _