【发布时间】:2017-06-20 22:12:08
【问题描述】:
所以我在这里陷入了一个令人困惑的境地。我正在构建一个 Amazon Lex 机器人,当让 Amazon Polly 以音频格式给出最终确认时,它只提供音频输出,但文本不会显示在 Lex 控制台中。
例如,在我的 python 代码中,这是一个最后的确认片段:
if outputDialogMode == 'Text':
return close(
session_attributes,
'Fulfilled',
{
'contentType': 'PlainText',
'content': 'Your reservation has been confirmed from"+str(start_time)+" to "+str(end_time)+". Your Booking ID is " + str(booking_id)
}
)
elif outputDialogMode == 'Voice':
return close(
session_attributes,
'Fulfilled',
{
'contentType': 'SSML',
'content': '<speak>Your reservation has been confirmed from"+str(start_time)+" to "+str(end_time)+". Your Booking ID is " + str(booking_id) +'</speak>'
}
)
现在,当我希望 Lex 以音频格式 (outputDialogMode == 'Voice') 输出 content 时,它只会说出它并且不会在控制台上显示文本。有没有办法让它同时说话和显示文本?
注意:上面的代码只是我整个代码中发送输出消息的部分。
【问题讨论】:
标签: python amazon-lex amazon-polly