1. Learn
  2. /
  3. Courses
  4. /
  5. Prompt Engineering with the OpenAI API

Connected

Exercise

Building specific and precise prompts

In the previous exercise, you generated text that completes a given story. Your team was happy with your achievement, however, they want you to follow specific guidelines when it comes to length and style. Your task now is to craft a more specific prompt that controls these aspects of the generated story.

The OpenAI package, the get_response() function, and the same story variable have been pre-loaded for you.

Instructions

100 XP
  • Craft a prompt that completes the given story with only two paragraphs in the style of Shakespeare; use f-string, and delimit the story with triple backticks (```).