- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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"
}
}
}
Contenuto pertinente
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata 2 anni fa
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>" } } } }