fix:修复状态没有及时转移,和概率可能为负的BUG

This commit is contained in:
SengokuCola
2025-04-26 22:55:29 +08:00
parent 84e87d2886
commit 236451d246
5 changed files with 28 additions and 20 deletions

View File

@@ -151,8 +151,8 @@ class InterestChatting:
if self.above_threshold:
self.start_hfc_probability += 0.1
else:
if self.start_hfc_probability != 0:
self.start_hfc_probability -= 0.1
if self.start_hfc_probability > 0:
self.start_hfc_probability = max(0, self.start_hfc_probability - 0.1)
async def increase_interest(self, value: float):
self.interest_level += value
@@ -170,7 +170,7 @@ class InterestChatting:
return {
"interest_level": round(interest, 2),
"start_hfc_probability": round(self.start_hfc_probability, 4),
"is_above_threshold": self.is_above_threshold,
"above_threshold": self.above_threshold,
}
async def should_evaluate_reply(self) -> bool: