本文整理汇总了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?')
示例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?')
示例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"))
示例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)
示例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)
示例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?")
示例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?")
示例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?")
示例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?")
示例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?")
示例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?")
示例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?")
示例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?")
示例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?")
示例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)