Skip to content

Commit a40a5fe

Browse files
authored
docs: add usage of select_knowledgebase in plugin development docs (#7115)
* docs: 补充 select_knowledgebase 及 _special 字段文档 在插件配置文档中添加 select_knowledgebase 的说明(返回 list, 支持多选),并列出 AstrBot Core 内部使用的其他 _special 值供参考。 * docs: 优化 _special 字段文档表达 标注内部 _special 值为不稳定实现,请勿在插件中使用; 说明 select_agent_runner_provider:* 中 * 的含义; 修正英文措辞。
1 parent afa43fc commit a40a5fe

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

docs/en/dev/star/guides/plugin-config.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ When the code editor is enabled, it looks like this:
6262

6363
![editor_mode_fullscreen](https://files.astrbot.app/docs/source/images/plugin/image-7.png)
6464

65-
The **_special** field is only available after v4.0.0. Currently supports `select_provider`, `select_provider_tts`, `select_provider_stt`, `select_persona`, allowing users to quickly select model providers, personas, and other data already configured in the WebUI. Results are all strings. Using select_provider as an example, it will present the following effect:
65+
The **_special** field is only available after v4.0.0. Common values include `select_provider`, `select_provider_tts`, `select_provider_stt`, `select_persona`, and `select_knowledgebase`, allowing users to quickly select model providers, personas, knowledge bases, and other data already configured in the WebUI.
66+
67+
- `select_provider`, `select_provider_tts`, `select_provider_stt`, and `select_persona` return strings.
68+
- `select_knowledgebase` returns a `list` and supports multiple selection, so the corresponding config item should use `type: list` with a default value of `[]`.
69+
70+
> [!NOTE]
71+
> For reference, AstrBot Core also uses other internal `_special` values, such as `select_providers`, `provider_pool`, `persona_pool`, `select_plugin_set`, `t2i_template`, `get_embedding_dim`, and `select_agent_runner_provider:*` (where `*` is a placeholder for the runner type). These are internal implementations and may change at any time — please avoid using them in plugins.
72+
73+
Using `select_provider` as an example, it will display as follows:
6674

6775
![image](https://files.astrbot.app/docs/source/images/plugin/image-select-provider.png)
6876

docs/zh/dev/star/guides/plugin-config.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ AstrBot 提供了“强大”的配置解析和可视化功能。能够让用户
6262

6363
![editor_mode_fullscreen](https://files.astrbot.app/docs/source/images/plugin/image-7.png)
6464

65-
**_special** 字段仅 v4.0.0 之后可用。目前支持填写 `select_provider`, `select_provider_tts`, `select_provider_stt`, `select_persona`,用于让用户快速选择用户在 WebUI 上已经配置好的模型提供商、人设等数据。结果均为字符串。以 select_provider 为例,将呈现以下效果:
65+
**_special** 字段仅 v4.0.0 之后可用。常用可填写值包括 `select_provider`, `select_provider_tts`, `select_provider_stt`, `select_persona`, `select_knowledgebase`,用于让用户快速选择在 WebUI 上已经配置好的模型提供商、人设、知识库等数据。
66+
67+
- `select_provider``select_provider_tts``select_provider_stt``select_persona` 的结果为字符串。
68+
- `select_knowledgebase` 的结果为 `list` 类型,支持多选,建议将对应配置项的 `type` 设为 `list`,默认值设为 `[]`
69+
70+
> [!NOTE]
71+
> 此外,AstrBot Core 内部还使用了 `select_providers``provider_pool``persona_pool``select_plugin_set``t2i_template``get_embedding_dim``select_agent_runner_provider:*``*` 为运行器类型占位符)等 `_special` 值。这些属于内部实现,随时可能变动,请勿在插件中使用。
72+
73+
`select_provider` 为例,将呈现以下效果:
6674

6775
![image](https://files.astrbot.app/docs/source/images/plugin/image-select-provider.png)
6876

0 commit comments

Comments
 (0)