root před 2 měsíci
rodič
revize
2c8cd1a10c

+ 1 - 1
ai-slibra-assistant/util/request_utils.py

@@ -152,7 +152,7 @@ def business_service(session_id, uid, code, tools,  asr):
             mess +=",解决轻按1,未解决请按2"
         elif tools in ["fee_info", "fee_user_info"]:
             mess = "您账户截止"
-            statisticsTime = [content.get("statisticsTime") for content in contents]
+            statisticsTime = [content.get("statisticsTime", '') for content in contents]
             waterFees = [round(float(content.get("waterFees", 0)), 2) for content in contents]
             meterAmount = [round(float(content.get("meterAmount", 0)),2) for content in contents]
             mess = mess + statisticsTime[0] + "您的抄表表数为"+str(meterAmount[0]) +"欠费金额为" + str(waterFees[0])+ "元。如需详细查询缴费和水量情况可以登陆佳木斯供水公众号,如需人工查询请拨打8247777,解决轻按1, 未解决请按2."

+ 4 - 4
ai-slibra-assistant/util/utils.py

@@ -153,13 +153,13 @@ CREATE TABLE botrecords (
         answers = res.get("answer")
         intent = ''
         codes = [i for i in map(lambda x: x.get("code"), answers)]
-        if "1.20" in codes or "1.10" in codes or "1.00" in codes:
+        if "1.20" in codes or "1.10" in codes or "1.00" in codes or "1.30" in codes:
             for answer in answers:
-                if answer.get("code") in ["1.20", "1.10", "1.00"]:
+                if answer.get("code") in ["1.20", "1.10", "1.00", "1.30"]:
                     asr = answer.get("option", [{}])[-1].get("asr", '')
                     code = answer.get("code")
                     opt = answer.get("option", {})
-                    if (code == "1.10" and asr!="1") or (code == "1.00" and asr not in ["2", "1"]):
+                    if (code in ["1.10", "1.30"] and asr!="1") or (code == "1.00" and asr not in ["2", "1"]):
                         if opt:
                             if opt[-1].get("subclass"):
                                 intent = opt[-1].get("subclass")
@@ -250,4 +250,4 @@ def norm_community(asr):
 
 
 if __name__ == "__main__":
-    print(norm_community("嗯,那个我们家是碧水兰庭的"))
+    print(norm_community("五一村"))