Decorator

Partial-completion prefix instead of a formatting rule

prompt engineering · works with Gemini 2.5 Flash · via Google (Gemini API docs)

The prompt

Valid fields are cheeseburger, hamburger, fries, and drink.
Order: Give me a cheeseburger and fries
Output:
```
{
"cheeseburger": 1,
"fries": 1
}
```
Order: I want two burgers, a drink, and fries.
Output:

Expected result

{"hamburger": 2, "drink": 1, "fries": 1} — only the ordered items appear; unordered fields like cheeseburger are correctly omitted rather than listed as 0.

Why it works

Instead of writing a natural-language rule like "omit fields that weren't ordered" and hoping it's interpreted correctly, this shows one worked example ending exactly where the model should pick up, then leaves the output open — the model completes the pattern rather than following an instruction about the pattern.

Open in PrompVite to copy, rate, and discuss this prompt →