v0.5.8 修复 回复重复输出的bug

This commit is contained in:
SengokuCola
2025-03-06 19:56:57 +08:00
parent 41a94b98b0
commit ee414eeaaf
7 changed files with 29 additions and 16 deletions

View File

@@ -395,13 +395,13 @@ def add_typos(text: str) -> str:
def process_llm_response(text: str) -> List[str]:
# processed_response = process_text_with_typos(content)
if len(text) > 200:
if len(text) > 300:
print(f"回复过长 ({len(text)} 字符),返回默认回复")
return ['懒得说']
# 处理长消息
sentences = split_into_sentences_w_remove_punctuation(add_typos(text))
# 检查分割后的消息数量是否过多超过3条
if len(sentences) > 3:
if len(sentences) > 4:
print(f"分割后消息数量过多 ({len(sentences)} 条),返回默认回复")
return [f'{global_config.BOT_NICKNAME}不知道哦']