fix:添加hfc调试功能,一键999
This commit is contained in:
@@ -136,10 +136,8 @@ class InterestLogger:
|
||||
"sub_mind": state.get("current_mind", "未知"),
|
||||
"sub_chat_state": state.get("chat_state", "未知"),
|
||||
"interest_level": interest_state.get("interest_level", 0.0),
|
||||
"reply_probability": interest_state.get("current_reply_probability", 0.0),
|
||||
"start_hfc_probability": interest_state.get("start_hfc_probability", 0.0),
|
||||
"is_above_threshold": interest_state.get("is_above_threshold", False),
|
||||
"last_active_time": state.get("last_active_time", 0.0),
|
||||
"last_interaction_time": interest_state.get("last_interaction_time", 0.0),
|
||||
}
|
||||
subflow_details.append(subflow_entry)
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@ mai_state_config = LogConfig(
|
||||
logger = get_module_logger("mai_state_manager", config=mai_state_config)
|
||||
|
||||
|
||||
|
||||
enable_unlimited_hfc_chat = False
|
||||
|
||||
|
||||
|
||||
class MaiState(enum.Enum):
|
||||
"""
|
||||
聊天状态:
|
||||
@@ -28,6 +33,11 @@ class MaiState(enum.Enum):
|
||||
FOCUSED_CHAT = "专心聊天"
|
||||
|
||||
def get_normal_chat_max_num(self):
|
||||
# 调试用
|
||||
if enable_unlimited_hfc_chat:
|
||||
return 1000
|
||||
|
||||
|
||||
if self == MaiState.OFFLINE:
|
||||
return 0
|
||||
elif self == MaiState.PEEKING:
|
||||
@@ -38,6 +48,10 @@ class MaiState(enum.Enum):
|
||||
return 2
|
||||
|
||||
def get_focused_chat_max_num(self):
|
||||
# 调试用
|
||||
if enable_unlimited_hfc_chat:
|
||||
return 1000
|
||||
|
||||
if self == MaiState.OFFLINE:
|
||||
return 0
|
||||
elif self == MaiState.PEEKING:
|
||||
@@ -125,11 +139,11 @@ class MaiStateManager:
|
||||
if current_status == MaiState.OFFLINE:
|
||||
logger.info("当前[离线],没看手机,思考要不要上线看看......")
|
||||
elif current_status == MaiState.PEEKING:
|
||||
logger.info("当前[在窥屏],思考要不要继续聊下去......")
|
||||
logger.info("当前[看一眼],思考要不要继续聊下去......")
|
||||
elif current_status == MaiState.NORMAL_CHAT:
|
||||
logger.info("当前在[随便看]思考要不要继续聊下去......")
|
||||
logger.info("当前在[正常聊天]思考要不要继续聊下去......")
|
||||
elif current_status == MaiState.FOCUSED_CHAT:
|
||||
logger.info("当前在[专心看]思考要不要继续聊下去......")
|
||||
logger.info("当前在[专心聊天]思考要不要继续聊下去......")
|
||||
|
||||
# 1. 麦麦每分钟都有概率离线
|
||||
if time_since_last_min_check >= 60:
|
||||
|
||||
@@ -176,10 +176,8 @@ class InterestChatting:
|
||||
interest = self.interest_level # 直接使用属性值
|
||||
return {
|
||||
"interest_level": round(interest, 2),
|
||||
"last_update_time": self.last_update_time,
|
||||
"current_reply_probability": round(self.current_reply_probability, 4),
|
||||
"start_hfc_probability": round(self.start_hfc_probability, 4),
|
||||
"is_above_threshold": self.is_above_threshold,
|
||||
"last_interaction_time": self.last_interaction_time,
|
||||
}
|
||||
|
||||
async def should_evaluate_reply(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user