feat: enforce full AI outbound generation and reduce template replies
This commit is contained in:
@@ -432,6 +432,31 @@ class RegressionPipelineTest(unittest.IsolatedAsyncioTestCase):
|
||||
self.assertTrue(resp.should_reply)
|
||||
self.assertIn(resp.reply, ("嗯咯", "嗯啦", "嗯", "哦"))
|
||||
|
||||
async def test_meaningless_short_text_not_ping_when_collecting(self):
|
||||
agent = CustomerServiceAgent()
|
||||
st = agent._get_conversation_state(self.customer_id)
|
||||
st.pending_image_urls = ["https://img.alicdn.com/a.jpg"]
|
||||
st.quote_phase = "collecting"
|
||||
agent._sync_pending_quote_state(self.customer_id, st)
|
||||
|
||||
msg = CustomerMessage(
|
||||
msg_id="m-meaningless-collecting",
|
||||
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.assertTrue((resp.reply or "").strip())
|
||||
self.assertNotIn(resp.reply, ("嗯咯", "嗯啦", "嗯", "哦"))
|
||||
|
||||
def tearDown(self):
|
||||
db.clear_pending_quote_state(self.customer_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user