- Mais recentes
- Mais votos
- Mais comentários
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"
}
}
}
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há 3 meses
- AWS OFICIALAtualizada há 3 anos
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>" } } } }