Skip to main content

提示词工程

提示词工程

什么是提示工程?

提示工程是一门经验科学,涉及迭代和测试提示以优化性能。提示工程周期中大部分的努力实际上并不在于编写提示。相反,提示工程时间的大部分花在开发一套强大的评估上,然后根据这些评估进行测试和迭代。

通过 Claude 的提示词交互课程,要达到如下目的:

  1. 掌握好的提示词的基本结构。
  2. 能够识别出常见的不好的模式,以及学会“80/20”技巧来解决这些问题。
  3. 理解 Claude 的优势与弱势。
  4. 从头开始创建强健的提示词。

1. 提示词基本结构

"User" and "Assistant" 消息要交替出现。这个规则太不好了。

系统提示词是一种在“用户”轮次向 Claude 提出问题或任务之前为其提供背景、说明和指南的方法。

You can use a system prompt to give Claude instructions and guidelines. A system prompt is a way to provide context, instructions, and guidelines to Claude before presenting it with a question or task in the "User" turn.

Structurally, system prompts exist separately from the list of User & Assistant messages, and thus belong in a separate "system prompt" parameter when using CLAUDEMESSAGES(). To make this easy for you in this tutorial, we've provided system prompt input boxes that feed into a complete CLAUDEMESSAGES() formula used to call Claude.

2. 清楚且直接