1

Whatever and whenever user speaks I want to pass it to my API and send API response to Alexa using python flask-ask.

I don't want to use AWS lambda. I want to know is it possible and if it does then how can I achieve it.

eg:

UserVoiceInput = anything that user says

def anyfunc():
    abc = MyApiUrl?message=UserVoiceInput
    return statement(abc["Response_Message"])

how can I achieve the above logic using python flask-ask

Samuel Hulla
  • 6,617
  • 7
  • 36
  • 70
amol rane
  • 325
  • 1
  • 13

1 Answers1

1

Yes you can achieve this with flask-ask

@ask.intent("IntentName")
def function(slotvalue):
    example = get_api_response(slotvalue)
    example_msg = 'the result is {}'.format(example)
    return statement(example_msg)

then define your function some thing like below.

def get_api_response(value):
    # Do your api call 
    return response
dineshh912
  • 148
  • 1
  • 13