Merge pull request #2 from XXXxx7258/XXXxx7258-patch-2
Xx xxx7258 patch 2
This commit is contained in:
@@ -402,8 +402,12 @@ def process_llm_response(text: str, enable_splitter: bool = True, enable_chinese
|
|||||||
sentences.append(sentence)
|
sentences.append(sentence)
|
||||||
|
|
||||||
if len(sentences) > max_sentence_num:
|
if len(sentences) > max_sentence_num:
|
||||||
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),返回默认回复")
|
if global_config.response_splitter.enable_overflow_return_all:
|
||||||
return [_get_random_default_reply()]
|
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),合并后一次返回")
|
||||||
|
sentences = ["".join(sentences)]
|
||||||
|
else:
|
||||||
|
logger.warning(f"分割后消息数量过多 ({len(sentences)} 条),返回默认回复")
|
||||||
|
return [_get_random_default_reply()]
|
||||||
|
|
||||||
# if extracted_contents:
|
# if extracted_contents:
|
||||||
# for content in extracted_contents:
|
# for content in extracted_contents:
|
||||||
|
|||||||
@@ -626,6 +626,9 @@ class ResponseSplitterConfig(ConfigBase):
|
|||||||
enable_kaomoji_protection: bool = False
|
enable_kaomoji_protection: bool = False
|
||||||
"""是否启用颜文字保护"""
|
"""是否启用颜文字保护"""
|
||||||
|
|
||||||
|
enable_overflow_return_all: bool = False
|
||||||
|
"""是否在超出句子数量限制时合并后一次性返回"""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class TelemetryConfig(ConfigBase):
|
class TelemetryConfig(ConfigBase):
|
||||||
|
|||||||
Reference in New Issue
Block a user