Your AI Trip Advisor 👋 — Step 3: Structured Output
Welcome back to HosseiNotes — your weekly 5-minute habit in AI engineering (with a side of fun 😅).
Last time, our Trip Advisor GPT got tool superpowers 🦸♂️ — it finally checked real weather, prices, and hotels before recommending Paris on a ramen budget. 💸
Great progress! But there’s still a problem: GPT gives you a chatty paragraph.
Fun to read, hard to use.
This week, let’s fix that. We’ll teach it to output results in a clean table (for humans)… and then in JSON (for machines).
Tables = handy for us.
JSON = handy for agents.
Together = handy for everyone. 😎
🛑 The Problem
Free-text answers look nice, but…
You can’t scan quickly.
You can’t compare options.
You can’t hand it to an agent or script.
🧩 The Upgrade: Structured Output
Instead of a rambly essay, tell GPT:
👉 “Present the final trip plan in a table with key details.”
Prompt snippet (add at the end):
IMPORTANT: Final Output — present the final recommendation in a single table with the columns:
Destination | Why it fits (short) | Weather | Travel (time & price) | Stay (avg/night) | Total.
🧪 Example Output (Table)
👉 Already way easier to digest than a wall of text.
🛠 Going One Step Further — JSON Mode
But tables are still for humans. What if you want an agent to:
auto-add the trip to your calendar 📆
track hotel/flight prices 💸
or even pre-book stuff (dangerously convenient 😅)?
Then you need machine-friendly output: JSON.
Prompt snippet:
IMPORTANT: The final output must be a JSON object only, with no additional text. Use only the following keys:
{
“origin”: “Madrid”,
“destination”: “Valencia”,
“budget_eur”: 300,
“weather”: “Sunny, 27C/19C”,
“travel”: {”mode”: “train”, “price_eur”: 60, “time_h”: 2},
“stay_avg_eur_per_night”: 80,
“total_estimate_eur”: 220,
“backup”: “Toledo”
}
⚡️ The Big Moment
Now let’s look at the output of the LLM 👇
💥 BOOOOM. Did you catch what just happened?!
With one tiny line — “return a JSON object only” — your GPT just went from a chatty travel buddy to a data-spitting machine. 🤯
This isn’t just “neater output.” This is:
Pure, structured data you can throw straight into a script.
A universal format that powers agents, apps, dashboards, alerts… you name it.
The exact bridge between “fun LLM demo” → real, usable systems.
👉 This is the unlock. Tables are nice, but JSON is the language of software.
And now your LLM speaks it. 🚀
🤯 Why This Matters (a.k.a. Why Engineers Get Excited)
Tables = friendly for humans, fast to skim.
JSON = fuel for agents, UIs, scripts.
With JSON you can:
📆 Auto-calendarize itineraries.
🧾 Track expenses from fields directly.
🔔 Re-run tool lookups daily and ping if cheaper options appear.
🧭 Chain into the next agent that books, maps, or notifies.
Basically: GPT stops being a travel blogger… and becomes a travel API. 🚀
✅ What You’ve Learned
📖 Paragraphs are for reading.
📊 Tables are for humans scanning.
🧩 JSON is for machines (and agents).
⚡ Together with tool use, structured output unlocks a whole new layer of automation and possibility.
TL;DR
Step-by-step reasoning + tool use + structured output = the backbone of AI agents.
Congrats 🎉 — you just leveled up your GPT from storyteller → system builder.
🔥 Next week, we’ll wrap up the Trip Advisor mini-series — and for my awesome subscribers, I’ll unlock HosseiNotes Private Repos with the full, final prompt we’ve been building together. Plus: an LLM benchmark showdown to see who’s the real Trip Advisor champ. 😎