> 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/creating-content/blocks/prompt.md).

# 提示词

提示块可让你在文档中共享可重复使用的 AI 提示词。读者只需一键即可复制提示词，或在受支持的 AI 工具中打开它。

### 添加提示块

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

### 提示块字段

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

* **描述**：提示词用途的简短摘要。
* **图标**：一个可选图标，帮助读者快速识别该块。
* **提示**：可复制或发送到 AI 工具中的提示词文本。

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

### 提示选项

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

该 **在 AI 提供商中打开** 设置控制该块是否显示一个可直接打开提示词的 AI 工具菜单。

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

如果你不设置此项，GitBook 会从站点级别的 **在 AI 提供商中打开** 页面操作中推导其初始值。你可以在 [更多配置](/docs/documentation/zh/docs-site/customization/extra-configuration.md#open-in-ai-providers).

#### 默认可见性

该 **默认可见性** 设置控制读者最初能看到多少提示词内容。

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

### 示例

当你希望读者按原文精确复用某个提示词时，请使用提示块。例如：

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

```markdown
总结此版本说明中的关键变更。将回答分为：新功能、破坏性变更和推荐的下一步。请将答案控制在 150 词以内。
```

{% endprompt %}

### 何时使用提示块

提示块非常适合用于：

* 用于支持、入职或故障排查的可复用提示词
* 用于摘要、分析或起草的提示模板
* 从文档开始并在 AI 工具中继续的工作流程

### 最佳实践

按你希望读者使用它们的方式来编写提示词：

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

### 已发布文档的行为

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

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

## Markdown 中的表示

{% code overflow="wrap" %}

````markdown
{% prompt description="示例提示" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/creating-content/blocks/prompt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
