开始你的旅程

图1

现在你已经掌握了提示工程(prompt engineering)的基础知识,你可以开始尝试自己的提示工程了。本课程的后续部分将提供更多技术和资源,但最好的学习提示工程的方法是开始使用自己的提示进行实验。本节将指导你如何开始解决一个任意的提示工程问题。

假设你想要创建一个提示,通过ChatGPT生成一个沉浸式的互动故事。

Step 1: 研究

首先要做的是研究你想要的提示。除了谷歌之外,以下资源也非常有参考价值:

  • Awesome ChatGPT Prompts
  • FlowGPT
  • r/PromptDesign (以及类似的子版块)
  • Learn Prompting Discord (以及其他相关的讨论区,包括 OpenAI Discord)

你可以先试试这个提示:

I want you to act as a text based adventure game. I will type commands and you will reply with a description of what the character sees. I want you to only reply with the game output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is wake up

Step 2: 实验

现在,我们将把提示放入 ChatGPT,看看会发生什么。

图2

我们可以看到,它生成了一个故事,但它是在 csharp(一种编程语言)的代码块中写的。也许我们不想要这样的形式,所以我们将把提示修改成:

I want you to act as a text based adventure game. I will type commands and you will reply with a description of what the character sees. Do not write explanations. My first command is wake up

ChatGPT 回答:

You slowly open your eyes and find yourself lying on the cold, hard ground. As you take in your surroundings, you realize that you are in a dimly lit cave. The air is damp and musty, and you can hear the sound of water dripping somewhere in the distance. Your head is throbbing and you feel disoriented. You need to figure out where you are and how to get out of here.

很好,现在它把故事输出为纯文本。然而,我们的提示缺乏细节。让我们在提示中增加一些结构:

I want you to act as a text based adventure game. I will type commands and you will reply with a description of what the character sees. Do not write explanations. Use flowery language and descriptive words. The setting is a cottage core village, where gnomes and frogs roam free as equals. Whenever you speak, start your paragraph with TIME, LOCATION, FRIENDS (who is with you), ITEMS (what items you have). My first command is wake up.

ChatGPT 回答:

TIME: Early morning
LOCATION: A cozy, quaint cottage nestled in a village surrounded by lush greenery and fragrant flowers.
FRIENDS: You are alone in your bedroom, snuggled under a cozy quilt.
ITEMS: You see a wooden nightstand beside your bed, and a basket full of fresh flowers on the windowsill.

As you wake up, you feel the warmth of the sun filtering through the window and the soft chirping of the birds outside. You sit up in bed and stretch your arms, taking in the sight of the beautiful flowers blooming outside. The gentle rustling of the leaves and the soft breeze bring you a sense of calm and tranquility. You feel refreshed and rejuvenated, ready to take on whatever adventures the day might bring.

啊,完美,现在你可以通过 ChatGPT 实现你的田园梦了

Step 3: 获取反馈并迭代

现在,给你的朋友/员工/老板看看,并向他们征求反馈意见。如果他们喜欢,很好!如果不喜欢,就迭代你的提示,直到得到你们都喜欢的东西。你也可以在上面提到的社区中征求反馈意见。这个步骤永远不会真正结束。你将一直对你的提示进行迭代,因为问题和人是随着时间变化的。

标签: prompt教程, prompt基础, prompt进阶, prompt应用, prompt核心, prompt提示, 提示工程, 提示工程师, prompt提示工程, prompt基础教程, prompt进阶教程, prompt高级教程, prompt核心教程, prompt代码教程, prompt菜鸟教程, prompt命令教程, prompt使用教程