From fd1ec32dd6f29e6dcee5df37b057402796408348 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 30 Oct 2026 18:50:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8B=B1=E5=9B=BD=E7=A9=BA?= =?UTF-8?q?=E8=BF=90=E9=97=AE=E9=A2=98=E8=A2=AB=E9=80=9A=E7=94=A8=E7=A9=BA?= =?UTF-8?q?=E8=BF=90=E5=85=B3=E9=94=AE=E8=AF=8D=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logistics_chat/knowledge.py | 2 +- tests/test_rules.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/logistics_chat/knowledge.py b/logistics_chat/knowledge.py index a3066c4..ec1cfea 100644 --- a/logistics_chat/knowledge.py +++ b/logistics_chat/knowledge.py @@ -212,7 +212,7 @@ knowledge_list = [ "text":"英国专线(DPD)双清价格:英国海运21KG+ 12.8元/kg、101KG+/301KG+ 10.9元/kg,时效约40天提取;英国铁路21KG+ 18.0元/kg、101KG+ 16.2元/kg,发车后25-30天提取;中英卡航21KG+ 21.4元/kg、101KG+ 19.4元/kg,发车后20-22天提取。VAT自税/递延价更低(海运10.0/8.1、铁路15/13.2、卡航18.4/16.4)。北极航线英国海运25-28天,价格单询。卡航单件不超30kg、尺寸≤98×68×59cm。" }, { - "keys":["英国空运","英国","UK","伦敦"], + "keys":["英国空运","英国空运价格","英国空运多久","英国空运多少钱","英国","UK","伦敦"], "text":"英国空运专线(双清)单价:22KG+ 48元/kg,51KG+ 44元/kg,101KG+ 42元/kg,时效8-10个自然日提取。VAT自税/递延为44/40/38元/kg,带电货47.5/42.5/41.5元/kg。拒收北爱尔兰、苏格兰高地等偏远地址。" }, { diff --git a/tests/test_rules.py b/tests/test_rules.py index a1bd46a..21c6aa3 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -13,7 +13,9 @@ from logistics_chat import knowledge, pricing, tracking class RuleTests(unittest.TestCase): def test_specific_knowledge_wins_and_unknown_questions_have_no_match(self): - self.assertIn('22KG+', knowledge.search_knowledge('英国空运价格')) + for question in ('英国空运价格','英国空运多久','英国空运多少钱'): + self.assertIn('22KG+', knowledge.search_knowledge(question)) + self.assertIn('21KG+', knowledge.search_knowledge('欧洲空运价格')) self.assertIsNone(knowledge.search_knowledge('没有相关关键词的测试')) def test_sea_tier_boundary_and_minimum(self):