root 1 mēnesi atpakaļ
vecāks
revīzija
627efc0cf8
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      ai-slibra-assistant/util/request_utils.py

+ 6 - 2
ai-slibra-assistant/util/request_utils.py

@@ -5,6 +5,8 @@
 @File    : request_utils.py.py
 @Desc    : 
 """
+import sys
+sys.path.append("/Users/caoyongchuang/PycharmProjects/predict/ai-slibra-assistant")
 import re
 import os
 import shutil
@@ -18,6 +20,7 @@ import uuid
 SERVE_HOST = os.environ.get("SERVE_HOST", "192.168.100.159")
 VOICE_DIR = os.environ.get("VOICE_DIR","/root/aibot/dm/voice")
 
+
 logger = get_logger()
 
 def nlg_service(uid, bid, node_name, choose_speech):
@@ -143,7 +146,7 @@ def business_service(session_id, uid, code, tools,  asr):
         if tools in ["water_info", "water_loc_info"]:
             mess = '您查询的小区'
             neighbourhoodName = [item.get('neighbourhoodName') for item in contents]
-            reason = [item.get('reason') for item in contents]
+            reason = ["因"+item.get('reason') for item in contents]
             timeBegin = ["于"+item.get('timeBegin') + "停水" for item in contents]
             timeEnd = [item.get('timeEnd') for item in contents]
             conclusions = [f"预计{time}恢复供水" if time is not None else "暂未确定恢复时间" for time in timeEnd]
@@ -259,6 +262,7 @@ def aibot_service(ip ="192.168.100.159",port="40072", nodeId="start", userId='no
 
 
 if __name__ == "__main__":
-    print(voice_service("欢迎致电“佳木斯龙江环保供水服务热线”。我们最新推出智能语音服务,说话就能查询业务, 抢先体验请按1, 传统服务请按2"))
+    text="欢迎致电“佳木斯龙江环保供水服务热线”。我们最新推出智能语音服务,说话就能查询业务, 抢先体验请按1, 传统服务请按2"
+    print(voice_service(text))
     #intent_service("1", "没听清", "2200", "1", "10", "1")
     #aibot_service()