无论用户何时发言,我都希望将其传递给我的API,并使用python flask-ask将API响应发送给Alexa。
我不想使用AWS lambda。我想知道这是可能的,如果可能,那么我如何实现它。
例如:
UserVoiceInput = anything that user says
def anyfunc():
abc = MyApiUrl?message=UserVoiceInput
return statement(abc["Response_Message"])如何使用python flask-ask实现上述逻辑
发布于 2018-08-17 17:36:12
是的,您可以使用flask-ask来实现这一点
@ask.intent("IntentName")
def function(slotvalue):
example = get_api_response(slotvalue)
example_msg = 'the result is {}'.format(example)
return statement(example_msg)然后像下面这样定义你的函数。
def get_api_response(value):
# Do your api call
return responsehttps://stackoverflow.com/questions/51655477
复制相似问题