mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
2de38f8b99
* docs: document editor agent connected integrations * docs: fix heading anchor divs and localized integration links in translations --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
194 lines
8.0 KiB
Plaintext
194 lines
8.0 KiB
Plaintext
---
|
||
title: "询问智能体"
|
||
description: "使用编辑器内置的 AI 智能体撰写内容、编辑页面、留下评论和建议、搜索站点、上传文件并配置设置。"
|
||
keywords: ["editor", "AI", "assistant", "agent", "chat", "comments", "suggestions", "code mode", "file upload"]
|
||
---
|
||
|
||
编辑器内置了一个智能体,可以编辑页面、重新组织导航、更新 `docs.json`、在整个仓库中搜索,以及管理仪表板设置。该智能体也可以在仪表板设置页面中使用。
|
||
|
||
编辑器智能体会直接在你当前的分支上进行修改。与你自己的编辑一样,智能体的修改会自动保存,但在你[发布](/zh/editor/publish)之前不会进入你的线上站点。
|
||
|
||
编辑器智能体的消息是免费的,不计入组织的[积分余额](/zh/credits)。
|
||
|
||
<div id="open-the-agent">
|
||
|
||
## 打开智能体
|
||
|
||
</div>
|
||
|
||
点击编辑器工具栏中的 **Ask agent**,或按 <kbd>Cmd</kbd> + <kbd>I</kbd>(macOS)或 <kbd>Ctrl</kbd> + <kbd>I</kbd>(Windows)。同一按钮和快捷键在仪表板设置页面同样可用,面板会停靠在设置导航旁边。在编辑器和设置之间切换时,聊天会话会保持打开。智能体可供 editors 和 admins 使用。[Viewers](/zh/dashboard/roles) 看不到 **Ask agent** 按钮。
|
||
|
||
编辑器智能体包含在 [Pro 和 Enterprise 方案](https://mintlify.com/pricing)中。使用它不会消耗[积分](/zh/credits)。
|
||
|
||
输入 <kbd>@</kbd> 提及特定页面,智能体就会聚焦该页面。如果没有提及,它会使用你当前打开的页面。在仪表板页面上,智能体知道你正在查看哪个页面,包括设置界面以及 Analytics、Assistant 和 Automations 等产品页面。你无需说明名称即可询问当前页面。
|
||
|
||
示例提示:
|
||
|
||
- `simplify the introduction page`
|
||
- `fix all grammar errors across my content`
|
||
- `add a new page that explains authentication`
|
||
- `rename every mention of "Acme Pro" to "Acme Team" across all pages`
|
||
- `update docs.json to add a new group called "Guides"`
|
||
|
||
<div id="attach-files">
|
||
|
||
## 附加文件
|
||
|
||
</div>
|
||
|
||
点击聊天框中的回形针图标,或把文件拖放到面板上。智能体会把附加的文件作为你请求的上下文来读取。
|
||
|
||
支持的文件类型:
|
||
- **图片**:JPG、PNG、GIF、WebP、SVG
|
||
- **文档**:PDF
|
||
- **代码和文本**:`.js`、`.ts`、`.jsx`、`.tsx`、`.mdx`、`.md`、`.json`、`.yaml`、`.html`、`.css`、Python、Go、Rust、Ruby、Java、Swift、C、C++、SQL、shell 脚本等
|
||
|
||
大小上限:每个文件 5 MB,SVG 文件除外,其上限为 256 KB。每条消息最多 10 个文件。
|
||
|
||
在智能体读取 SVG 文件之前,Mintlify 会移除其中的脚本和其他活动内容。
|
||
|
||
<div id="add-a-selection-to-the-agent">
|
||
|
||
## 把选中内容添加到智能体
|
||
|
||
</div>
|
||
|
||
在可视化模式下选中文本,然后点击浮动工具栏中的 **Add to agent**,即可把它作为上下文发送给智能体。
|
||
|
||
<div id="ask-for-comments-and-suggestions">
|
||
|
||
## 请求评论和建议
|
||
|
||
</div>
|
||
|
||
默认情况下,智能体会直接修改内容。如果你想获得反馈但暂时不改动页面,请明确要求它审阅页面、留下评论或提出建议。
|
||
|
||
- [建议](/zh/editor/collaborate#suggestions)会提议一处具体的替换,你可以接受或拒绝。在你做出决定之前,原文会以删除线的形式保持可见,智能体还可以在建议线程中附上说明。
|
||
- [评论](/zh/editor/collaborate#comments)会针对具体文本留下反馈或问题,不会修改页面。
|
||
|
||
示例提示:
|
||
|
||
- `review this page and leave suggestions`
|
||
- `comment on anything that needs more context`
|
||
- `suggest ways to make the introduction more concise`
|
||
|
||
除非你指定其他页面,智能体会使用你当前打开的页面。它可以标注页面渲染后的文本,包括组件内部的正文。它无法标注 frontmatter、页面元数据、配置,以及原始的 MDX 组件标签和属性。
|
||
|
||
<div id="review-what-the-agent-changed">
|
||
|
||
## 查看智能体的修改
|
||
|
||
</div>
|
||
|
||
智能体工作时,聊天中会出现 **Changed files** 面板。展开它可以查看本次会话中修改的所有文件,点击任意文件即可在 diff 视图中与原始版本进行比较。
|
||
|
||
若要撤销智能体的编辑,请点击 **Changed files** 面板中文件旁边的丢弃按钮,或丢弃本次会话的全部更改。
|
||
|
||
<div id="what-the-agent-can-do">
|
||
|
||
## 智能体能做什么
|
||
|
||
</div>
|
||
|
||
<div id="edit-pages">
|
||
|
||
### 编辑页面
|
||
|
||
</div>
|
||
|
||
智能体可以在任意页面上撰写、改写、扩写和重新组织内容。它会阅读你已有的内容,以匹配你的风格和结构。
|
||
|
||
<div id="search-and-navigate-your-content">
|
||
|
||
### 搜索和浏览内容
|
||
|
||
</div>
|
||
|
||
智能体可以在整个仓库中搜索,而不仅限于你打开的页面。你可以用它查找信息、检查不一致之处,或在新增内容前确认相关内容是否已经存在。
|
||
|
||
<div id="update-navigation-and-docsjson">
|
||
|
||
### 更新导航和 docs.json
|
||
|
||
</div>
|
||
|
||
智能体可以添加、重命名、重新排序和删除导航元素,与你在导航面板中手动进行的修改相同。它还可以直接更新 `docs.json` 配置,包括添加新的 group、调整设置和配置重定向。
|
||
|
||
示例:`add a "Quickstart" group under the Getting Started tab and move the quickstart page into it`
|
||
|
||
<div id="run-bash-commands">
|
||
|
||
### 运行 bash 命令
|
||
|
||
</div>
|
||
|
||
智能体可以对你的仓库运行 `grep`、`rg` 等 bash 命令。适合跨多个文件的批量操作。
|
||
|
||
示例:`find every page that mentions the deprecated /v1/auth endpoint`
|
||
|
||
<div id="configure-your-site-code-mode">
|
||
|
||
### 配置站点(code mode)
|
||
|
||
</div>
|
||
|
||
对于超出编辑页面范围的请求(例如设置认证、管理 workflow 或修改 deployment 设置),智能体会切换到 code mode。它会代表你编写并运行针对 Mintlify 仪表板的脚本。
|
||
|
||
Code mode 会遵循你在仪表板中的权限。如果你无权访问某项设置,智能体同样无法修改它。
|
||
|
||
使用 code mode 的示例提示:
|
||
|
||
- `enable JWT authentication for my site`
|
||
- `create a workflow that updates my site when I merge a PR`
|
||
- `add a custom domain`
|
||
|
||
<div id="use-connected-integrations">
|
||
|
||
### 使用已连接的集成
|
||
|
||
</div>
|
||
|
||
<Info>
|
||
集成功能需要 [Enterprise 套餐](https://mintlify.com/pricing?ref=automations)。
|
||
</Info>
|
||
|
||
编辑器智能体可以将通过 [集成](/zh/automations/integrations) 连接的第三方应用作为只读工具,用于研究、编辑页面或回答您的问题。
|
||
|
||
- **共享集成** 对组织中所有人可用。
|
||
- **个人集成** 使用与智能体对话的成员自己连接的账户。例如,Google Drive 搜索会使用您本人的 Drive 连接。
|
||
|
||
在请求中自然地要求智能体使用已连接的应用,例如:
|
||
|
||
- `根据最新的 Jira 工单更新迁移指南`
|
||
- `查看 Notion 发布简报中关于可用性的说明,并把它加入发布说明页面`
|
||
|
||
如果所需的集成尚未连接,请让智能体连接它。智能体会返回一个授权链接。完成授权流程后,再发送一条消息,智能体就会确认连接并继续工作。
|
||
|
||
<div id="continue-an-automation-run">
|
||
|
||
### 继续自动化运行
|
||
|
||
</div>
|
||
|
||
当你点击 **Preview** 从自动化结果打开编辑器时,智能体面板会自动打开,并带有该自动化所做工作的上下文。聊天顶部的 **Changed pages** 卡片会列出该自动化修改的所有页面。点击任意页面即可打开 diff 视图。
|
||
|
||
智能体掌握该自动化的提示、所做修改的摘要,以及它修改了哪些页面。你可以请它完善或延续这项工作,而无需重新说明背景。
|
||
|
||
例如:`The new section on rate limits is too long. Trim it to three sentences.`
|
||
|
||
<div id="session-history">
|
||
|
||
## 会话历史
|
||
|
||
</div>
|
||
|
||
点击面板标题栏中的时钟图标,即可查看之前的聊天会话。点击任意会话可重新打开它,并查看智能体做了哪些修改。
|
||
|
||
<div id="ai-instructions">
|
||
|
||
## AI 说明
|
||
|
||
</div>
|
||
|
||
若要为智能体提供持久性指导,例如语态规则、术语或格式约定,请在[编辑器设置](/zh/editor/settings#ai-instructions)中配置 AI 说明。智能体会在每次请求时遵循这些说明,你无需重复说明。
|