I am trying to create a simple Alexa skill using Flask Ask in python.
I have an intention called "SearchIntent" with the word "searchterm" , and the python code looks something like this:
@ask.intent("SearchIntent")
def SearchIntent(searchterm):
resList = []
searchterm = searchterm.lower()
for item in somelist:
if item.find(searchterm) != -1:
resList.append(item)
return question("I Found " + str(len(resList)) + ", Do you want me to list them all?")
I want to check if the answer from the user answers if he says "Yes", than to read all the results:
return statement('\n'.join(resList))
and if the user says no to perform another action
sort of:
...
return question("I Found " + str(len(resList)) + ", Do you want me to list them all?")
if "return question" == "yes":
do something
else:
do something else
I do not want to create a search function in YesIntent again, is it possible to do something like this in the same function?
Thank you in advance!
source
share