D1正式合并: 后端双模支持(主Dify读intent_type,无字段降级旧路径)+ ai_service透传路由字段 + Dify Prompt v1.3(新增路由意图标注规则+场景4)
This commit is contained in:
@@ -499,6 +499,10 @@ class AIService:
|
||||
"is_structured": True,
|
||||
"diagnosis_stage": diagnosis_stage,
|
||||
"response_time_ms": round(response_time_ms, 1),
|
||||
# v4.0 D1 合并:透传路由意图字段(主 Dify 统一输出,消除 detect_routing_intent 串行调用)
|
||||
"intent_type": parsed.get("intent_type"),
|
||||
"business_category": parsed.get("business_category"),
|
||||
"routing_confidence": parsed.get("routing_confidence"),
|
||||
}
|
||||
else:
|
||||
# JSON 解析失败,降级为纯文本
|
||||
@@ -607,6 +611,10 @@ class AIService:
|
||||
"is_structured": True,
|
||||
"diagnosis_stage": diagnosis_stage,
|
||||
"response_time_ms": round(response_time_ms, 1),
|
||||
# v4.0 D1 合并:透传路由意图字段(主 Dify 统一输出,消除 detect_routing_intent 串行调用)
|
||||
"intent_type": parsed.get("intent_type"),
|
||||
"business_category": parsed.get("business_category"),
|
||||
"routing_confidence": parsed.get("routing_confidence"),
|
||||
}
|
||||
else:
|
||||
# JSON 解析失败,降级为纯文本(向后兼容旧 Prompt)
|
||||
|
||||
Reference in New Issue
Block a user