# 连接

连接可让你将外部内容引入你的文档站点。

已连接的内容可以显示在 [AI 搜索](/docs/documentation/zh/docs-site/ai-search.md) 并 [GitBook Assistant](/docs/documentation/zh/ai-yu-sou-suo/gitbook-ai-assistant.md)中。一些连接还可以帮助 GitBook 生成变更请求。

要添加连接，请打开你站点的 **设置** 并点击 **连接**.

<figure><img src="/files/47112bc49921d9b197ee7f8bcc3fa5ae95cdd563" alt=""><figcaption></figcaption></figure>

### 连接的工作方式

{% stepper %}
{% step %}

#### 连接来源

选择一种来源类型。然后对其进行授权，或输入你希望 GitBook 导入的 URL。

{% hint style="info" %}
如果你连接 YouTube，请输入频道 ID——不要输入频道名称。

频道名称不适用于此来源。

在 YouTube Studio 中，打开 **设置** → **频道** → **高级设置**.

复制 **频道 ID**.

如果你的频道 URL 包含 `/channel/`，请复制其后面的部分 `/channel/`.
{% endhint %}

每个连接都会从该来源创建一个记录流，例如议题、讨论、页面或视频。
{% endstep %}

{% step %}

#### GitBook 会同步记录

保存连接后，GitBook 会开始同步来自该来源的记录。

在连接列表中，你可以查看同步状态、记录数量和上次同步时间。

默认情况下，已连接的 URL 每天刷新一次。你也可以从你站点的 **设置** → **连接**.
{% endstep %}

{% step %}

#### 选择记录的使用方式

对于每个连接，你可以选择其记录是否出现在搜索和 GitBook Assistant 中，以及它们是否有助于 GitBook 生成变更请求。

你还可以调整连接的搜索排名，以提高或降低其记录的优先级。
{% endstep %}
{% endstepper %}

### 连接设置

编辑连接时，你可以配置这些选项：

#### 标签

使用 **标签** 为该连接起一个清晰的名称。

这会让你更容易在连接列表中识别该来源，尤其是在你连接了多个仓库、网站或频道时。

#### 自动生成变更请求

{% hint style="warning" %}
自动生成变更请求目前处于早期访问阶段。

参见 [Agent 审核](/docs/documentation/zh/gitbook-agent/agent-audit.md) 有关申请访问权限的信息
{% endhint %}

开启 **自动生成变更请求** 以便让 GitBook 从该连接的记录中学习，并建议文档更新。

GitBook 可以使用这些记录创建变更请求，并提供建议更改供你的团队审阅。

#### 在搜索 / 助手中公开

开启 **在搜索 / 助手中公开** 让访客可搜索此连接中的记录，并可用来回答问题。

这使已连接的内容能够出现在你站点的 AI 驱动搜索体验中，以及 GitBook Assistant 的回复中。

{% hint style="warning" %}
启用 **在搜索 / 助手中公开** 可使该连接中的记录对任何能够访问该站点的人可用——如果该站点对外共享，则包括外部访客。
{% endhint %}

#### 搜索排名提升

使用 **搜索排名提升** 以在搜索中提高或降低某个连接中的记录优先级。

如果此来源应更频繁地出现，请提高该值。如果此来源相较于你的主要文档应具有更低权重，请降低该值。


---

# Agent Instructions: 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:

```
GET https://gitbook.com/docs/documentation/zh/ai-yu-sou-suo/connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
