def reload(self): """ 重新初始化 """ try: self.asr = ASR.get_engine_by_slug(config.get('asr_engine', 'tencent-asr')) self.ai = AI.get_robot_by_slug(config.get('robot', 'tuling')) self.tts = TTS.get_engine_by_slug(config.get('tts_engine', 'baidu-tts')) self.nlu = NLU.get_engine_by_slug(config.get('nlu_engine', 'unit')) self.player = None self.brain = Brain(self) self.brain.printPlugins() except Exception as e: logger.critical("对话初始化失败:{}".format(e))
def reInit(self): """重新初始化""" try: self.asr = ASR.get_engine_by_slug( config.get("asr_engine", "tencent-asr")) self.ai = AI.get_robot_by_slug(config.get("robot", "tuling")) self.tts = TTS.get_engine_by_slug( config.get("tts_engine", "baidu-tts")) self.nlu = NLU.get_engine_by_slug(config.get("nlu_engine", "unit")) self.player = None self.brain = Brain(self) self.brain.printPlugins() except Exception as e: logger.critical("对话初始化失败:{}".format(e))