Schemas, Pydantic, and validation — making the model return real data — step 7 of 9
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.read, then continue.
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.
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.