我使用用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'
}
]
}
}
}
我想创建一个卡,允许用户在单击卡后下载一些文件。