当前位置: 首页>>代码示例>>Python>>正文


Python conversation.Conversation类代码示例

本文整理汇总了Python中client.conversation.Conversation的典型用法代码示例。如果您正苦于以下问题:Python Conversation类的具体用法?Python Conversation怎么用?Python Conversation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Conversation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

    def run(self):
        greet = ["How can I be of service master?", "I live again master", "hal 9000 now on line", "hello how are you master"]
        
        salutation = random.choice(greet)
        self.mic.say(salutation)

        conversation = Conversation("JARVIS", self.mic, self.config)
        conversation.handleForever()
开发者ID:DarthToker,项目名称:jasper-client,代码行数:8,代码来源:jasperback.py

示例2: run

    def run(self):
        if 'first_name' in self.config:
            salutation = "How can I be of service, %s?" % self.config["first_name"]
        else:
            salutation = "How can I be of service?"
        self.mic.say(salutation)

        conversation = Conversation("JASPER", self.mic, self.config)
        conversation.handleForever()
开发者ID:BladeSA,项目名称:jasper-client,代码行数:9,代码来源:jasper.py

示例3: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("How can I be of service, %s?"
                          % self.config["first_name"])
        else:
            salutation = "How can I be of service?"
        self.mic.say(salutation)

        conversation = Conversation("JASPER", self.mic, self.config) # It's looking like the python app doesn't do any voice processing?
        conversation.handleForever()
开发者ID:bfla,项目名称:river-python,代码行数:10,代码来源:jasper.py

示例4: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("Was kann ich für dich tun?, %s?"
                          % self.config["first_name"])
        else:
            salutation = "Was kann ich für dich tun?"
        self.mic.say(salutation)

        conversation = Conversation("JASPER", self.mic, self.config)
        conversation.handleForever()
开发者ID:jt182,项目名称:jasper-client,代码行数:10,代码来源:jasper.py

示例5: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("Hi, I am Bibli robot, my name is Lucky!") # %s?"
                         # % self.config["first_name"])
        else:
            salutation = "Hi, I am Bibli robot, my name is Lucky"
        self.mic.say(salutation)

        conversation = Conversation("LUCKY", self.mic, self.config)
        conversation.handleForever()
开发者ID:yovia,项目名称:Bibli_2,代码行数:10,代码来源:jasper.py

示例6: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("Hi 很高兴为你服务,我是小爱,聪明活泼的可可小爱,是你的语音小助手。我可以提供天气预报,时间查询,简单的数学计算,读唐诗,讲笑话,回答百科知识,根据和你的对话,还可以管理家中的网络设备。你可以通过,你好,可可小爱,来跟我打招呼。")
        else:
            salutation = "Hello 我是可可小爱,随时为你服务。"
        # print " ".join(jieba.cut("hello可可小爱"))
        self.mic.say(salutation)

        conversation = Conversation(u"hello|可可|小爱|你好|您好|咳咳|小艾|哈喽|可爱", self.mic, self.config)
        conversation.handleForever()
开发者ID:geektown,项目名称:jasper-client,代码行数:10,代码来源:jasper.py

示例7: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("How can I be of service, %s?"
                          % self.config["first_name"])
        else:
            salutation = "Powering up in LVL1. It's good to be back."
        self.mic.say(salutation)

        conversation = Conversation("WHOPPER", self.mic, self.config)
        conversation.handleForever()
开发者ID:jgissend10,项目名称:woprjr,代码行数:10,代码来源:jasper.py

示例8: run

    def run(self):
        #if 'first_name' in self.config:
        #    salutation = ("How can I be of service, %s?"
        #                  % self.config["first_name"])
        #else:
        #    salutation = "How can I be of service?"
	salutation = "Welcome to Biri!  What would you like?"
        self.mic.say(salutation)

        conversation = Conversation("JASPER", self.mic, self.config)
        conversation.handleForever()
开发者ID:dvorac,项目名称:jasper-client,代码行数:11,代码来源:jasper.py

示例9: run

    def run(self):
	first_name = client.jasperprofile.profile.get('first_name','')
        if first_name:
            salutation = (_("How can I be of service, %s?") % first_name)
        else:
            salutation = _("How can I be of service?")

        self.mic.say(salutation)

        conversation = Conversation("MACSEN", self.mic, client.jasperprofile.profile.get_yml())
        conversation.handleForever()
开发者ID:GruffPrys,项目名称:macsen,代码行数:11,代码来源:jasper.py

示例10: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("How can I be of service, %s?"
                          % self.config["first_name"])
        else:
            salutation = "How can I be of service?"
        self.mic.say(salutation)

        persona_name = self.config.get('persona_name', 'RALPH')
        conversation = Conversation(persona_name, self.mic, self.config)
        signal.signal(signal.SIGINT, self.get_sigint_handler(conversation))
        conversation.handleForever()
开发者ID:chriswijones,项目名称:jasper-client,代码行数:12,代码来源:jasper.py

示例11: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("How can I be of service, %s?"
                          % self.config["first_name"])
        else:
            salutation = "How can I be of service?"
        self.speaker.clean_and_say(salutation)

        print("A moment of silence, please...")
        self.mic.adjust_for_ambient_noise()

        conversation = Conversation(self.requester, self.brain)
        conversation.handleForever()
开发者ID:lowdev,项目名称:jasper-client,代码行数:13,代码来源:jasper.py

示例12: run

    def run(self):
        if 'first_name' in self.config:
            salutation = ("Bonjour %s, que puis-je faire pour vous ?"
                          % self.config["first_name"])
        else:
            salutation = "Bonjour, que puis-je faire pour vous ?"
        self.mic.say(salutation)

	if 'name' in self.config:
	    name = self.config['name'].upper()
	else:
	    name = "LOLA"	
        conversation = Conversation(name, self.mic, self.config)
        conversation.handleForever()
开发者ID:overflOw11,项目名称:lola,代码行数:14,代码来源:jasper.py

示例13: run

    def run(self):
        # Random welcome message
        welcomes = ["What do you need",
                    "How can I help"]

        salutation = random.choice(welcomes)
        if 'first_name' in self.config:
            salutation = ("%s, %s?"
                          % (salutation, self.config["first_name"]))
        else:
            salutation = ("%s?" % salutation)

        self.mic.say(salutation)

        conversation = Conversation("SAGE", self.mic, self.config)
        conversation.handleForever()
开发者ID:ajay-gandhi,项目名称:jasper-client,代码行数:16,代码来源:jasper.py

示例14: run

    def run(self):
	hour = int(time.strftime("%H"))
        
	if hour > 6 and hour < 11:
	    salutation = "Good morning"
        elif hour >= 11 and hour < 16:
	    salutation = "Good afternoon"
        elif hour >= 16 and hour < 23:
            salutation = "Good evening"
        else:
            salutation = "Hi there"

        self.mic.say(salutation)

        conversation = Conversation(self.config['persona'], self.mic, self.config)
        conversation.handleForever()
开发者ID:noamshemesh,项目名称:jasper-client,代码行数:16,代码来源:jasper.py

示例15: run

    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)
        conversation.handleForever()
开发者ID:codywon,项目名称:dingdang-robot,代码行数:17,代码来源:dingdang.py


注:本文中的client.conversation.Conversation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。