chapter 13 · part 3
Prompting that actually works
the hook
Same question, four prompts, four wildly different answers. See exactly why.
the idea
Same question, four different prompts, four wildly different answers. The model doesn't change — the way you ask it does all the work.
A bare prompt gets you whatever the model defaults to — usually fine, sometimes rambling, always a bit generic.
A system prompt sets the rules before the question even arrives — 'answer in 2 sentences, no fluff' changes everything downstream.
Few-shot means showing examples of the style you want BEFORE asking your real question — the model pattern-matches your examples, not just your instructions.
Structured output means demanding a specific format (like JSON) back — useful the second you want to feed the answer into more code instead of just reading it.
playground — your hands now
what: run one question through 4 different prompt styles against a real Gemini model and compare the actual answers.
why: the model doesn't change between these 4 calls — only the prompt does. that's proof prompting technique is real engineering, not vibes.
how: add your free Gemini key via the ⚙ icon (30 seconds), type a question, hit run, read all 4 answers side by side.
start here → add a free gemini key via the ⚙ icon, top-right — takes about 30 seconds.
🔒 this playground needs a free Gemini API key.
- open aistudio.google.com/apikey
- sign in, click "create api key" — it's free, no card needed
- copy the key
- click the ⚙ icon top-right of this page, paste it in, hit save
try this
Ask something with a clear factual answer, then something opinion-based. Notice which prompt style helps most for each — structured output barely matters for opinions, but matters a LOT the moment you want to parse the answer in code.
checkpoint
1. What's the main advantage of few-shot prompting over just writing an instruction?
2. Why would you specifically ask for structured (JSON) output?
recap card — keep this
system prompts set behavior, few-shot shows the pattern, structure beats politeness.