Skip to content

Exercise 02 — Structured Job Extractor

Timebox: 30-45 minutes

Goal

Turn extract_job.py into a reliable structured-output extractor for job postings.

Work in

  • extract_job.py
  • sample_job_posting.txt

Tasks

  1. Keep the output schema strict.
  2. Replace the mock response with a real structured-output or tool-call flow.
  3. Retry when validation fails.
  4. Handle missing compensation fields gracefully.
  5. Batch-process multiple postings when the single-item path works.

Done when

  • The output validates against the schema
  • Bad responses fail clearly instead of silently
  • The script can process the sample posting end-to-end