-1

I built an alexa skill using Python with Flask_ask, which goes to my DB and retrieves information that I need and spells it out.

I am now trying to create a web UI which would have an option of asking the required question by typing it in or speaking directly to alexa. The web UI works easily as it redirects to the page I want as below :

@app.route('/getdog')
def getdog():
     return render_template('mypage.html')

Ideally I would configure an intent which would trigger the change in webpage e.g.

@ask.intent('myintent')
def changepage():
     getdog()

Any ideas how to handle this?

s_om
  • 661
  • 2
  • 9
  • 24

1 Answers1

0

You can use use a simple HTML form with a text input box:<form method="POST" action="/changepage/"> Enter Your Query: <input type="text" name="intent_string" /> <input type="submit" value="Ask Alexa"/> </form>

Your changepage url should call a method which handles calling other intents based on whatever string has been passes in the POST request. If you not able to exactly match the required intent to call you can add a full text search and match with that

Subhajeet Dey
  • 100
  • 3
  • 7
  • Thank you for the reply Subhajeet, but even if I add the html form, I would still have to type my question in correct? I was wondering if I can give an option to either type or speak my question. – s_om Jul 18 '18 at 18:33