Python flask_ask.question() Examples

The following are 30 code examples of flask_ask.question(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask_ask , or try the search function .
Example #1
Source File: voice.py    From DepressionAI with MIT License 6 votes vote down vote up
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?') 
Example #2
Source File: voice.py    From DepressionAI with MIT License 6 votes vote down vote up
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?') 
Example #3
Source File: voice.py    From DepressionAI with MIT License 6 votes vote down vote up
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?') 
Example #4
Source File: voice.py    From DepressionAI with MIT License 6 votes vote down vote up
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?') 
Example #5
Source File: voice.py    From DepressionAI with MIT License 6 votes vote down vote up
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?') 
Example #6
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #7
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_out_move_left(kodi):
  card_title = render_template('player_zoom_out_left').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomOut()
  kodi.PlayerMoveLeft()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomOutMoveRight intent. 
Example #8
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #9
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #10
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #11
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_in_move_right(kodi):
  card_title = render_template('player_zoom_in_right').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomIn()
  kodi.PlayerMoveRight()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomOut intent. 
Example #12
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_in(kodi):
  card_title = render_template('player_zoom_in').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomIn()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomInMoveUp intent. 
Example #13
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_in_move_up(kodi):
  card_title = render_template('player_zoom_in_up').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomIn()
  kodi.PlayerMoveUp()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomInMoveDown intent. 
Example #14
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_in_move_down(kodi):
  card_title = render_template('player_zoom_in_down').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomIn()
  kodi.PlayerMoveDown()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomInMoveLeft intent. 
Example #15
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_in_move_left(kodi):
  card_title = render_template('player_zoom_in_left').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomIn()
  kodi.PlayerMoveLeft()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomInMoveRight intent. 
Example #16
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_out_move_down(kodi):
  card_title = render_template('player_zoom_out_down').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomOut()
  kodi.PlayerMoveDown()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomOutMoveLeft intent. 
Example #17
Source File: alexa.py    From kanzi with MIT License 5 votes vote down vote up
def alexa_player_zoom_out_move_right(kodi):
  card_title = render_template('player_zoom_out_right').encode('utf-8')
  log.info(card_title)

  kodi.PlayerZoomOut()
  kodi.PlayerMoveRight()
  response_text = render_template('short_confirm').encode('utf-8')
  return question(response_text)


# Handle the PlayerZoomReset intent. 
Example #18
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #19
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #20
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #21
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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) 
Example #22
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #23
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
def not_outside():
    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["Outside"] = "No"
    session.attributes["State"] = "Suggested"
    response = evaluate_answers()
    suggestion_inquiry = "Let's also try something else to improve your mood."
    idea = ideas()
    return question(message + "      " + response + "       " + suggestion_inquiry + "       " + idea + "          " + "I hope I could help.  Would you like another suggestion?") 
Example #24
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #25
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #26
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #27
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #28
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
def eaten():
    message = random.choice([
        'Awesome.',
        'Good to hear!',
        'Wonderful!',
        'Great!',
    ])
    session.attributes["Eaten"] = "Yes"
    session.attributes["State"] = "Question 3 Answered"
    return question(message + "           " + "Have you showered today?") 
Example #29
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?") 
Example #30
Source File: voice.py    From DepressionAI with MIT License 5 votes vote down vote up
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?")