Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: No usable messages given the current slot and sessionAttribute set

I made a chatbot in lex and for one particular intent, Lex is throwing the error,

An error has occurred: Invalid Bot Configuration: No usable messages 
given the current slot and sessionAttribute set.

This error comes regardless of the input in case of that intent. I am not using any lambda functions at this point for this intent. Can someone guide me what this means? I am new to lex and I did not find references to what this error is about.

like image 979
Kanika Agarwal Avatar asked Feb 19 '18 09:02

Kanika Agarwal


People also ask

How do you get AWS Lex welcome message?

You can follow these steps:Create a Slot type with only one value i.e: HelloMe . Create an Utterances HelloMessage . Create a Slot as follow: Required, name: answer , Slot Type: HelloMe , Prompt: 'AutoWelcomePrompt'. Pick Amazon Lambda for your Fulfillment that will send a response to your user.

Which Amazon Lex runtime service is used to send user input and get the response from Lex for chat channel?

Sends user input (text or speech) to Amazon Lex. Clients use this API to send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the user input using the machine learning model that it built for the bot.

What is slotToElicit?

slotToElicit set to the slot name for which the message is eliciting information. slots set to a map of slots, configured for the intent, with currently known values.

What are session attributes Lex?

Session attributes contain application-specific information that is passed between a bot and a client application during a session. Amazon Lex passes session attributes to all Lambda functions configured for a bot.


2 Answers

Recently I got the same error with the test of my bot after saving some changes. After a while, finally, I found out that it was because my confirmation message was using some slots not defined at that point.

Example:

Let's assume we have:

  • one required slot {name}
  • one optional slot {age}
  • and the confirmation message is "Your name is {name} and your age is {age}, is that right?"

If Lex reaches the point to ask for the user confirmation and {age} was never assigned whether in any utterance or a lambda function, then Lex will return this error.

You must ensure that all slots used in messages are defined.

like image 76
Wilfredo Pomier Avatar answered Sep 23 '22 23:09

Wilfredo Pomier


I believe this error occurs because you have not configured Lex to have a response message set for that particular intent's CodeHook or Fulfillment.

If you are not using a Lambda Function for Fulfillment, be sure to select 'Return Parameters to Client' in the 'Fulfillment' section, then also supply a response message below that in 'Response' section.
Here's where to find that in the Lex Console:

Lex Console Return Fulfillment Response

like image 25
Jay A. Little Avatar answered Sep 23 '22 23:09

Jay A. Little