feat: expand colloquial reply sets and support cross-image quote intent

This commit is contained in:
2026-02-28 23:23:51 +08:00
parent 5a73aa34d2
commit ca7e195d8f
3 changed files with 192 additions and 18 deletions

View File

@@ -113,6 +113,32 @@ class RegressionPipelineTest(unittest.IsolatedAsyncioTestCase):
self.assertIn("45", resp.reply)
agent._quote_pending_images.assert_awaited()
async def test_cross_image_composite_intent_triggers_quote(self):
agent = CustomerServiceAgent()
st = agent._get_conversation_state(self.customer_id)
st.pending_image_urls = ["https://img.alicdn.com/a.jpg", "https://img.alicdn.com/b.jpg"]
st.pending_requirements = []
agent._sync_pending_quote_state(self.customer_id, st)
agent._quote_pending_images = AsyncMock(return_value={"reply": "这个跨图合成可以做打包50元", "need_transfer": False})
msg = CustomerMessage(
msg_id="m5",
acc_id="test_shop",
msg="A图的图案转换到B图上去",
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("50", resp.reply)
agent._quote_pending_images.assert_awaited()
async def test_pending_state_restore(self):
db.update_pending_quote_state(self.customer_id, ["u1", "u2"], ["r1"])
agent = CustomerServiceAgent()