Skip to content

Commit 5019cc1

Browse files
committed
feat: custom rules
1 parent 0043d97 commit 5019cc1

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.vitepress/config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default defineConfig({
159159
{ text: "网页搜索", link: "/websearch" },
160160
{ text: "知识库", link: "/knowledge-base" },
161161
{ text: "沙箱化代码执行器(beta)", link: "/code-interpreter" },
162+
{ text: "自定义规则", link: "/custom-rules" },
162163
],
163164
},
164165
{
@@ -366,6 +367,7 @@ export default defineConfig({
366367
{ text: "Web Search", link: "/websearch" },
367368
{ text: "Knowledge Base", link: "/knowledge-base" },
368369
{ text: "Sandboxed Code Interpreter (beta)", link: "/code-interpreter" },
370+
{ text: "Custom Rules", link: "/custom-rules" },
369371
],
370372
},
371373
{

en/use/custom-rules.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Custom Rules
2+
3+
> [!NOTE]
4+
> The "unified message origin" mentioned below refers to UMO. A UMO uniquely identifies a specific conversation on a messaging platform.
5+
6+
Since version v4.7.0, we have refactored AstrBot's original "Session Management" feature into the "Custom Rules" feature to reduce conflicts with configuration files.
7+
8+
You can think of custom rules as more flexible, mandatory processing rules for specified message sources, which have higher priority than configuration files.
9+
10+
For example, if a messaging platform originally uses the "default" configuration file, all conversations under this platform are processed according to the rules in the configuration file. If you want to apply special processing to a specific session source A, previously you would need to create a separate configuration file and bind A to it. Now, you simply need to create a custom rule in the WebUI's Custom Rules page and select message source A. You can define the following rules:
11+
12+
1. Whether to enable message processing for this unified message origin. If disabled, the effect is equivalent to blacklisting this unified message origin.
13+
2. Whether to enable LLM for messages from this unified message origin. If disabled, AI capabilities will not be used.
14+
3. Whether to enable TTS for messages from this unified message origin. If disabled, TTS capabilities will not be used.
15+
4. Configure specific chat models, speech recognition models (STT), and text-to-speech models (TTS) for this unified message origin.
16+
5. Configure a specific persona for this unified message origin.
17+

zh/use/custom-rules.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 自定义规则
2+
3+
> [!NOTE]
4+
> 下文的「消息会话来源」指的是 UMO。一个 UMO 唯一指定了一个消息平台下的具体的某个会话。
5+
6+
在 v4.7.0 版本之后,我们重构了 AstrBot 原来的「会话管理」功能为「自定义规则」功能。以减少和配置文件的冲突。
7+
8+
你可以把自定义规则理解为对指定消息来源更加灵活的自定义强制处理规则,其优先级高于配置文件。
9+
10+
例如,原本一个消息平台使用配置文件 “default”,这个消息平台下的所有会话都按照配置文件中的规则进行处理。如果你希望对某个会话来源 A 进行特殊处理,在原来,你需要单独创建一个配置文件,然后将 A 绑定到这个配置文件中。而现在,你只需要在 WebUI 的自定义规则页中创建一个自定义规则,然后选择消息来源 A 即可。你可以定义如下规则:
11+
12+
1. 是否启用该消息会话来源的消息处理。如果不启用,其效果相当于将该消息会话来源拉入黑名单。
13+
2. 是否对该消息会话来源的消息启用 LLM。如果不启用,则不会使用 AI 能力。
14+
3. 是否对该消息会话来源的消息启用 TTS。如果不启用,则不会使用 TTS 能力。
15+
4. 对该消息会话来源配置特定的聊天模型、语音识别模型(STT)、语音合成模型(TTS)。
16+
5. 对该消息会话来源配置特定的人格。

0 commit comments

Comments
 (0)