Skip to content

Commit ccf5092

Browse files
committed
fix:修复关系炸裂
1 parent 7f19255 commit ccf5092

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/chat/normal_chat/normal_chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ async def _evaluate_and_build_relation(self, person_id: str, stats: dict, total_
851851
reply_ratio = reply_count / total_messages if total_messages > 0 else 0
852852
# 使用对数函数让低比率时概率上升更快:log(1 + ratio * k) / log(1 + k) + base
853853
# k=7时,0.05比率对应约0.4概率,0.1比率对应约0.6概率,0.2比率对应约0.8概率
854-
k_reply = 7 * global_config.normal_chat.relation_frequency
854+
k_reply = 7 * global_config.relationship.relation_frequency
855855
base_reply_prob = 0.1 # 基础概率10%
856856
reply_build_probability = (
857857
(math.log(1 + reply_ratio * k_reply) / math.log(1 + k_reply)) * 0.9 + base_reply_prob
@@ -862,7 +862,7 @@ async def _evaluate_and_build_relation(self, person_id: str, stats: dict, total_
862862
# 计算接收概率(receive_count的影响)
863863
receive_ratio = receive_count / total_messages if total_messages > 0 else 0
864864
# 接收概率使用更温和的对数曲线,最大0.5,基础0.08
865-
k_receive = 6 * global_config.normal_chat.relation_frequency
865+
k_receive = 6 * global_config.relationship.relation_frequency
866866
base_receive_prob = 0.08 # 基础概率8%
867867
receive_build_probability = (
868868
(math.log(1 + receive_ratio * k_receive) / math.log(1 + k_receive)) * 0.42 + base_receive_prob

0 commit comments

Comments
 (0)