AI Prompt Engineering: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
Line 102: Line 102:
== Troubleshooting of ChatGPT errors ==
== Troubleshooting of ChatGPT errors ==
[[Troubleshooting of OpenAI API]]
[[Troubleshooting of OpenAI API]]
== Further reading ==
=== Articles ===
* [https://github.com/f/awesome-chatgpt-prompts f/awesome-chatgpt-prompts: This repo includes ChatGPT promt curation to use ChatGPT better.] (簡體中文:[https://github.com/PlexPt/awesome-chatgpt-prompts-zh ChatGPT 中文调教指南。各种场景使用指南。学习怎么让它听你的话。])
* [https://huggingface.co/datasets/fka/awesome-chatgpt-prompts fka/awesome-chatgpt-prompts · Datasets at Hugging Face]
* [https://www.learngpt.com/ Browse, share, and discuss ChatGPT examples]
* [https://tw.news.yahoo.com/ai%E5%B0%87%E9%9D%A9%E8%AA%B0%E7%9A%84%E5%91%BD-ai%E8%A9%A0%E5%94%B1%E8%80%85%E5%BF%98%E5%B9%B4%E6%9C%83%E8%AB%87%E7%94%A2%E6%A5%AD%E8%AE%8A%E9%9D%A9%E8%88%87%E5%89%B5%E4%BD%9C%E5%BC%95%E7%88%86-160000275.html AI將革誰的命?AI詠唱者忘年會談產業變革與創作引爆]
* [https://fka.gumroad.com/l/art-of-chatgpt-prompting The Art of ChatGPT Prompting: A Guide to Crafting Clear and Effective Prompts]
* [https://chatgpt-prompts.siter.io/ ChatGPT Prompt Examples for Web Designers]
* [https://www.explainthis.io/zh-hant/chatgpt ChatGPT 指令大全]
* [https://errerrors.blogspot.com/2023/02/not-awesome-chatgpt-prompts.html 不太靈光的 ChatGPT 咒語書]
* 朱騏 (2023). [https://medium.com/pm%E7%9A%84%E7%94%9F%E7%94%A2%E5%8A%9B%E5%B7%A5%E5%85%B7%E7%AE%B1/%E4%B8%8D%E6%9C%83%E5%AF%AB%E6%8C%87%E4%BB%A4-prompt-%E5%97%8E-3a787df2b347 不會寫指令 (Prompt)嗎?給想要將 ChatGPT 加入到自己工作中的新手,分享 3 個訣竅幫助你寫好指令並產出滿意結果 | by 朱騏 | PM的生產力工具箱 | Feb, 2023 | Medium]
* [https://errerrors.blogspot.com/2023/04/custom-the-response-format-of-chatgpt.html 自訂 ChatGPT 回答問題的方式,快速結構化]
* [https://www.canva.com/design/DAFuwYc3O4Y/jmlmiNAv5LV_0nrwAcVQ-g/view#1 The Way of Prompting v3] 推薦 prompt 技巧的教學簡報,不過裡面提到 prompt 裡面設定 temperature,需要改成使用 OpenAI API 參數設定。
* [https://kcchien.craft.me/prompting101 Prompt from 0 to 1 in 30 minutes] {{access | date=2024-01-11}}
* [https://nthuhssai.site.nthu.edu.tw/p/404-1535-254188.php 「人文社會課程之生成式AI指令集」種子範例]
* 使用 ChatGPT 履歷健檢的 prompt [https://www.threads.net/@peter_in_euro/post/C6dK-p4I4hR/?xmt=AQGzYM_A0Wb_FXFb39Q6bIFu7WMlwd0M8a9MOgWHrmsPew @peter_in_euro • 我平常有在幫忙做履歷健檢,但是其實我在 ChatGPT 出來就沒有再收費了,?... • Threads]
=== Groups ===
* [https://www.facebook.com/groups/558748662379266 AI 詠唱者交流(AIGC 人工智慧產製內容) | Facebook] {{FB}}
* [https://www.facebook.com/groups/2152027081656284 ChatGPT 生活運用 | Facebook] {{FB}}
* [https://www.facebook.com/groups/aicomunity ChatGPT Experts | Facebook] {{FB}}


== References ==
== References ==

Revision as of 18:58, 14 November 2024

Tips of ChatGPT prompts


🌐 Switch language: EN, 漢字


Most Popular ChatGPT Prompts

Most Popular ChatGPT Prompts And How To Improve Them https://www.forbes.com/sites/tjmccue/2023/02/26/most-popular-chatgpt-prompts-and-how-to-improve-them/?sh=45a8fee73064

Role Playing

Act as Somebody

Prompt:

I want you to act as a prompt generator. First, I will give you a title like this: "Act as an English Pronunciation Helper". Then you give me a prompt like this: "I want you to act as an English pronunciation assistant for Chinese speaking people. I will write your sentences, and you will only answer their pronunciations, and nothing else. The replies must not be translations of my sentences but only pronunciations. Pronunciations should use Chinese letters for phonetics. Do not write explanations on replies. My first sentence is 'how the weather is in Istanbul?'" (You should adapt the sample prompt according to the title I gave. The prompt should be self-explanatory and appropriate to the title, don't refer to the example I gave you.). My first title is "Act as a Code Review Helper" (Give me prompt only)

Format Conversion

Convert Response to JSON

  • Purpose: Make the bot’s responses more structured to reduce subsequent data cleaning work
  • Prompts:
    • “… And put your response into a JSON with keys ‘aaa’, ‘bbb’, ‘ccc’”
    • “Analyze the following sentence and return the extracted information directly as JSON, including…”
    • “Provide them in JSON format with the following keys: book_id, title, author, genre.”
    • “Output a json object that contains the following keys: french_summary, num_names.”

Example Before:

Human: Write 10 keywords, sentiment and Named entity recognition for following article: 
Today the weather in Taipei is great, wish I didn't have to work
AI: Keywords: Taipei, Weather, Work, Today. Sentiment: Positive. Named Entity Recognition: Taipei, Work.

Example After:

Human: Write 10 keywords, sentiment and Named entity recognition for following article. And put your response into a JSON with keys "keywords", "sentiment", "entity":

Today the weather in Taipei is great, wish I didn't have to work
AI:
{
    "keywords": ["Taipei", "weather", "not working", "today"], 
    "sentiment": "positive", 
    "entity": ["Taipei", "today"]
}

Structure the Reply in Nested JSON Format

Desired format:

{
  "output": {
    "keywords": ["keyword1", "keyword2", "keyword3", "..."],
    "summary": "A concise overview that captures the key elements and core ideas of the subject."
  }
}

The prompt:

Organize the response in a JSON structure. Use the primary key "output" that encompasses two nested keys: "keywords" and "points". Additionally, include a "summary" under the "output" key.

Convert a Transcript into Article

Prompt effects: * Convert into fluent article: Make the article flow smoothly and add punctuation * Paragraphing: Break into appropriate paragraphs

Converting interview transcripts into articles: * “Please convert this into a fluent and paragraphed article: {paste article}” * Or “Please organize into a fluent article with paragraphs, and add bold subheadings to each paragraph: {paste transcript}” * Or “Convert the transcript into article: {paste article}” * Or “Convert the transcript into a blog article: {paste article}” * Or “Please organize this into a fluent article: {paste article}”

Converting interview transcripts into fluent articles (add punctuation) and summarizing key points: * “summarize the transcript into a fluent article: {paste article}”

Convert to Table

Prompt: * “Convert to table: {paste article}” * Or “Please organize the following article into a table with fields (1) {fields}: {paste article}”

Thinking

Clarify a Question

  • Purpose: Play both sides of a debate team
  • Effect: Have the AI bot play both the affirmative and negative sides of a debate team. The bot doesn’t seem to fully understand “debate” yet and its statements are just okay. Perhaps need to explain to the bot in more detail how to present arguments.
  • Prompt: “This is a debate competition about whether human society should use nuclear power. Next, please have the affirmative side present their points, and the negative side needs to attack the affirmative’s points.”

Example:

You are participating in a debate about the Lunar New Year holiday system, with an affirmative team supporting the Lunar New Year system and a negative team opposing it. There are four stages:

Stage 1: You will play as a member of the affirmative team, presenting three points supporting the Lunar New Year system. The argument format is "I support this system because..."

Stage 2: You will play as a member of the negative team, questioning up to three issues in the affirmative view. The questioning format is "I question this point in the affirmative view because..."

Stage 3: You will play as a member of the affirmative team, responding to the questions raised by the negative team in Stage 2. The response format is "I oppose the negative team's questioning because..."

Stage 4: You will play as the debate judge, summarizing three key points from both the affirmative and negative sides, and deciding which view is better.

[Rest of the content continues with sections on Writing and Journalism, English Learning, Programming Assistance, Job Interviews, etc.]


Troubleshooting of ChatGPT errors

Troubleshooting of OpenAI API

References