Objective
You should be able to design prompts that survive real user variability.
Prompt anatomy
A robust prompt often includes:
- Role or perspective.
- Task objective.
- Constraints and non-goals.
- Input delimiters.
- Output schema.
Few-shot usage
Examples reduce ambiguity. Show one or two ideal outputs when style or schema matters.
In our store assistant, you can provide examples of complaint summaries with required fields:
- issue_type
- urgency
- customer_sentiment
- action_recommendation
Structured outputs
When integrating with backend systems, demand JSON shape explicitly. This avoids brittle regex parsing and improves reliability.
Worked example (online store)
Prompting a support triage assistant:
- Input: raw customer message.
- Output: strict JSON with known keys.
- Constraint: if confidence is low, return
needs_human_review: true.
This design turns model output into a safer workflow primitive.
Three takeaways
- Prompting is product interface design.
- Few-shot examples improve consistency.
- Structured outputs reduce integration risk.