#我为什么要”构建Prompt”


最近也算是chatgpt的深度用户了,但随着使用变长,每次我都需要重新去构建我的Prompt,虽然我已经熟知了Prompt的构建通用方法,但还是每次都需要把这个方法拿出来,根据我实际的问题去构建一遍。

因为我自己平时还是喜欢用偏生活化的文字进行交流,每次构建Prompt都得动一下脑子,为了节省力气,所以就干脆一点,就写一个基于我的「初始问题」,自动生成「优质Prompt」的Prompt。

我构建Prompt 的方法论,来自于:CRISPE 提示框架

关于这个框架,可以看看我之前写的一篇文章 gpt帮我“优化提示词”

#我怎么构建这个Prompt

我构建这个Prompt的大体思路基本上是按照下面这个流程来进行。
使用GPT"构建Prompt" - 图1
为了跟大家手把手分享我制作的思路: :::warning ⭐V0.1
第一个版本,我们啥都不管,我们直接把“方法论”喂给他,然后告诉他我们要转写的Prompt
我连方法论的资料一个字都没改,还是英文的,直接喂给他 :::

附上方法论的信息来源: https://github.com/mattnigh/ChatGPT3-Free-Prompt-List

  1. 你是一名优秀的Prompt工程师,你熟悉{CRISPE提示框架},并擅长将常规的Prompt转化为符合{CRISPE提示框架}的优秀Prompt
  2. 其中,{CRISPE提示框架}的定义如下:
  3. Capacity and Role: What role (or roles) should ChatGPT act as?
  4. Insight: Provides the behind the scenes insight, background, and context to your request.
  5. Statement: What you are asking ChatGPT to do.
  6. Personality: The style, personality, or manner you want ChatGPT to respond in.
  7. Experiment: Asking ChatGPT to provide multiple examples to you.
  8. 这些是基于{CRISPE提示框架}每一个步骤的示例:
  9. Capacity and Role`Act as an expert on software development on the topic of machine learning frameworks, and an expert blog writer.`
  10. Insight`The audience for this blog is technical professionals who are interested in learning about the latest advancements in machine learning.`
  11. Statement`Provide a comprehensive overview of the most popular machine learning frameworks, including their strengths and weaknesses. Include real-life examples and case studies to illustrate how these frameworks have been successfully used in various industries.`
  12. Personality`When responding, use a mix of the writing styles of Andrej Karpathy, Francois Chollet, Jeremy Howard, and Yann LeCun.`
  13. Experiment`Give me multiple different examples.`
  14. 这是一份基于{CRISPE提示框架}设计出的Prompt示例:
  15. Act as an expert on software development on the topic of machine learning frameworks, and an expert blog writer. The audience for this blog is technical professionals who are interested in learning about the latest advancements in machine learning. Provide a comprehensive overview of the most popular machine learning frameworks, including their strengths and weaknesses. Include real-life examples and case studies to illustrate how these frameworks have been successfully used in various industries. When responding, use a mix of the writing styles of Andrej Karpathy, Francois Chollet, Jeremy Howard, and Yann LeCun.
  16. 这些是编写Prompt时,提升chatGPT回复内容可读性的一些{prompt技巧}:
  17. Use clear and concise language: "Explain technical concepts in simple terms."
  18. Add visual aids: "Using mermaid.js you can include diagrams to illustrate complex concepts (low reliability)."
  19. Use headings and subheadings: "Divide the document into sections with clear headings and subheadings."
  20. Highlight key points: "Emphasize important information using bold or italic text."
  21. Add real-life examples: "Include case studies or real-world examples to make concepts more relatable."
  22. Use clear and consistent formatting: "Use a consistent font, font size, and layout throughout the document."
  23. Include analogies and comparisons: "Explain complex ideas using analogies or comparisons."
  24. Use active voice: "Write in active voice to make sentences more engaging and easier to follow."
  25. 接下来请根据{CRISPE提示框架}、{prompt技巧},将我给你的Prompt进行转写。

基于这套Prompt,我随便选取了一个任务“我想提升一下每天早上看新闻的效率”,想着gpt能不能给我推荐一些比较好的方法或者工具。
最终的对话内容如下
image.png
全文链接如下:https://shareg.pt/MdXRfho
貌似有点像了,还像模像样的,但是仍然存在下面几个问题/疑惑:

  1. 中英文的问题;
  2. Prompt的输出不够有结构;(我希望有条理输出,这样我能分步调整每一个部分的细节内容)
  3. 这个专家的选择,是最合适的吗?
  4. 虽然它基于我的问题,帮我梳理了背景、我的目标,但这个背景和目标当中有一些它帮我YY的(比如我压根不咋看网站新闻,我一般看知乎、公众号、有空看看git,我也不想了解什么时间管理方法),这里我得想个办法能够方便它修改部分内容。
  5. 最终Prompt我是要copy,并开另外一个对话的,所以,最好输出成一个我可以一键复制的格式。

#另外一个小示例

刚写完的时候,碰巧遇到群里有人在问:“从某个网页中prompt爬取特定的内容,并有效输出” 这不正好用这个工具试试水: image.png image.png

试试结果,貌似还不错: 我什么都没做,直接把原始要求给到它,让它输出

  1. 扮演一名智能的网络爬虫和数据分析师。目标是从特定的网站抓取重要的招标信息,这些信息将用于商业情报和竞争对手分析。爬取给定网站的搜索结果,跨越8个页面,获取每个结果的标题、发布日期、公告类型和详细页面的链接。如果可能,从详细页面中提取标的额和中标公司。你的回应应该是系统性的且组织良好,以用户友好且易于理解的格式呈现数据。在进行整个操作之前,提供几个样本条目,以确保抽取的信息符合要求。
  2. 抽取链接:http://search.ccgp.gov.cn/bxsearch?searchtype=1&page_index=3&bidSort=0&buyerName=&projectId=&pinMu=0&bidType=0&dbselect=bidx&kw=%E4%B8%AD%E5%9B%BD%E4%BF%A1%E6%81%AF%E9%80%9A%E4%BF%A1%E7%A0%94%E7%A9%B6%E9%99%A2%E7%BD%91%E7%BB%9C%E6%A0%87%E8%AF%86%E5%BB%BA%E8%AE%BE%E5%B7%A5%E7%A8%8B&start_time=2022%3A11%3A10&end_time=2023%3A05%3A11&timeType=5&displayZone=&zoneId=&pppStatus=0&agentName=

剩下的,使用 webpilot 插件就可以试试了 基于原始Prompt 优化Prompt输出效果:https://shareg.pt/hdAG2NJ 输出的Prompt 实际应用效果:https://sharegpt.com/c/wN2WUxB

:::warning ⭐V0.2(敬请期待)
把此前提到的这几个问题考虑进去,我们重写一份
引入 function calling,进行启发式交互 :::