Home > Articles

This chapter is from the book

Putting It All Together

Now that you know what you should and shouldn’t include in an AI prompt, let’s put it all together to look at how to construct a complete prompt. Referencing all the previously discussed elements, follow this format:

[task] [format] [topic] [tone] [context] [requirements/constraints] [optional elements]

For example, if you want to write a college-level paper about the Revolutionary War, you can identify the elements shown in Table 3.1.

TABLE 3.1 Elements of a Prompt for a Scholarly Paper

Element

Example

Task

Write a paper

Format

1,000 words in MLA format

Topic

Revolutionary War

Tone

Scholarly

Context

Audience of college history professors

Requirements/constraints

Include information about the role of the Founding Fathers

Optional elements

Convince the audience to provide additional funding for my research

Now all you have to do is put all that together in a prompt. Here’s what that might look like:

Write a 1,000-word paper in MLA format about the Revolutionary War. Use a scholarly tone appropriate for an audience of college history professors and include information about the role of the Founding Fathers. The goal is to convince the audience to provide additional funding for my research.

Figure 3.1 shows the beginning of the paper, as written by ChatGPT.

FIGURE 3.1

FIGURE 3.1

The opening paragraphs of a scholarly paper about the Revolutionary War, as created by ChatGPT.

Follow this format to create prompts for all types of tasks. As another example, let’s say you want to create a short story for a six-year-old boy about superheroes in his neighborhood. Table 3.2 details the necessary elements.

TABLE 3.2 Elements of a Prompt for a Children’s Story

Element

Example

Task

Tell me a bedtime story

Format

Less than five minutes long

Topic

Superheroes in our neighborhood

Tone

Lighthearted

Context

For a six-year-old boy

Requirements/constraints

Not scary

Optional elements

Help put the boy to sleep

And here’s the resulting prompt:

Tell me a bedtime story less than five minutes long about superheroes in our neighborhood for a six-year-old boy. The tone should be lighthearted, not scary, and help put the boy to sleep.

Figure 3.2 shows the beginning of just such a story, as written by DeepSeek.

FIGURE 3.2

FIGURE 3.2

The first part of a bedtime story about superheroes, as conceived by DeepSeek.

You can also use this approach to create prompts for images, videos, and music. For example, if you want to generate a photo of an older couple at the dinner table for a marketing brochure, you’d use the elements shown in Table 3.3.

TABLE 3.3 Elements of a Prompt to Create a Photographic Image

Element

Example

Task

Generate

Format

Photorealistic image in portrait format

Topic

Older couple sitting next to each other at a dinner table

Tone

Warm

Context

For a marketing brochure

Requirements/constraints

The couple should be holding hands and smiling.

Optional elements

Selling life insurance

Here’s the resulting prompt:

Generate a photorealistic image in landscape format of an older couple sitting next to each other at a dinner table. The vibe should be warm and appropriate for a marketing brochure. The couple should be holding hands and smiling. The goal is to help sell life insurance.

Figure 3.3 shows just one of the images generated by Midjourney from this prompt.

FIGURE 3.3

FIGURE 3.3

A photorealistic image of an older couple at the dinner table, as generated by Midjourney.

As you can see, when you follow this format and include the proper elements, you get pretty good results. It’s a good place to start with your prompt engineering.

And, to help you get started, here’s a blank form you can copy and use for your own prompt construction. It’s labeled as Table 3.4, but it’s really a prompt element template for your use.

TABLE 3.4 Prompt Element Template

Element

Your prompt

Task

 

Format

 

Topic

 

Tone

 

Context

 

Requirements/constraints

 

Optional elements

 

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.