AI Prompt Engineering

From LemonWiki共筆
Revision as of 18:59, 14 November 2024 by Planetoid (talk | contribs)
Jump to navigation Jump to search

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