# 如何设置自定义助手提示词

**URL:** https://meta.discourse.org/t/how-to-set-custom-helper-prompts/411826
**Category:** Support
**Tags:** ai, ai-bot, ai-helper
**Created:** [2026年九月7日 15:47 UTC](https://meta.discourse.org/t/how-to-set-custom-helper-prompts/411826 "2026-09-07T15:47:40Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [2026年九月10日 22:00 UTC](https://meta.discourse.org/t/how-to-set-custom-helper-prompts/411826/2 "2026-09-10T22:00:10Z")

</div>

好的，我最终复用了目前可用（但在我们的社区中未使用）且已随 Discourse 一起发布的辅助功能。

| 位置 | 设置 | 设置为 | 重命中标签（自定义 → 文本） |
| --- | --- | --- | --- |
| Ask AI（帖子/主题） | ai\_helper\_translator\_agent | 自定义搜索代理 | discourse\_ai.ai\_helper.prompts.translate → 自定义搜索标签 |
| 编辑器翻译 | ai\_helper\_markdown\_tables\_agent | 内置翻译代理 | discourse\_ai.ai\_helper.prompts.markdown\_table → 翻译 |
| 编辑器 Markdown 格式化器 | ai\_helper\_smart\_dates\_agent | Markdown 格式化代理（已移动） | discourse\_ai.ai\_helper.prompts.replace\_dates → 格式化为 Markdown |

然后是两段代码片段：

**javascripts/discourse/api-initializers/ai-helper-slots.gjs**

```plaintext
import { apiInitializer } from "discourse/lib/api";

const AI_HELPER_ICONS = {
  translate: "ph-dt-magnifying-glass", // 用于论坛搜索代理
  markdown_table: "ph-dt-translate", // 编辑器：内置翻译
  replace_dates: "ph-dt-markdown", // 编辑器：Markdown 格式化
};

export default apiInitializer((api) => {
  api.getCurrentUser()?.ai_helper_prompts?.forEach((prompt) => {
    prompt.icon = AI_HELPER_ICONS[prompt.name] ?? prompt.icon;
  });
});

```

**common.scss**

```plaintext
.ai-composer-helper-menu ul.ai-helper-options li[data-value="translate"] {
  display: none;
}

```

_注意，我正在使用[自定义 Phosphor 图标集](https://github.com/somos-criptonautas/discourse-phosphor-duotone-icons)；新图标可以打包到 Font Awesome、Material 或任何其他图标集中。_

---

_[View the full topic](https://meta.discourse.org/t/how-to-set-custom-helper-prompts/411826)._
