feat: 客服对话支持寒暄回复与跑题拒答

问候不再写入槽位;明显无关问题直接拒绝,知识库未命中时明确说明无法回答,并继续合理追问。

Co-authored-by: haijd <haijd@163.com>
This commit is contained in:
Cursor Agent
2026-09-20 05:52:22 +00:00
co-authored by haijd
parent cd67211043
commit 625a6a3a9d
4 changed files with 249 additions and 14 deletions
+3 -1
View File
@@ -48,9 +48,11 @@ def looks_like_handoff(text: str, phrases: list[str]) -> bool:
def naive_fill_slots(message: str, slots_meta: list[dict[str, Any]], current: dict[str, str]) -> dict[str, str]:
"""每轮通常只推进一个槽:先做明确关键词,再把整句写入当前优先空槽。"""
from .intent import should_write_slot
updated = dict(current)
text = message.strip()
if not text:
if not text or not should_write_slot(text):
return updated
touched = False