diff --git a/src/plugins/chat/utils.py b/src/plugins/chat/utils.py index f174f4fd..be6aaf93 100644 --- a/src/plugins/chat/utils.py +++ b/src/plugins/chat/utils.py @@ -332,9 +332,9 @@ def random_remove_punctuation(text: str) -> str: def process_llm_response(text: str) -> List[str]: # processed_response = process_text_with_typos(content) - if len(text) > 200: - logger.warning(f"回复过长 ({len(text)} 字符),返回默认回复") - return ['懒得说'] + # if len(text) > 200: + # logger.warning(f"回复过长 ({len(text)} 字符),返回默认回复") + # return ['懒得说'] # 处理长消息 typo_generator = ChineseTypoGenerator( error_rate=global_config.chinese_typo_error_rate, diff --git a/src/plugins/chat/willing_manager.py b/src/plugins/chat/willing_manager.py index 116ee3f8..d1f10f3a 100644 --- a/src/plugins/chat/willing_manager.py +++ b/src/plugins/chat/willing_manager.py @@ -8,7 +8,7 @@ class WillingManager: self.group_reply_willing = {} # 存储每个群的回复意愿 self._decay_task = None self._started = False - self.min_reply_willing = 0.01 + self.min_reply_willing = 0.15 self.attenuation_coefficient = 0.75 async def _decay_reply_willing(self): @@ -41,6 +41,9 @@ class WillingManager: logger.debug(f"[{group_id}]的初始回复意愿: {current_willing}") + if current_willing<0.25: + current_willing+=0.03 #多说点话 + # 根据消息类型(被cue/表情包)调控 if is_mentioned_bot: current_willing = min( @@ -73,7 +76,8 @@ class WillingManager: # 回复概率迭代,保底0.01回复概率 reply_probability = max( - (current_willing - 0.45) * 2, + #(current_willing - 0.45) * 2, + current_willing, self.min_reply_willing ) diff --git a/src/plugins/utils/typo_generator.py b/src/plugins/utils/typo_generator.py index aa72c387..c0a228cf 100644 --- a/src/plugins/utils/typo_generator.py +++ b/src/plugins/utils/typo_generator.py @@ -16,10 +16,10 @@ from pypinyin import Style, pinyin class ChineseTypoGenerator: def __init__(self, - error_rate=0.3, + error_rate=0.1, min_freq=5, - tone_error_rate=0.2, - word_replace_rate=0.3, + tone_error_rate=0.1, + word_replace_rate=0.1, max_freq_diff=200): """ 初始化错别字生成器 @@ -372,7 +372,7 @@ class ChineseTypoGenerator: # 优先从词语错误中选择,如果没有则从单字错误中选择 correction_suggestion = None # 50%概率返回纠正建议 - if random.random() < 0.5: + if random.random() < 0.8: if word_typos: wrong_word, correct_word = random.choice(word_typos) correction_suggestion = correct_word