feat:修复投顾agent功能

This commit is contained in:
2026-09-14 20:51:47 +08:00
parent 1265740109
commit 3c0ddbdbd9
2 changed files with 16 additions and 1 deletions
+9
View File
@@ -41,6 +41,7 @@ _FUND_ANALYSIS_TERMS = ("基金分析", "分析基金", "基金表现", "净值
_DIALOGUE_TERMS = ("话术", "沟通", "怎么跟客户说", "如何向客户解释", "安抚客户", "投诉处理")
_RECOMMEND_TERMS = ("推荐", "组合建议", "配置建议", "买什么", "适合配置", "筛选基金", "投资方案")
_CUSTOMER_IDENTITY_TERMS = ("是谁", "姓名", "实名", "基本信息", "联系方式", "手机号")
_CUSTOMER_ROSTER_TERMS = ("名单", "列表", "几个")
_SCOPE_ERROR_MESSAGE = "投顾范围查询仅支持客户数据查询"
@@ -79,6 +80,14 @@ def recognize_advisor_intent(query: str | None, explicit_intent: str | None = No
)
if has_customer_identity:
return AGENT_INTENT_DATA_QUERY
# 客户名册类提问(我名下有哪些客户/客户名单)也属于数据查询。
has_customer_roster = (
"客户" in text
and (has_action or _contains_any(text, _CUSTOMER_ROSTER_TERMS))
and not _contains_any(text, _RECOMMEND_TERMS)
)
if has_customer_roster:
return AGENT_INTENT_DATA_QUERY
if has_data and (has_action or "客户" in text or "近一年" in text or "本月" in text):
return AGENT_INTENT_DATA_QUERY
if _contains_any(text, _RECOMMEND_TERMS):