From 17d642efc9e20db9f879c71b0ea3ccd1b6f51f9e Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sun, 25 Jan 2026 14:28:07 +0800 Subject: [PATCH] fix: update configuration metadata hints for segmented reply settings --- astrbot/core/config/default.py | 13 +++++-------- .../locales/en-US/features/config-metadata.json | 9 ++++++--- .../locales/zh-CN/features/config-metadata.json | 9 ++++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 180b8f083..f60913268 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -774,27 +774,21 @@ CONFIG_METADATA_2 = { "interval_method": { "type": "string", "options": ["random", "log"], - "hint": "分段回复的间隔时间计算方法。random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", }, "interval": { "type": "string", - "hint": "`random` 方法用。每一段回复的间隔时间,格式为 `最小时间,最大时间`。如 `0.75,2.5`", }, "log_base": { "type": "float", - "hint": "`log` 方法用。对数函数的底数。默认为 2.6", }, "words_count_threshold": { "type": "int", - "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", }, "regex": { "type": "string", - "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。re.findall(r'', text)", }, "content_cleanup_rule": { "type": "string", - "hint": "移除分段后的内容中的指定的内容。支持正则表达式。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.sub(r'', '', text)", }, }, }, @@ -3046,7 +3040,8 @@ CONFIG_METADATA_3 = { "type": "bool", }, "platform_settings.segmented_reply.interval_method": { - "description": "间隔方法", + "description": "间隔方法。", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。", "type": "string", "options": ["random", "log"], }, @@ -3061,13 +3056,14 @@ CONFIG_METADATA_3 = { "platform_settings.segmented_reply.log_base": { "description": "对数底数", "type": "float", - "hint": "对数间隔的底数,默认为 2.0。取值范围为 1.0-10.0。", + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。", "condition": { "platform_settings.segmented_reply.interval_method": "log", }, }, "platform_settings.segmented_reply.words_count_threshold": { "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段)。默认为 150", "type": "int", }, "platform_settings.segmented_reply.split_mode": { @@ -3078,6 +3074,7 @@ CONFIG_METADATA_3 = { }, "platform_settings.segmented_reply.regex": { "description": "分段正则表达式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", "type": "string", "condition": { "platform_settings.segmented_reply.split_mode": "regex", diff --git a/dashboard/src/i18n/locales/en-US/features/config-metadata.json b/dashboard/src/i18n/locales/en-US/features/config-metadata.json index 130c03088..4a00f115a 100644 --- a/dashboard/src/i18n/locales/en-US/features/config-metadata.json +++ b/dashboard/src/i18n/locales/en-US/features/config-metadata.json @@ -447,7 +447,8 @@ "description": "Segment Only LLM Results" }, "interval_method": { - "description": "Interval Method" + "description": "Interval Method", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" }, "interval": { "description": "Random Interval Time", @@ -455,13 +456,15 @@ }, "log_base": { "description": "Logarithm Base", - "hint": "Base for logarithmic intervals, defaults to 2.0. Value range: 1.0-10.0." + "hint": "Base for logarithmic intervals, defaults to 2.6. Value range: 1.0-10.0." }, "words_count_threshold": { - "description": "Segmented Reply Word Count Threshold" + "description": "Segmented Reply Word Count Threshold", + "hint": "Segmented reply word count threshold. Only messages with less than this number of words will be segmented, and messages with more than this number of words will be sent directly (not segmented)." }, "split_mode": { "description": "Split Mode", + "hint": "Used to segment a message. By default, it will be separated by punctuation marks like period, question mark, etc. For example, filling `[。?!]` will remove all periods, question marks, and exclamation marks. re.findall(r'', text)", "labels": [ "Regex", "Words List" diff --git a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json index 4d9747c79..9e1759415 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json +++ b/dashboard/src/i18n/locales/zh-CN/features/config-metadata.json @@ -445,7 +445,8 @@ "description": "仅对 LLM 结果分段" }, "interval_method": { - "description": "间隔方法" + "description": "间隔方法", + "hint": "random 为随机时间,log 为根据消息长度计算,$y=log_(x)$,x为字数,y的单位为秒。" }, "interval": { "description": "随机间隔时间", @@ -453,13 +454,15 @@ }, "log_base": { "description": "对数底数", - "hint": "对数间隔的底数,默认为 2.0。取值范围为 1.0-10.0。" + "hint": "对数间隔的底数,默认为 2.6。取值范围为 1.0-10.0。" }, "words_count_threshold": { - "description": "分段回复字数阈值" + "description": "分段回复字数阈值", + "hint": "分段回复的字数上限。只有字数小于此值的消息才会被分段,超过此值的长消息将直接发送(不分段),默认为 150。" }, "split_mode": { "description": "分段模式", + "hint": "用于分隔一段消息。默认情况下会根据句号、问号等标点符号分隔。如填写 `[。?!]` 将移除所有的句号、问号、感叹号。re.findall(r'', text)", "labels": [ "正则表达式", "分段词列表"