Dashboard/Week 7/Day 2
WEEK 7 · TUESDAY

Week 7 · Day 2 — Structured Output: Getting AI to Speak Python

2.2 hours·14 sections
Section 1 of 140/14 done

Week 7 · Day 2 — Structured Output: Getting AI to Speak Python

Week 7: "Going Pro" | Day 2 of 5 Theme: JSON responses, parsing AI output, building reliable AI tools


The Problem with Free-Text AI Responses

Yesterday you got AI to write analysis text. That's cool. But can your code use that text?

response = "The player shows exceptional vision and passing range, particularly in tight spaces..."

How do you extract the rating from that? How do you pull out the "strength" vs "weakness"? You can't reliably — the format changes every time.

Structured output = telling the AI to respond in a specific format (JSON) that Python can parse every time.

# Unreliable: "His main strength is his passing, rating around 85/100"
# Reliable:   {"strength": "passing", "rating": 85, "confidence": "high"}

The second version your code can always work with.