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


Python flask_ask.question方法代码示例

本文整理汇总了Python中flask_ask.question方法的典型用法代码示例。如果您正苦于以下问题:Python flask_ask.question方法的具体用法?Python flask_ask.question怎么用?Python flask_ask.question使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在flask_ask的用法示例。


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

示例1: user_feels_good

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def user_feels_good():
    """This function is triggered if the PositiveFeeling intent is detected. """
    congrats = [
        'That is so good to hear!',
        'I am happy you feel good today',
        'I am glad to hear that.',
        'Oh happy day!',
        'Awesome.',
        'Good to hear!',
        'Wonderful!',
        'Great!',
        'I am so happy about that!'
    ]

    session.attributes["feeling"] = "Good"
    session.attributes["State"] = "Question 0 Answered"
    return question((random.choice(congrats)) + '      ' + 'Is there anything else you need? Want me to recommend a therapist?') 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:19,代码来源:voice.py

示例2: user_feels_good

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def user_feels_good():
    """This function is triggered if the PositiveFeeling intent is detected. """
    congrats = [
        'That is so good to hear!',
        'I am happy you feel good today',
        'I am glad to hear that.',
        'Oh happy day!',
        'Awesome.',
        'Good to hear!',
        'Wonderful!',
        'Great!',
        'I am so happy about that!',
        'That is so great!'
    ]

    session.attributes["feeling"] = "Good"
    session.attributes["State"] = "Question 0 Answered"
    return question((random.choice(congrats)) + '      ' + 'Is there anything else you need? Want me to recommend a therapist?') 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:20,代码来源:voice.py

示例3: login

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def login():
    text = render_template("login_text")
    prompt = render_template("login_text")
    return question(text).reprompt(prompt) \
        .simple_card(title=render_template("login_title"),
                     content=render_template("login_content")) 
开发者ID:stevenleeg,项目名称:geemusic,代码行数:8,代码来源:selection.py

示例4: help

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def help():
    text = render_template("help_text")
    prompt = render_template("help_prompt")
    return question(text).reprompt(prompt) 
开发者ID:stevenleeg,项目名称:geemusic,代码行数:6,代码来源:selection.py

示例5: start_session

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def start_session():
    """ This function is what initializes the application. It calls the welcome() method from controller.py
    to generate a different welcome message each time """
    welcome_text = welcome()
    welcome_re_text = re()

    return question(welcome_text).reprompt(welcome_re_text) 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:9,代码来源:voice.py

示例6: user_feels_bad

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def user_feels_bad():
    """This function is triggered if the NegativeFeeling intent is detected. This also kicks off the question to guage
    whether the user has perfomed daily activities."""
    condolence = condolences()
    session.attributes["feeling"] = "Down"
    session.attributes["State"] = "Question 1 Answered"
    return question(condolence + "       " + "Have you gotten out of bed today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:9,代码来源:voice.py

示例7: out_of_bed

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def out_of_bed():
    message = random.choice([
                'Awesome.',
                'Good to hear!',
                'Wonderful!',
                'Great!',
    ])
    session.attributes["Bed"] = "Yes"
    session.attributes["State"] = "Question 2 Answered"
    return question (message + "         " + "Have you eaten today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:12,代码来源:voice.py

示例8: not_out_of_bed

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def not_out_of_bed():

    message = random.choice([
        "That's too bad.",
        "That's okay, we all have days like that.",
        "I'm sorry. ",
        "That's too bad",
        "It's okay."
    ])

    session.attributes["State"] = "Question 2 Answered"
    session.attributes["Bed"] = "No"
    return question(message + "            " + "Have you eaten today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:15,代码来源:voice.py

示例9: not_eaten

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def not_eaten():
    message = random.choice([
        "That's too bad.",
        "That's okay, we all have days like that.",
        "I'm sorry. ",
        "That's not good.",
        "It's okay."
    ])

    session.attributes["Eaten"] = "No"
    session.attributes["State"] = "Question 3 Answered"
    return question(message + "            " + "Have you showered today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:14,代码来源:voice.py

示例10: showered

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def showered():
    message = random.choice([
        'Awesome.',
        'Good to hear!',
        'Wonderful!',
        'Great!',
    ])

    session.attributes["Showered"] = "Yes"
    session.attributes["State"] = "Question 4 Answered"
    return question(message + " " + "Have you gotten dressed?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:13,代码来源:voice.py

示例11: not_showered

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def not_showered():
    message = random.choice([
        "That's too bad.",
        "That's okay, we all have days like that.",
        "I'm sorry. ",
        "That's not good.",
        "It's okay."
    ])

    session.attributes["Showered"] = "No"
    session.attributes["State"] = "Question 4 Answered"
    return question(message + "            " + "Have you gotten dressed?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:14,代码来源:voice.py

示例12: dressed

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def dressed():
    message = random.choice([
        'Awesome.',
        'Good to hear!',
        'Wonderful!',
        'Great!',
    ])

    session.attributes["Dressed"] = "Yes"
    session.attributes["State"] = "Question 5 Answered"
    return question(message + "            " + "Have you gone outside at all today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:13,代码来源:voice.py

示例13: not_dressed

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def not_dressed():
    message = random.choice([
        "That's too bad.",
        "That's okay, we all have days like that.",
        "I'm sorry. ",
        "That's not good.",
        "It's okay."
    ])

    session.attributes["Dressed"] = "No"
    session.attributes["State"] = "Question 5 Answered"
    return question(message + "         " + "Have you gone outside at all today?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:14,代码来源:voice.py

示例14: suggest_ideas

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def suggest_ideas():
    suggestion_inquiry = "Okay. Here's an idea for an extra way to improve your mood."
    idea = ideas()
    session.attributes["State"] = "Suggested"
    return question(suggestion_inquiry + "       " + idea + "          " + "Would you like another suggestion?") 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:7,代码来源:voice.py

示例15: handle_help

# 需要导入模块: import flask_ask [as 别名]
# 或者: from flask_ask import question [as 别名]
def handle_help():
    """
    This handles the 'help' built-in intention.

    """

    help_text = """There's a few things I can do to help. I can recommend a therapist or offer a suggestion for
                a way to improve your mood. I also possess the capability to detect suicidal intentions,
                but I really hope that you won't need me to do that. """
    return question(help_text) 
开发者ID:Jflick58,项目名称:DepressionAI,代码行数:12,代码来源:voice.py


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