fix:参数调整,提那家配置项
This commit is contained in:
@@ -28,7 +28,7 @@ logger = get_logger("expressor")
|
||||
def init_prompt():
|
||||
Prompt(
|
||||
"""
|
||||
你可以参考以下的语言习惯,如果情景合适就使用,不要盲目使用,不要生硬使用,而是结合到表达中:
|
||||
你可以参考你的以下的语言习惯,如果情景合适就使用,不要盲目使用,不要生硬使用,而是结合到表达中:
|
||||
{style_habbits}
|
||||
|
||||
你现在正在群里聊天,以下是群里正在进行的聊天内容:
|
||||
@@ -38,7 +38,7 @@ def init_prompt():
|
||||
|
||||
{chat_target}
|
||||
你的名字是{bot_name},{prompt_personality},在这聊天中,"{target_message}"引起了你的注意,对这句话,你想表达:{in_mind_reply},原因是:{reason}。你现在要思考怎么回复
|
||||
你需要使用合适的语法和句法,参考聊天内容,组织一条日常且口语化的回复。
|
||||
你需要使用合适的语法和句法,参考聊天内容,组织一条日常且口语化的回复。请你修改你想表达的原句,符合你的表达风格和语言习惯
|
||||
请你根据情景使用以下句法:
|
||||
{grammar_habbits}
|
||||
{config_expression_style},你可以完全重组回复,保留最基本的表达含义就好,但重组后保持语意通顺。
|
||||
|
||||
@@ -750,14 +750,14 @@ class NormalChat:
|
||||
reply_ratio = reply_count / total_messages if total_messages > 0 else 0
|
||||
# 使用对数函数让低比率时概率上升更快:log(1 + ratio * k) / log(1 + k) + base
|
||||
# k=7时,0.05比率对应约0.4概率,0.1比率对应约0.6概率,0.2比率对应约0.8概率
|
||||
k_reply = 7
|
||||
k_reply = 7 * global_config.normal_chat.relation_frequency
|
||||
base_reply_prob = 0.1 # 基础概率10%
|
||||
reply_build_probability = (math.log(1 + reply_ratio * k_reply) / math.log(1 + k_reply)) * 0.9 + base_reply_prob if reply_ratio > 0 else base_reply_prob
|
||||
|
||||
# 计算接收概率(receive_count的影响)
|
||||
receive_ratio = receive_count / total_messages if total_messages > 0 else 0
|
||||
# 接收概率使用更温和的对数曲线,最大0.5,基础0.08
|
||||
k_receive = 6
|
||||
k_receive = 6 * global_config.normal_chat.relation_frequency
|
||||
base_receive_prob = 0.08 # 基础概率8%
|
||||
receive_build_probability = (math.log(1 + receive_ratio * k_receive) / math.log(1 + k_receive)) * 0.42 + base_receive_prob if receive_ratio > 0 else base_receive_prob
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ class NormalChatActionModifier:
|
||||
if container:
|
||||
thinking_count = sum(1 for msg in container.messages if isinstance(msg, MessageThinking))
|
||||
print(f"thinking_count: {thinking_count}")
|
||||
if thinking_count >= 4 / global_config.chat.auto_focus_threshold: # 如果堆积超过3条思考消息
|
||||
if thinking_count >= 4 * global_config.chat.auto_focus_threshold: # 如果堆积超过3条思考消息
|
||||
logger.debug(f"{self.log_prefix} 检测到思考消息堆积({thinking_count}条),切换到focus模式")
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user