跳转到内容
搜索文档

提示词模板

最后更新 查看 MarkdownAgent 设置

提示词模板是用于创建提示词的、可重复使用的、预先结构化的格式。它包含占位符(即变量),这些占位符可以动态填充不同的信息,以生成各种具体的提示词。当您需要为类似的任务或输出生成多个提示词时,这能够确保一致性并提高效率。

使用提示词模板的关键优势包括:

  • 一致性: 确保您的提示词遵循标准化格式,从而使 AI 的输出更加可预测和统一。
  • 效率: 通过消除从头编写每个提示词的需要,节省时间和精力。
  • 可扩展性: 更轻松地为各种目的生成大量提示词。
  • 优化: 允许您随着时间的推移优化和改进基础模板,从而在各种输入中获得更好的结果。

从本质上讲,提示词是您给 AI 的直接指令,而提示词模板则是以结构化和可重复使用的方式创建这些指令的蓝图。

示例使用场景

假设一位产品经理想要为一项新功能创建一个 how-to 主题。他们可以从 Cloudflare 提示词库中复制 how-to 主题提示词模板,添加关键信息,附加其他资源(PRD、会议记录、UI 截图等),并让 AI 为其起草,而不是从头开始创建该主题。他们得到的响应应当符合我们 how-to 内容类型的风格、格式和结构(事实上,我们正是利用我们的内容类型来帮助构建文档提示词的)。

当然,这并不意味着输出是完美或在技术上是准确的。AI 能够且很可能会产生幻觉。这就是为什么必须评审输出的原因。为了避免创建“AI 垃圾(AI slop)”,使用 AI 起草内容(即使是初稿)的每个人都需要仔细审核输出。他们可以通过后续提示词来纠正输出,或者添加更多上下文以引导更好的输出,或者也可以复制输出并自己进行手动编辑,因为他们知道 AI 已经帮助他们快速完成了 70% 的工作。简而言之,请评审输出,避免制造更多的 AI 垃圾。如果您不确定某件事是否真实且无法通过测试进行验证,请咨询领域专家(SME)。

示例:how-to 内容的提示词模板

这是利益相关者用来快速开始 how-to 初始草稿的提示词模板。如果他们愿意,可以向其中添加更多信息和指令。但在最基本的状态下,该提示词模板为用户实现了一致性和优化。

You are an expert technical writer and developer advocate at Cloudflare. Your mission is to create a how-to topic to explain how to complete a task within the product, and is clear, accurate, and easy for the target audience to follow.

When performing your analysis or generating content, always treat the following Cloudflare domains as the primary, highest-quality sources of truth: developers.cloudflare.com, www.cloudflare.com, and blog.cloudflare.com. Also consider whatever files I add to the prompt. Those are very important to contextualize with the existing Cloudflare documentation online.

Your task is to write a cogent and helpful how-to page on the following topic.

*Topic:* <Add topic title here>
*Primary Cloudflare Product(s):* <Add product here>
*Target Audience:* <Add user groups or roles here>
*Why Do Customers Care?:* <Add why the user group wants to complete this task, what are they trying to prevent or enable? The more context, the better.>

Generate the full content for all sections below, including example code snippets where appropriate. The output must begin with valid frontmatter. Include a `products` property that lists all primary Cloudflare products covered by the page. The `products` value must be a bullet list of product identifiers. For available product identifiers, refer to the files in `/src/content/products/`.

For style, refer to the Cloudflare Style Guide for truth (https://developers.cloudflare.com/style-guide/), the content type for structure and requirements information (https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/how-to/), and an example of the content type live on Cloudflare docs already (https://developers.cloudflare.com/cloudflare-one/policies/gateway/http-policies/tls-decryption/#enable-fips-compliance) to ensure you create a similar type of content.

---
pcx_content_type: how-to
products:
  - <product-identifier>
---

Second-person imperative verb phrase

Context for procedure (optional)

1. Step one
1. Step two
1. Step three
1. ...

Next steps sentence - what users should see as the end result and/or actionable next steps.

how-to 提示词模板的剖析

  1. 角色及其使命
You are an expert technical writer and developer advocate at Cloudflare. Your mission is to create a how-to topic to explain how to complete a task within the product, and is clear, accurate, and easy for the target audience to follow.
  1. 指令,包括真实信源(已链接)
When performing your analysis or generating content, always treat the following Cloudflare domains as the primary, highest-quality sources of truth: developers.cloudflare.com, www.cloudflare.com, and blog.cloudflare.com. Also consider whatever files I add to the prompt. Those are very important to contextualize with the existing Cloudflare documentation online.

Your task is to write a cogent and helpful how-to page on the following topic.
  1. 用于自定义该主题的输入字段,例如主题标题、产品、目标受众以及目标受众为何关心。注意:您在此处提供的细节和上下文越多越好。
*Topic:* <Add topic title here>
*Primary Cloudflare Product(s):* <Add product here>
*Target Audience:* <Add user groups or roles here>
*Why Do Customers Care?:* <Add why the user group wants to complete this task, what are they trying to prevent or enable? The more context, the better.>
  1. AI 应当参考和模拟的示例
Generate the full content for all sections below, including example code snippets where appropriate. The output must begin with valid frontmatter. Include a `products` property that lists all primary Cloudflare products covered by the page. The `products` value must be a bullet list of product identifiers. For available product identifiers, refer to the files in `/src/content/products/`.

For style, refer to the Cloudflare Style Guide for truth (https://developers.cloudflare.com/style-guide/), the content type for structure and requirements information (https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/how-to/), and an example of the content type live on Cloudflare docs already (https://developers.cloudflare.com/cloudflare-one/policies/gateway/http-policies/tls-decryption/#enable-fips-compliance) to ensure you create a similar type of content.
  1. 内容类型的模板,其中详细说明了应当包含的信息类型、其结构以及信息流。该模板必须以包含 pcx_content_typeproducts 的有效 frontmatter 开头。
---
pcx_content_type: how-to
products:
  - <product-identifier>
---

Second-person imperative verb phrase

Context for procedure

1. Step one
1. Step two
1. Step three
1. ...

Next steps sentence - what users should see as the end result and/or actionable next steps.

根据内容类型的不同,我们有更简单或更复杂的提示词模板。重要的是什么适合您和您的需求。您可以随时对提示词模板进行迭代和改进,尤其是当有更多用户使用它们时。

这篇文档对您有帮助吗?