docs: bot-selector field

This commit is contained in:
Junyan Qin
2025-11-06 15:42:51 +08:00
parent 01bb7c89db
commit 71194d8466
2 changed files with 38 additions and 2 deletions
+19 -1
View File
@@ -45,7 +45,7 @@ For example:
spec:
config:
- name: github_token # Required; configuration item name, used for retrieval in the plugin
type: string # Required; configuration item type, supports string, integer, float, boolean, select, prompt-editor, llm-model-selector, etc.
type: string # Required; configuration item type, supports string, integer, float, boolean, select, prompt-editor, llm-model-selector, bot-selector, etc.
label: # Required; configuration item display name, supports multilingual. Language codes follow RFC 4646 standard.
en_US: Github Token
zh_Hans: Github Token
@@ -215,6 +215,24 @@ LLM model selector. Displays an LLM model selector where you can choose configur
...
```
### type: bot-selector
Bot selector. Displays a Bot selector where you can choose configured Bots, with the final result represented as the Bot UUID.
```yaml
- name: bot
type: bot-selector
...
```
Using the Bot UUID in the plugin:
```python
# Get Bot UUID from config
bot_uuid = self.get_config()['bot']
print(bot_uuid) # Output: '550e8400-e29b-41d4-a716-446655440000'
```
## What's Next
This tutorial will guide you through step-by-step completion of plugin functionality.
+19 -1
View File
@@ -45,7 +45,7 @@ execution:
spec:
config:
- name: github_token # 必填;配置项名称,用于在插件中获取
type: string # 必填;配置项类型,支持 string, integer, float, boolean, select, prompt-editor, llm-model-selector 等
type: string # 必填;配置项类型,支持 string, integer, float, boolean, select, prompt-editor, llm-model-selector, bot-selector 等
label: # 必填;配置项显示名称,支持多语言。语言代码采用 RFC 4646 标准。
en_US: Github Token
zh_Hans: Github Token
@@ -215,6 +215,24 @@ LLM 模型选择器。会展示一个 LLM 模型选择器,可选择已配置
...
```
### type: bot-selector
Bot 选择器。会展示一个 Bot 选择器,可选择已配置的 Bot,最终结果表示为 Bot uuid。
```yaml
- name: bot
type: bot-selector
...
```
在插件中使用 Bot uuid:
```python
# 从配置中获取 Bot UUID
bot_uuid = self.get_config()['bot']
print(bot_uuid) # 输出: '550e8400-e29b-41d4-a716-446655440000'
```
## 接下来做什么
该教程将指引您逐步完善插件功能。