From f57903ff7c95b54a80be5a46c2b52a3fb16ce61b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 May 2025 13:10:24 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20=E8=87=AA=E5=8A=A8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/normal_chat/normal_prompt.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/chat/normal_chat/normal_prompt.py b/src/chat/normal_chat/normal_prompt.py index 8906106a7..9618987a6 100644 --- a/src/chat/normal_chat/normal_prompt.py +++ b/src/chat/normal_chat/normal_prompt.py @@ -114,14 +114,13 @@ class PromptBuilder: relation_prompt += await relationship_manager.build_relationship_info(person) mood_prompt = mood_manager.get_mood_prompt() - - + ( learnt_style_expressions, learnt_grammar_expressions, personality_expressions, ) = await expression_learner.get_expression_by_chat_id(chat_stream.stream_id) - + style_habbits = [] grammar_habbits = [] # 1. learnt_expressions加权随机选2条 @@ -146,10 +145,7 @@ class PromptBuilder: style_habbits_str = "\n".join(style_habbits) grammar_habbits_str = "\n".join(grammar_habbits) - - - - + reply_styles2 = [ ("不要回复的太有条理,可以有个性", 0.6), ("不要回复的太有条理,可以复读", 0.15), @@ -306,7 +302,8 @@ class PromptBuilder: except Exception as e: logger.error(f"获取知识库内容时发生异常: {str(e)}") return "未检索到知识" - + + def weighted_sample_no_replacement(items, weights, k) -> list: """ 加权且不放回地随机抽取k个元素。