🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-04-29 12:39:04 +00:00
parent 4b7ce01c0d
commit 0e31276bde
5 changed files with 17 additions and 10 deletions

View File

@@ -185,7 +185,7 @@ class BotConfig:
reply_trigger_threshold: float = 3.0 # 心流聊天触发阈值,越低越容易触发
probability_decay_factor_per_second: float = 0.2 # 概率衰减因子,越大衰减越快
default_decay_rate_per_second: float = 0.98 # 默认衰减率,越大衰减越慢
allow_focus_mode: bool = True # 是否允许子心流进入 FOCUSED 状态
allow_focus_mode: bool = True # 是否允许子心流进入 FOCUSED 状态
# sub_heart_flow_update_interval: int = 60 # 子心流更新频率,间隔 单位秒
# sub_heart_flow_freeze_time: int = 120 # 子心流冻结时间,超过这个时间没有回复,子心流会冻结,间隔 单位秒
@@ -417,6 +417,7 @@ class BotConfig:
config.model_normal_probability = response_config.get(
"model_normal_probability", config.model_normal_probability
)
def heartflow(parent: dict):
heartflow_config = parent["heartflow"]
config.sub_heart_flow_stop_time = heartflow_config.get(

View File

@@ -266,9 +266,9 @@ class SubHeartflowManager:
# --- 新增:检查是否允许进入 FOCUS 模式 --- #
if not global_config.allow_focus_mode:
if int(time.time()) % 60 == 0: # 每60秒输出一次日志避免刷屏
if int(time.time()) % 60 == 0: # 每60秒输出一次日志避免刷屏
logger.debug(f"{log_prefix} 配置不允许进入 FOCUSED 状态 (allow_focus_mode=False)")
return # 如果不允许,直接返回
return # 如果不允许,直接返回
# --- 结束新增 ---
logger.debug(f"{log_prefix} 当前状态 ({current_state.value}) 开始尝试提升到FOCUSED状态")

View File

@@ -283,7 +283,7 @@ class RelationshipManager:
person_name = await person_info_manager.get_value(person_id, "person_name")
relationship_value = await person_info_manager.get_value(person_id, "relationship_value")
level_num = self.calculate_level_num(relationship_value)
if level_num == 0 or level_num == 5:
relationship_level = ["厌恶", "冷漠以对", "认识", "友好对待", "喜欢", "暧昧"]
relation_prompt2_list = [

View File

@@ -348,7 +348,10 @@ async def build_readable_messages(
messages_before_mark, replace_bot_name, merge_messages, timestamp_mode, truncate
)
formatted_after, _ = await _build_readable_messages_internal(
messages_after_mark, replace_bot_name, merge_messages, timestamp_mode,
messages_after_mark,
replace_bot_name,
merge_messages,
timestamp_mode,
)
readable_read_mark = translate_timestamp_to_human_readable(read_mark, mode=timestamp_mode)