4

I'd like to create a notes/feedback field in my Lex bot, but it appears difficult to do.

It seems like AMAZON.LITERAL used to do this, and current suggestions are to create a custom slot and pump a bunch of random data into it (http://docs.aws.amazon.com/lex/latest/dg/gl-guidelines.html - bullet point 3 and other googles).

Is this the best way to do it? Does anyone know of any examples or methods to better show how this can be done?

sid8491
  • 6,622
  • 6
  • 38
  • 64
tkelch
  • 321
  • 3
  • 9
  • I haven't. I am accepting file name from a user. Filename could be anything. The 'pump of random data' doesn't work consistently. Still doing research. At the end of the day probably I have to move to DialogFlow, it has the @sys.any type which is analog of the AMAZON.LITERAL. – AntonIva Jun 21 '18 at 19:58

1 Answers1

4

In my case, feeding random data to the slot did not work. It used to capture only a part of input for the slot or most of the time it assigns NULL to the slot.

To solve this problem, I just made a slot without any data and in the DialogCodeHook I assigned the inputTranscript data into the slot.

slots = intent_request['currentIntent']['slots']
slots['your_slot'] = intent_request['inputTranscript']

Please comment/answer if you find a better way to do this.

sid8491
  • 6,622
  • 6
  • 38
  • 64
  • But what if you need only part of the inputTranscript? – AntonIva Jun 21 '18 at 20:00
  • @AntonIva then you could probably get complete `inputTranscript` and then perform regex on it. what do you want to achieve ? – sid8491 Jun 22 '18 at 06:43
  • Well, that will be a mess. If we go that direction, we have to update regex code everytime when someone update Utterances text (maybe OK for smaller projects, but ours not). Here is my case: https://stackoverflow.com/questions/50976487/lex-slot-type-for-file-name-amazon-literal-replacement – AntonIva Jun 22 '18 at 13:34