feat(affinity-flow): 调整回复概率参数和评分计算
- 增加最大不回复次数至15次,降低每次不回复的概率提升至1% - 在最终评分计算中增加1.15倍系数提升 - 被提及时的基础分数从1.0提升至3.0 - 为兴趣标签保存添加数据库验证机制 - 在消息处理流程中增加数据库存储功能 - 修复JSON解析错误处理,增加异常情况下的默认响应 - 优化数据库会话管理和模型转换的健壮性
This commit is contained in:
committed by
Windpicker-owo
parent
dcdef633e0
commit
e1fcdf94ee
@@ -611,6 +611,19 @@ class BotInterestManager:
|
||||
|
||||
logger.info("✅ 兴趣标签已成功保存到数据库")
|
||||
|
||||
# 验证保存是否成功
|
||||
with get_db_session() as session:
|
||||
saved_record = session.query(DBBotPersonalityInterests).filter(
|
||||
DBBotPersonalityInterests.personality_id == interests.personality_id
|
||||
).first()
|
||||
session.commit()
|
||||
if saved_record:
|
||||
logger.info(f"✅ 验证成功:数据库中存在personality_id为 {interests.personality_id} 的记录")
|
||||
logger.info(f" 版本: {saved_record.version}")
|
||||
logger.info(f" 最后更新: {saved_record.last_updated}")
|
||||
else:
|
||||
logger.error(f"❌ 验证失败:数据库中未找到personality_id为 {interests.personality_id} 的记录")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"❌ 保存兴趣标签到数据库失败: {e}")
|
||||
logger.error("🔍 错误详情:")
|
||||
|
||||
Reference in New Issue
Block a user