promptdojo_

Build the parse-and-validate step. Write a function extract_user(raw) that takes a JSON string the model returned, parses it with json.loads, validates that:

  • name is present and a str
  • age is present and an int

If the JSON is missing a field or has the wrong type, return the string "invalid". Otherwise return the parsed dict.

Then the script will call it on a good response and print the name.

Expected output:

priya

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.

open this same url on a laptop to keep going today.