feat: 客服对话支持寒暄回复与跑题拒答
问候不再写入槽位;明显无关问题直接拒绝,知识库未命中时明确说明无法回答,并继续合理追问。 Co-authored-by: haijd <haijd@163.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user