I am trying to create a simple Alexa skill using Flask Ask in python.
I have an intent called "SearchIntent" with a "searchterm" slot 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 response from the user, if he says "Yes" than read all the results:
return statement('\n'.join(resList))
and if the user says no, to perform some other action
something like:
...
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 don't want to create the search function again in a YesIntent, Is it possible to do something like this within the same function?