> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/prompt.md).

# 提示词

向页面添加提示词块，以共享可重复使用的 AI 提示词

提示词块让你可以在文档中分享可重复使用的 AI 提示词。读者只需单击一次即可复制提示词，也可以在受支持的 AI 工具中打开它。

### 添加提示词块

1. 在空白行中，输入 `/`.
2. 单击 **提示词** （位于插入菜单中）。
3. 添加块内容和设置。

### 提示词块字段

每个提示词块都包含以下字段：

* **描述**：简要说明提示词的作用。
* **图标**：可选图标，帮助读者快速浏览块内容。
* **提示词**：可供复制或发送到 AI 工具的提示词文本。

提示词字段支持 Markdown，因此你可以使用标题、列表和其他格式来组织较长的提示词。

### 提示词选项

#### 在 AI 提供商中打开

“ **在 AI 提供商中打开** ”设置用于控制此块是否显示 AI 工具菜单，以便直接打开提示词。

启用此设置后，读者可以在已发布的文档中通过提供商菜单打开提示词。

如果不设置此选项，GitBook 会根据站点级别的 **在 AI 提供商中打开** 页面操作来确定其初始值。你可以在 [其他配置](https://gitbook.com/docs/documentation/zh/manage-your-site/customization/extra-configuration.md#open-in-ai-providers).

#### 默认可见性

“ **默认可见性** ”设置用于控制读者最初可以看到多少提示词内容。

选择 **隐藏** 以隐藏提示词。选择 **部分可见** 以显示 10 行预览，或选择 **完全可见** 以显示完整提示词。

### 示例

当你希望读者完全按照原文重复使用提示词时，可以使用提示词块。例如：

{% prompt description="Example prompt" icon="rectangle-terminal" defaultExpanded="full" %}

```markdown
总结此版本说明中的主要变更。将回复分为以下几类：新功能、重大变更和建议的后续步骤。答案不超过 150 个字。
```

{% endprompt %}

### 何时使用提示词块

提示词块适用于以下场景：

* 用于支持、入门引导或故障排除的可重复使用提示词
* 用于总结、分析或起草内容的提示词模板
* 从文档开始并在 AI 工具中继续的工作流

### 最佳实践

按照希望读者使用的方式编写提示词：

* 清楚说明任务。
* 定义输出格式。
* 添加长度、语气或必需输入等限制。

### 已发布文档中的行为

在已发布的页面上，提示词块可以帮助读者更快完成操作。

* **复制提示词** 将完整提示复制到剪贴板。
* **在 AI 提供商中打开** 启用后显示提供商菜单。

## Markdown 表示

{% code overflow="wrap" %}

````markdown
{% prompt description="Example prompt" icon="rectangle-terminal" openInAIProviders="true" defaultExpanded="full” %}
```markdown
总结此版本说明中的主要变更。将回复分为以下几类：新功能、重大变更和建议的后续步骤。答案不超过 150 个字。
```
{% endprompt %}
````

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/blocks/prompt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
