fix: reply with standalone ping for meaningless short customer texts
This commit is contained in:
@@ -412,7 +412,25 @@ class RegressionPipelineTest(unittest.IsolatedAsyncioTestCase):
|
||||
self.assertTrue(resp.should_reply)
|
||||
self.assertIn("地图", resp.reply)
|
||||
self.assertIn("不做", resp.reply)
|
||||
self.assertTrue(resp.reply.endswith(("嗯", "哦", "好的", "嗯咯", "嗯啦")))
|
||||
|
||||
async def test_meaningless_short_text_gets_ping_reply(self):
|
||||
agent = CustomerServiceAgent()
|
||||
msg = CustomerMessage(
|
||||
msg_id="m-meaningless",
|
||||
acc_id="test_shop",
|
||||
msg="好的",
|
||||
from_id=self.customer_id,
|
||||
from_name="t",
|
||||
cy_id=self.customer_id,
|
||||
acc_type="AliWorkbench",
|
||||
msg_type=0,
|
||||
cy_name="t",
|
||||
goods_name="专业找图",
|
||||
goods_order="",
|
||||
)
|
||||
resp = await agent.process_message(msg)
|
||||
self.assertTrue(resp.should_reply)
|
||||
self.assertIn(resp.reply, ("嗯咯", "嗯啦", "嗯", "哦"))
|
||||
|
||||
def tearDown(self):
|
||||
db.clear_pending_quote_state(self.customer_id)
|
||||
|
||||
Reference in New Issue
Block a user