Roadmap to becoming a developer in 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2.1 KiB

Parts of a Prompt

When constructing a prompt, it's essential to understand the different parts that contribute to its effectiveness. A well-crafted prompt typically consists of context, instruction, and example. Understanding these parts will allow you to engineer prompts that elicit better and more precise responses.

  • Context: The context sets the stage for the information that follows. This may include defining key terms, describing relevant situations, or simply providing background information. Context helps the AI to understand the general theme or subject matter being addressed in the prompt.

    Example: In a writing request about composing an email, you may provide context by describing the purpose or background of the email, such as a follow-up after a meeting.

  1. Instruction: The instruction is the core component of the prompt. This is where you explicitly state the task or question that the AI is expected to perform or answer. It's important to be clear and direct with your instructions, specifying any guidelines or criteria for the response.

    Example: Using the email scenario, you could instruct the AI to "Write a follow-up email thanking the recipient for their time and summarizing the main discussion points of the meeting."

  2. Example: In some cases, it's helpful to provide one or more examples to guide or clarify the desired output. Examples can serve as a model for the AI and give an idea of what a successful response should look like. This is especially useful when the task is complex or has specific formatting requirements.

    Example: To further clarify the email-writing task, you might provide a brief example of the tone or structure you want, such as "Dear [Recipient], Thank you for taking the time to meet with me yesterday. We discussed [topic 1], [topic 2], and [topic 3]. I look forward to our future collaboration."

By considering these three parts of a prompt — context, instruction, and example — you can create effective and well-formed prompts that produce targeted and accurate responses from the AI.