I am developing a chatbot with Amazon Lex and I want to collect a description of a customers issue, save it to a variable, and send it through email. How can I implement this functionality?
Asked
Active
Viewed 375 times
-1
-
Unfortunately Lex does not have a generic "Any" slot type that can capture what is essentially free-form text. You can, however, use a Lambda for slot input verification and simply collect the user's input into the relevant slot's value in within the session and/or request variables. You may need to use a variety of sentences as training data for a custom slot type. – Reegz May 24 '22 at 10:54
1 Answers
0
I had a similar problem that I was able to solve by creating a Lambda function to access the user's inputTranscript.
You basically provide the Lex Bot with some sample utterances (which usually will capture part of what the user has said) and in your Lambda function, access the the event.inputTranscript
. This is the last thing the user has typed exactly as they typed it.
My project was written in NodeJS so I used Nodemailer and the Gmail API to send the inputTranscript in an email. This is the video tutorial I followed at the time. It'll show you how to set everything up :)
If you are using Python, you can use the built-in library smtplib to send emails. Although I'm sure there are other options as well.
Hope this helps!

Kera
- 65
- 6