def run(self): if 'first_name' in self.config: salutation = (u"%s 我能为您做什么?" % self.config["first_name"]) else: salutation = "主人,我能为您做什么?" persona = 'DINGDANG' if 'robot_name' in self.config: persona = self.config["robot_name"] #ender: create conversation robot instance with config file. conversation = Conversation(persona, self.mic, self.config) # create wechat robot if self.config['wechat']: self.wxBot = WechatBot.WechatBot(conversation.brain) self.wxBot.DEBUG = True self.wxBot.conf['qr'] = 'tty' conversation.wxbot = self.wxBot t = threading.Thread(target=self.start_wxbot) t.start() self.mic.say(salutation, cache=True) #ender: this is the entrance of the robot conversation.handleForever()
def run(self): salutation = (u"%s,我能为您做什么?" % config.get("first_name", u'主人')) persona = config.get("robot_name", 'HUIMEIJINGLING') conversation = Conversation(persona, self.mic) # create wechat robot if config.get('wechat', False): self.wxBot = WechatBot.WechatBot(conversation.brain) self.wxBot.DEBUG = True self.wxBot.conf['qr'] = 'tty' conversation.wxbot = self.wxBot t = threading.Thread(target=self.start_wxbot) t.start() self.mic.say(salutation, cache=True) conversation.handleForever()
def run(self): salutation = (u"%s,我能为您做什么?" % config.get("first_name", u'主人')) persona = config.get("robot_name", 'DINGDANG') conversation = Conversation(persona, self.mic) # create wechat robot if config.get('wechat', False): self.wxBot = WechatBot.WechatBot(conversation.brain) self.wxBot.DEBUG = True self.wxBot.conf['qr'] = 'tty' conversation.wxbot = self.wxBot t = threading.Thread(target=self.start_wxbot) t.start() #self.mic.say(salutation, cache=True) self.mic.say(u"叮咚叮咚,我能为你做什么", cache=True) #self.mic.music_play('/home/pi/123.mp3') conversation.handleForever()
def run(self): if 'first_name' in self.config: salutation = (u"%s 我能为您做什么?" % self.config["first_name"]) else: salutation = "主人,我能为您做什么?" persona = 'XIAOHEI' if 'robot_name' in self.config: persona = self.config["robot_name"] conversation = Conversation(persona, self.mic, self.config) # create wechat robot if self.config['wechat']: self.wxBot = WechatBot.WechatBot(conversation.brain) self.wxBot.DEBUG = True self.wxBot.conf['qr'] = 'tty' conversation.wxbot = self.wxBot t = threading.Thread(target=self.start_wxbot) t.start() self.mic.say(salutation, cache=True) conversation.handleForever()