Prompt Engineering 简明教程
Prompt Engineering - Constructive Critic Prompts
使用建设性批评提示,我们可以鼓励 ChatGPT 提供有见解且可操作的批评,使用户能够接收宝贵的改进或完善输入。
Using Constructive Critic Prompting, we can encourage ChatGPT to deliver insightful and actionable criticism, enabling users to receive valuable input for improvement or refinement.
在本章中,我们将探讨建设性批评提示的概念,以及如何使用它来指导 ChatGPT 以建设性方式提供有用的反馈、评论或建议。
In this chapter, we will explore the concept of Constructive Critic Prompting and how it can be used to instruct ChatGPT to provide helpful feedback, reviews, or suggestions in a constructive manner.
What is Constructive Critic Prompting?
建设性批评提示涉及设计提示,指导 ChatGPT 提供建设性反馈、评论或评估。目的是引导模型以支持性和积极的方式提供批评,在突出优点的同时关注改进领域。
Constructive Critic Prompting involves designing prompts that instruct ChatGPT to provide constructive feedback, reviews, or evaluations. The aim is to guide the model to offer criticism in a supportive and positive manner, focusing on areas of improvement while highlighting strengths.
Benefits of Constructive Critic Prompting
建设性批评提示提供了多种好处−
Constructive Critic Prompting offers several benefits −
-
Valuable Feedback − Users receive detailed and helpful feedback that aids in refining ideas, content, or solutions.
-
Skill Improvement − Constructive criticism allows users to identify areas of improvement, fostering skill development and growth.
-
Positive User Experience − Feedback delivered in a constructive and supportive manner enhances the overall user experience and encourages further engagement.
Implementing Constructive Critic Prompting
Crafting Constructive Critic Prompts − 要实施建设性批评提示,请设计提示,指导 ChatGPT 以积极和建设性的语调进行评估并提供反馈。请参阅以下 example −
Crafting Constructive Critic Prompts − To implement Constructive Critic Prompting, design prompts that instruct ChatGPT to evaluate and provide feedback in a positive and constructive tone. Take a look at the following example −
User: Please evaluate my article on climate change and provide constructive feedback.
Model Interaction − 当 ChatGPT 遇到建设性批评提示时,它会通过提供既突出内容优点又突出改进领域的反馈来做出响应。这里有一个 example −
Model Interaction − When ChatGPT encounters a Constructive Critic Prompt, it responds by delivering feedback that highlights both the strengths of the content and areas for improvement. Here is an example −
User: Please evaluate my article on climate change and provide constructive feedback.
ChatGPT: Your article on climate change is well-researched and informative. The introduction effectively grabs the reader's attention. However, consider expanding on the potential solutions to address climate change to make the article even more impactful. Great effort overall!
Customizing the Feedback − 根据语境和用户的喜好,可以定制反馈中的详尽程度和重点强调的领域以满足特定要求。以下是一个 example −
Customizing the Feedback − Depending on the context and user preferences, the level of detail and the areas emphasized in the feedback can be tailored to meet specific requirements. Here is an example −
User: Please critique my design for the website's homepage.
ChatGPT: Your design for the website's homepage is visually appealing and user-friendly. However, consider optimizing the layout for mobile devices to ensure seamless navigation for mobile users. Additionally, explore using a more contrasting color scheme to enhance readability. Keep up the good work!
Applications of Constructive Critic Prompting
建设性批评提示可用于各种场景 −
Constructive Critic Prompting can be applied in various scenarios −
-
Content Review − Request valuable feedback on written content, design drafts, or marketing materials.
-
Code Review − Obtain constructive feedback on code snippets or programming projects.
-
Skill Enhancement − Use Constructive Critic Prompting for language learning or skill development exercises.
Best Practices for Chain of Thought Prompting
充分利用建设性批评提示,请考虑以下最佳实践 −
To make the most of Constructive Critic Prompting, consider the following best practices −
-
Specific Feedback Requests − Craft prompts that clearly outline the specific areas or aspects to be evaluated.
-
Positive Tone − Instruct ChatGPT to deliver feedback in a positive and encouraging manner, emphasizing both strengths and areas for improvement.
-
Tailored Feedback − Customize the feedback based on the context and user preferences, ensuring relevance and usefulness.
Example Application − Python Implementation
让我们探索一个使用指令与 ChatGPT 交互的 Python 脚本的实际示例。
Let’s explore a practical example of using the directive with a Python script that interacts with ChatGPT.
import openai
# Set your API key here
openai.api_key = 'YOUR_API_KEY'
def generate_chat_response(prompt):
response = openai.Completion.create(
engine="text-davinci-003",
prompt=prompt,
max_tokens=500,
temperature=0.7,
n=1,
stop=None
)
return response
user_prompt = "User: Please evaluate my article on climate change and provide constructive feedback. \n"
chat_prompt = user_prompt + "[Constructive Critic Prompting]"
response = generate_chat_response(chat_prompt)
print(response)
Output
在此,我们收到了以下建设性批评作为输出 −
Here, we received the following constructive criticism as the output −
The article provides a good overview of the key issues associated with climate change, but it could benefit from a more detailed analysis of the potential solutions. It would also be useful to include more specific examples of the impacts of climate change to provide context for the reader.
Additionally, it might be helpful to provide a more comprehensive overview of the different types of climate change and how they affect the environment.
Finally, it would be beneficial to include a conclusion that summarizes the main points of the article and provides the reader with some actionable steps they can take to help mitigate climate change.
Conclusion
建设性批评提示营造积极的用户体验,鼓励参与和持续增长。当你将建设性批评提示纳入你与 ChatGPT 的互动时,你可以期待收到周到和可操作的反馈,从而提升你的项目。
Constructive Critic Prompting fosters a positive user experience, encouraging engagement and continued growth. As you incorporate Constructive Critic Prompting into your interactions with ChatGPT, you can expect to receive thoughtful and actionable feedback that enhances your projects.