mirror of https://github.com/Mai-with-u/MaiBot.git
commit
f982092fab
|
|
@ -405,8 +405,12 @@ def process_llm_response(text: str, enable_splitter: bool = True, enable_chinese
|
|||
sentences.append(sentence)
|
||||
|
||||
if len(sentences) > max_sentence_num:
|
||||
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),返回默认回复")
|
||||
return [_get_random_default_reply()]
|
||||
if global_config.response_splitter.enable_overflow_return_all:
|
||||
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),合并后一次返回")
|
||||
sentences = ["".join(sentences)]
|
||||
else:
|
||||
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),返回默认回复")
|
||||
return [_get_random_default_reply()]
|
||||
|
||||
# if extracted_contents:
|
||||
# for content in extracted_contents:
|
||||
|
|
|
|||
|
|
@ -626,6 +626,9 @@ class ResponseSplitterConfig(ConfigBase):
|
|||
enable_kaomoji_protection: bool = False
|
||||
"""是否启用颜文字保护"""
|
||||
|
||||
enable_overflow_return_all: bool = False
|
||||
"""是否在超出句子数量限制时合并后一次性返回"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class TelemetryConfig(ConfigBase):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[inner]
|
||||
version = "6.20.2"
|
||||
version = "6.20.3"
|
||||
|
||||
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
||||
#如果你想要修改配置文件,请递增version的值
|
||||
|
|
@ -206,6 +206,7 @@ enable = true # 是否启用回复分割器
|
|||
max_length = 512 # 回复允许的最大长度
|
||||
max_sentence_num = 8 # 回复允许的最大句子数
|
||||
enable_kaomoji_protection = false # 是否启用颜文字保护
|
||||
enable_overflow_return_all = false # 是否在句子数量超出回复允许的最大句子数时一次性返回全部内容
|
||||
|
||||
[log]
|
||||
date_style = "m-d H:i:s" # 日期格式
|
||||
|
|
@ -253,4 +254,4 @@ chat_prompts = []
|
|||
|
||||
#此系统暂时移除,无效配置
|
||||
[relationship]
|
||||
enable_relationship = true # 是否启用关系系统
|
||||
enable_relationship = true # 是否启用关系系统
|
||||
|
|
|
|||
Loading…
Reference in New Issue