Skip to content

docs: add usage of select_knowledgebase in plugin development docs#7115

Merged
Soulter merged 2 commits intoAstrBotDevs:masterfrom
piexian:docs/knowledgebase-multiselect
Mar 29, 2026
Merged

docs: add usage of select_knowledgebase in plugin development docs#7115
Soulter merged 2 commits intoAstrBotDevs:masterfrom
piexian:docs/knowledgebase-multiselect

Conversation

@piexian
Copy link
Copy Markdown
Contributor

@piexian piexian commented Mar 28, 2026

插件文档select_knowledgebase相关过时且不完整

Modifications / 改动点

在插件配置文档中添加 select_knowledgebase 的说明(返回 list,
支持多选),并列出 AstrBot Core 内部使用的其他 _special 值供参考。

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Document additional _special field options for plugin configuration, including behavior of select_knowledgebase and other internally used values in AstrBot Core.

Documentation:

  • Clarify that select_knowledgebase is a supported _special value, returning a list and supporting multi-selection for plugin configs in both English and Chinese docs.
  • List additional internal _special values used by AstrBot Core to guide plugin authors beyond the most common options.

在插件配置文档中添加 select_knowledgebase 的说明(返回 list,
支持多选),并列出 AstrBot Core 内部使用的其他 _special 值供参考。
Copilot AI review requested due to automatic review settings March 28, 2026 21:53
@auto-assign auto-assign bot requested review from Raven95676 and Soulter March 28, 2026 21:53
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 28, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • Since you’re now exposing internal _special values like select_providers, provider_pool, etc., consider explicitly stating whether these are stable/public or internal/subject-to-change to avoid plugin authors depending on unsupported interfaces.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since you’re now exposing internal `_special` values like `select_providers`, `provider_pool`, etc., consider explicitly stating whether these are stable/public or internal/subject-to-change to avoid plugin authors depending on unsupported interfaces.

## Individual Comments

### Comment 1
<location path="docs/en/dev/star/guides/plugin-config.md" line_range="73" />
<code_context>
+> [!NOTE]
+> 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:*`.
+
+Using `select_provider` as an example, it will present the following effect:

 ![image](https://files.astrbot.app/docs/source/images/plugin/image-select-provider.png)
</code_context>
<issue_to_address>
**suggestion (typo):** Consider rephrasing "present the following effect" to a more natural English expression.

The phrasing is understandable but slightly awkward. Consider alternatives like "it will have the following effect" or "it will display as follows" for more natural wording.

```suggestion
Using `select_provider` as an example, it will display as follows:
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the plugin configuration documentation in both English and Chinese to include the select_knowledgebase special field and provides a list of internal _special values used by AstrBot Core. Feedback was provided to clarify the meaning of the wildcard in the select_agent_runner_provider:* field to prevent developer confusion.

- `select_knowledgebase` returns a `list` and supports multiple selection, so the corresponding config item should use `type: list` with a default value of `[]`.

> [!NOTE]
> 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:*`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了让文档更清晰,建议在此处说明 select_agent_runner_provider:* 中通配符 * 的含义,避免开发者产生困惑。

Suggested change
> 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:*`.
> 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 wildcard for the agent runner subtype).

- `select_knowledgebase` 的结果为 `list` 类型,支持多选,建议将对应配置项的 `type` 设为 `list`,默认值设为 `[]`。

> [!NOTE]
> 此外,AstrBot Core 内部还使用了 `select_providers`、`provider_pool`、`persona_pool`、`select_plugin_set`、`t2i_template`、`get_embedding_dim`、`select_agent_runner_provider:*` 等 `_special` 值,供参考。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了让文档更清晰,建议在此处说明 select_agent_runner_provider:* 中通配符 * 的含义,避免开发者产生困惑。

Suggested change
> 此外,AstrBot Core 内部还使用了 `select_providers``provider_pool``persona_pool``select_plugin_set``t2i_template``get_embedding_dim``select_agent_runner_provider:*` `_special` 值,供参考。
> 此外,AstrBot Core 内部还使用了 `select_providers``provider_pool``persona_pool``select_plugin_set``t2i_template``get_embedding_dim` 以及 `select_agent_runner_provider:*`(此处的 `*` 为子类型通配符)`_special` 值,供参考。

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the plugin configuration documentation to reflect current _special capabilities, especially select_knowledgebase, so plugin authors can rely on accurate WebUI behavior.

