Prompt engineering
When crafting a prompt, consider these important components: Role, Instruction, Context, Input, Output, and optional Examples.
-
Role: Consider this a role-playing game where you instruct the AI to “act as” a particular character or entity. It could be anything from a detective solving a mystery to a language translator.
-
Instruction: Here, you’re telling the AI what to do. “Write a poem,” “Answer this question,” “Translate this text,” are all examples of instructions. It’s your ‘command’ to the AI.
-
Context: You provide the background or setting for the prompt. This could include the target audience, the style of response, the time frame, etc.
-
Input Data: This refers to the specific topic or content you want the AI to focus on. This is very important, especially when you create prompt templates.
-
Output: How do you want your response? This could be in the form of paragraphs, bullet points, a JSON, an XML, a table, a list, a graph, or any other structure. You can shape the AI’s response as you need.
-
Example (optional): Providing an example can be useful in some scenarios, as it can help guide the AI’s output. It’s like showing the AI a snapshot of what you want.