feat(affinity-flow): 调整回复概率参数和评分计算
- 增加最大不回复次数至15次,降低每次不回复的概率提升至1% - 在最终评分计算中增加1.15倍系数提升 - 被提及时的基础分数从1.0提升至3.0 - 为兴趣标签保存添加数据库验证机制 - 在消息处理流程中增加数据库存储功能 - 修复JSON解析错误处理,增加异常情况下的默认响应 - 优化数据库会话管理和模型转换的健壮性
This commit is contained in:
@@ -52,7 +52,10 @@ class PlanFilter:
|
||||
|
||||
if llm_content:
|
||||
logger.debug(f"墨墨在这里加了日志 -> LLM a原始返回: {llm_content}")
|
||||
parsed_json = orjson.loads(repair_json(llm_content))
|
||||
try:
|
||||
parsed_json = orjson.loads(repair_json(llm_content))
|
||||
except orjson.JSONDecodeError:
|
||||
prased_json = {"action": "no_action", "reason": "返回内容无法解析为JSON"}
|
||||
logger.debug(f"墨墨在这里加了日志 -> 解析后的 JSON: {parsed_json}")
|
||||
|
||||
if isinstance(parsed_json, dict):
|
||||
|
||||
@@ -41,6 +41,7 @@ def init_prompts():
|
||||
4. 如果用户明确要求了某个动作,请务必优先满足。
|
||||
|
||||
**如果可选动作中没有reply,请不要使用**
|
||||
**反之如果可选动作中有reply,应尽量考虑使用,不过也要考虑当前情景**
|
||||
|
||||
**可用动作:**
|
||||
{actions_before_now_block}
|
||||
|
||||
Reference in New Issue
Block a user