I thought of creating a lambda & API gateway to capture the input and record it before sending it to Lex , and on each intent lambda record the response , but seems like a round about way.
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.
You enable conversation logs to store bot interactions. You can use these logs to review the performance of your bot and to troubleshoot issues with conversations. You can log text for the PostText operation. You can log both text and audio for the PostContent operation.
An utterance is detected when Amazon Lex V2 recognizes the utterance as an attempt to invoke an intent configured for a bot. An utterance is missed when Amazon Lex V2 doesn't recognize the utterance and invokes the AMAZON.
event
which you receive in Lambda function, you can get raw text from inputTranscript
{'messageVersion': '1.0', 'invocationSource': 'DialogCodeHook', 'userId': '', 'sessionAttributes': {}, 'requestAttributes': {}, 'bot': {'name': 'bot_name', 'alias': 'bot_alias', 'version': '$LATEST'}, 'outputDialogMode': 'Text', 'currentIntent': {'name': 'invoked_intent_name', 'slots': {}, 'slotDetails': {}, 'confirmationStatus': 'None'}, 'inputTranscript': 'user message which triggered the intent'}
Hope it helps.
event.inputTranscript
The full event format is documented here.appendTranscript
is used to build the full transcript of the interaction.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With