Prompt engineering

awesome-chatgpt-zh

RICDOE

When crafting a prompt, consider these important components: Role, Instruction, Context, Input, Output, and optional Examples.

  1. 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.

  2. 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.

  3. Context: You provide the background or setting for the prompt. This could include the target audience, the style of response, the time frame, etc.

  4. 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.

  5. 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.

  6. 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.

Here are the 6 key components that make up the perfect formula for ChatGPT and Google Bard: Task, Context, Exemplars, Persona, Format, and Tone.