Start learning free

LESSON 16 OF 129 · AI ENGINEERING: PROMPTS THAT HOLD UP

Clear Instructions

Practice

A model works from the words of your request and nothing else. Whatever you leave out, it has to guess: which product, for which reader, how long, in what tone. A clear instruction takes those guesses away. Write it the way you would brief a new coworker who knows nothing about your shop.

An example with another product: the first request leaves almost everything open. The second one says what to write, who will read it and how long it may be.

Vague:  Write about the lamp.

Clear:  Write a label for our Lamp for people who walk past the shop window.
        Use at most five words.
        Do not use exclamation marks.

Notice "at most five words". Something the model can count works better than a wish like "keep it short": short compared to what?

In this lesson you send two requests about the shop's Teapot and print both answers. The vague one gets a long text with emojis about teapots in general. The clear one gets one plain sentence for the product page:

Vague: Ah, the teapot! ☕ Few objects are loved in so many countries. … Shall I go on? ✨
Clear: Slow down and share a pot of tea with our classic Teapot.

Your task: the helper ask(prompt) is ready: it sends one user message and returns the reply's text. Print "Vague:" with the answer to "Write about the teapot.". Then build a prompt in clear from three pieces (what you want and who it is for, exactly one sentence, no emojis) and print "Clear:" with its answer.


Assignment
Follow the Coding Tutorial to turn a vague request into a clear instruction, one sentence at a time.


Hint
The pieces of clear are strings on their own lines inside one pair of parentheses; Python joins them into one string. End each piece with a space, so the sentences don't run together. Keep the tutorial's wording: the answer changes with the words of your prompt.


STEP 1 OF 6
    Ctrl + Enter to check