我使用Python编写的AWS Lambda函数返回带有附件的响应卡(根据
https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html#using-lambda-response-format
和
Hyperlink in response card button in Amazon Lex
def close_response_card(session_attributes, fulfillment_state, message):
return {
'sessionAttributes': session_attributes,
"dialogAction": {
"type": "Close",
"fulfillmentState": fulfillment_state,
'message': message,
"responseCard": {
"version": 1,
"contentType": "application/vnd.amazonaws.card.generic",
'genericAttachments': [
{
'title': 'Here is a list of hospitals',
'subTitle': 'Below is a map',
'attachmentLinkUrl': 'https://www.google.com/maps/search/?api=1&query=nearby+hospitals',
'imageUrl': 'https://images.sftcdn.net/images/t_optimized,f_auto/p/95612986-96d5-11e6-af7c-00163ec9f5fa/3771854867/google-maps-screenshot.png'
}
]
}
}
}
我想创建一张卡片,让用户在点击卡片后下载一些文件。