# 场景2：基于示例回答

### 场景介绍[​](https://learningprompt.wiki/docs/chatGPT/tutorial-basics/%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%20&%20%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7/%E5%9C%BA%E6%99%AF2%EF%BC%9A%E5%9F%BA%E4%BA%8E%E7%A4%BA%E4%BE%8B%E5%9B%9E%E7%AD%94#%E5%9C%BA%E6%99%AF%E4%BB%8B%E7%BB%8D) <a href="#chang-jing-jie-shao" id="chang-jing-jie-shao"></a>

在某些场景下，我们能比较简单地向 AI 描述出什么能做，什么不能做。但有些场景，有些需求很难通过文字指令传递给 AI，即使描述出来了，AI 也不能很好地理解。

比如给宠物起英文名，里面会夹杂着一些所谓的名字风格。此时你就可以在 prompt 里增加一些例子，我们看看这个例子。

这个是没有任何示例的 Prompt：

```
Suggest three names for a horse that is a superhero.
```

Output 如下所示。第一个感觉还行，第二个 Captain 有 hero 的感觉，但 Canter 就像是说这匹马跑得很慢，感觉不太合适，而且三个都比较一般，不够酷。

```
Thunder Hooves, Captain Canter, Mighty Gallop
```

### **技巧 2：增加示例**[​](https://learningprompt.wiki/docs/chatGPT/tutorial-basics/%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%20&%20%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7/%E5%9C%BA%E6%99%AF2%EF%BC%9A%E5%9F%BA%E4%BA%8E%E7%A4%BA%E4%BE%8B%E5%9B%9E%E7%AD%94#%E6%8A%80%E5%B7%A7-2%E5%A2%9E%E5%8A%A0%E7%A4%BA%E4%BE%8B) <a href="#ji-qiao-2-zeng-jia-shi-li" id="ji-qiao-2-zeng-jia-shi-li"></a>

如果你无法用文字准确解释问题或指示，你可以在 prompt 里增加一些案例：

```
Suggest three names for an animal that is a superhero.

Animal: Cat
Names: Captain Sharpclaw, Agent Fluffball, The Incredible Feline
Animal: Dog
Names: Ruff the Protector, Wonder Canine, Sir Barks-a-Lot
Animal: Horse
Names:
```

增加例子后，Output 的结果就更酷一些，或者说是接近我想要的那种风格的名字。

```
Gallop Guardian, Equine Avenger, The Mighty Stallion
```

以下是一些场景案例，我整理了两个 Less Effective（不太有效的）和 Better（更好的）prompt，你可以自己尝试下这些案例：

| 场景            | Less Effective                                                                                                                     | Better                                                                                                                                                                                                                                                                                     | 原因                                |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
| 起产品名          | <p>Product description: A pair of shoes that can fit any foot size.<br>Seed words: adaptable, fit, omni-fit.<br>Product names:</p> | <p>Product description: A home milkshake maker<br>Seed words: fast, healthy, compact.<br>Product names: HomeShaker, Fit Shaker, QuickShake, Shake Maker<br>Product description: A pair of shoes that can fit any foot size.<br>Seed words: adaptable, fit, omni-fit.<br>Product names:</p> | 可以在下方运行这个案例，在不给示例的情况下 AI 会给你什么答案。 |
| 将电影名称转为 emoji | Convert Star Wars into emoji                                                                                                       | <p>Convert movie titles into emoji.<br>Back to the Future: 👨👴🚗🕒<br>Batman: 🤵🦇<br>Transformers: 🚗🤖<br>Star Wars:</p>                                                                                                                                                                | 可以在下方运行这个案例，在不给示例的情况下 AI 会给你什么答案。 |

\
🔴

你可能在试用此技巧的时候发现，即使给了案例，模型也不一定会返回正确的答案，此时你就需要用到更高级的技巧，在高级篇我会讲如何优化这个提示，从而让结果更加准确。

<br>
