- 新しい順
- 投票が多い順
- コメントが多い順
Hello
The above error occurs when “intent” has not been specified for closing in the session state. When we specify the type option as “Close”, it ends the specified intent fulfillment process. To close, we need to specify the intent in the lambda response that needs to be closed. Please add the intent in the session state using the syntax in https://docs.aws.amazon.com/lexv2/latest/dg/lambda-common-structures.html#lambda-intent .
Hi Divya003, I am getting the same error after adding the intent: lex_response = { "sessionState": { "dialogAction": { "type": "Close", "fulfillmentState": "Fulfilled", "intent": { "name": "FallbackIntent" }, "message": { "contentType": "SSML", "content": f"<speak><audio src='{audio_url}'/></speak>" } } } }
The one that I got working for me (up to some extent of the format that I expected) is this one:
lex_response = {
"messages": [
{
"contentType": "SSML",
"content": f"<speak><audio src='{audio_url}'/></speak>",
"type": "unstructured"
},
{
"contentType": "PlainText",
"content": response["answer"],
"type": "unstructured"
}
],
"sessionState": {
"dialogAction": {
"type": "ElicitIntent"
}
}
}
関連するコンテンツ
- AWS公式更新しました 2年前
- AWS公式更新しました 2年前
Hi Divya003, I am getting the same error after adding the intent: lex_response = { "sessionState": { "dialogAction": { "type": "Close", "fulfillmentState": "Fulfilled", "intent": { "name": "FallbackIntent" }, "message": { "contentType": "SSML", "content": f"<speak><audio src='{audio_url}'/></speak>" } } } }