fix:参数调整,提那家配置项

This commit is contained in:
SengokuCola
2025-06-15 01:14:07 +08:00
parent 529572b82b
commit e4b9b9e5d1
5 changed files with 10 additions and 6 deletions

View File

@@ -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},你可以完全重组回复,保留最基本的表达含义就好,但重组后保持语意通顺。

View File

@@ -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

View File

@@ -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

View File

@@ -58,6 +58,9 @@ class RelationshipConfig(ConfigBase):
build_relationship_interval: int = 600
"""构建关系间隔 单位秒如果为0则不构建关系"""
relation_frequency: int = 1
"""关系频率麦麦构建关系的速度仅在normal_chat模式下有效"""
@dataclass
class ChatConfig(ConfigBase):

View File

@@ -1,5 +1,5 @@
[inner]
version = "2.20.0"
version = "2.21.0"
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
#如果你想要修改配置文件请在修改后将version的值进行变更
@@ -46,6 +46,7 @@ learning_interval = 600 # 学习间隔 单位秒
[relationship]
enable_relationship = true # 是否启用关系系统
relation_frequency = 1 # 关系频率麦麦构建关系的速度仅在normal_chat模式下有效
[chat] #麦麦的聊天通用设置
chat_mode = "normal" # 聊天模式 —— 普通模式normal专注模式focus在普通模式和专注模式之间自动切换