Changes:

  • Documented select_knowledgebase under _special, including that it returns a list and supports multi-select.
  • Added a reference list of additional internal/reserved _special values used/supported by AstrBot.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/zh/dev/star/guides/plugin-config.md Expands _special documentation with select_knowledgebase and a reference list of additional values.
docs/en/dev/star/guides/plugin-config.md English equivalent of the _special documentation expansion, including select_knowledgebase.

- `select_knowledgebase` returns a `list` and supports multiple selection, so the corresponding config item should use `type: list` with a default value of `[]`.

> [!NOTE]
> 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:*`.
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the NOTE, it says AstrBot Core “also uses” provider_pool / persona_pool as _special values, but there are no occurrences of "_special": "provider_pool" or "_special": "persona_pool" in the repo’s config schemas (they appear to be values the Dashboard renderer supports, not necessarily ones Core actively uses). Suggest rewording to “Dashboard supports / reserved for internal use”, or cite an actual Core schema usage. Also, since select_providers is listed here, consider noting it returns a list (multi-select) to prevent misuse.

Suggested change
> 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:*`.
> For reference, the Dashboard renderer also supports additional internal `_special` values, such as `select_providers`, `provider_pool`, `persona_pool`, `select_plugin_set`, `t2i_template`, `get_embedding_dim`, and `select_agent_runner_provider:*`. These are reserved for AstrBot's own built-in configurations and may change without notice; third-party plugins should avoid relying on them.
> Note: `select_providers` returns a `list` (multi-select), so any schema using it must set `"type": "list"` with an appropriate list default (for example `[]`).

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +71
- `select_knowledgebase` 的结果为 `list` 类型,支持多选,建议将对应配置项的 `type` 设为 `list`,默认值设为 `[]`。

> [!NOTE]
> 此外,AstrBot Core 内部还使用了 `select_providers`、`provider_pool`、`persona_pool`、`select_plugin_set`、`t2i_template`、`get_embedding_dim`、`select_agent_runner_provider:*` 等 `_special` 值,供参考。
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段 NOTE 里提到 AstrBot Core “内部还使用了” provider_pool / persona_pool 作为 _special 值,但目前仓库内未找到任何配置 schema 使用 "_special": "provider_pool""_special": "persona_pool"(它们更像是 Dashboard 已支持但未必在 Core schema 中实际引用的内部值)。建议:1) 若只是表示 WebUI 支持这些 _special,请改成“Dashboard 支持/内部保留”;或 2) 给出 Core 中实际使用它们的 schema 示例来源。另:既然在此处列出了 select_providers,建议补充其返回值也是 list(多选)以避免误用。

Suggested change
- `select_knowledgebase` 的结果为 `list` 类型,支持多选,建议将对应配置项的 `type` 设为 `list`,默认值设为 `[]`
> [!NOTE]
> 此外,AstrBot Core 内部还使用了 `select_providers``provider_pool``persona_pool``select_plugin_set``t2i_template``get_embedding_dim``select_agent_runner_provider:*``_special` 值,供参考。
- `select_knowledgebase``select_providers` 的结果为 `list` 类型,支持多选,建议将对应配置项的 `type` 设为 `list`,默认值设为 `[]`
> [!NOTE]
> 此外,Dashboard 内部还预留并使用了 `select_providers``provider_pool``persona_pool``select_plugin_set``t2i_template``get_embedding_dim``select_agent_runner_provider:*``_special` 值,供参考,一般插件开发者可仅关注上文列出的常用值

Copilot uses AI. Check for mistakes.
标注内部 _special 值为不稳定实现,请勿在插件中使用;
说明 select_agent_runner_provider:* 中 * 的含义;
修正英文措辞。
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 29, 2026
@Soulter Soulter changed the title docs: 补充 select_knowledgebase 及 _special 字段文档 docs: add usage of select_knowledgebase in plugin development docs Mar 29, 2026
@Soulter Soulter merged commit a40a5fe into AstrBotDevs:master Mar 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants