Files
mintlify__docs/zh/agent/use-cases.mdx
mintlify[bot] bb371385b4 docs: remove automate-agent guide page (#5938)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
2026-05-22 16:49:11 -07:00

97 lines
4.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "使用场景"
description: "探索使用 Mintlify agent 自动更新文档、沉淀知识和维护准确文档的实际案例。"
keywords: ["agent 工作流", "文档工作流", "自动化示例"]
---
agent 可以协助完成多种文档相关任务。以下示例展示了几种将 agent 集成到文档流程中的方式。选择一种适合你团队当前工作方式的方案,并根据你的具体需求进行调整。
<div id="iterate-on-a-prompt-in-a-slack-thread">
## 在 Slack 线程中迭代优化提示词
</div>
先向 agent 发送提示词,然后在同一条线程中继续使用 `@mintlify` 提及它,以便对其创建的拉取请求 (PR;亦称“合并请求”/Merge Request) 进行细化和迭代。
例如:`@mintlify Our quickstart page needs a new section on inviting collaborators`。接着:`@mintlify The new section should be called "Inviting collaborators"`。然后再根据需要继续进行其他迭代。
<div id="start-with-the-agent-finish-manually">
## 从助手开始,由你手动完成
</div>
先向助手发送指令以启动一个项目,然后检出它创建的 branch,在本地环境或 Web 编辑器中完成任务。助手可以帮助你起步,之后你可以接手完成整个任务。
例如:`@mintlify Update the quickstart page to include information about inviting collaborators`,然后检出该 branch,使用你喜欢的方式进行进一步修改。
<div id="update-docs-when-merging-feature-changes">
## 在合并功能变更时更新文档
</div>
当你合并功能拉取请求 (PR) 时,将该 PR 的链接分享给 agent,让其更新相关文档。
例如:`@mintlify This PR adds a new authentication method. Update the docs to include the new auth flow: [PR link]`.
<div id="generate-release-notes-from-a-pull-request">
## 从拉取请求生成发布说明
</div>
向智能助手提供特定的拉取请求,让其根据提交历史生成发布说明或更新日志。
例如:`@mintlify Generate release notes for this PR: [PR link]`。
<div id="address-pull-request-review-feedback">
## 处理拉取请求评审反馈
</div>
将拉取请求链接分享给助手,以便处理文档拉取请求中的审阅意见和代码评审反馈。
例如:`@mintlify Address the review comments on this PR: [PR link]`。
<div id="generate-code-examples">
## 生成代码示例
</div>
让智能体在整份文档或特定页面中为各个功能生成代码示例。
例如:`@mintlify Generate a code example to make the authentication method easier to understand`.
<div id="add-images-or-files-to-your-docs">
## 向文档添加图片或文件
</div>
在向智能体发送指令时,直接在 Slack 消息中附加文件或图片。智能体会处理附件并将其加入到文档中。
例如:`@mintlify Add this diagram to the architecture overview page`,并在消息中附上该图片。
<div id="review-existing-content">
## 审查现有内容
</div>
让助手审查现有内容的技术准确性、写作风格、语法或其他问题。
例如:`@mintlify 请审查 API 限流部分。我们上个月更改了限制。`
<div id="respond-to-user-feedback">
## 回应用户反馈
</div>
根据用户的反馈向助手提问,以便对文档进行有针对性的更新。
例如:`@mintlify Users are getting confused by step 3 in the setup guide. What might be making it unclear?`.
<div id="automate-with-workflows">
## 使用工作流实现自动化
</div>
创建工作流,以自动化处理重复性任务和响应式维护任务,例如在你为你的产品添加新功能时撰写更新日志或更新内容。
参见 [Workflows](/workflows/index) 了解更多信息。
<div id="automate-with-the-api">
## 使用 API 实现自动化
</div>
将 agent 集成到你现有的自动化工具中,当代码发生变更时自动更新文档、触发内容审查,或在多个代码仓库之间同步文档更新。
使用 agent 的 API 端点来[创建任务](/zh/api/agent/v2/create-agent-job)、[获取任务状态](/zh/api/agent/v2/get-agent-job)以及[发送消息](/zh/api/agent/v2/send-message)。
通过 API 创建任务时,你可以使用 `asDraft` 参数 (默认为 `false`) 控制拉取请求是否以草稿模式打开。将 `asDraft` 设置为 `true` 以创建草稿拉取请求,或保留默认值以创建非草稿拉取请求,从而在自动化工作流中立即进行审查和合并。