Skip to content

I'm building a translation chatbot using IAMLambda, Lex v2, and Translate. The lambda code works when I deploy it and test it, but when I ask the chatbot to translate, I get "Lambda error: 'text'".

0

I'm new to AWS and recently got my Solutions Architect Associates, and am trying to create a chatbot that translates user input text into another language. I created the Lambda function in Python and when i deployed it and tested it, everything worked fine. I connected the chatbot with the translation intent, but it still seems to not work. The slots in my intent that i have are as follows: SLOT 1: Prompt for Slot: Language // Slot Type: Language SLOT 2: Prompt for Slot: Text // AMAZON.FreeFormInput

I'm new to Lex as well, and the first slot came up as blue, but the second came up as red, and I'm pretty sure the working slot types should be blue as well.

When I run the chatbot, the test runs like this:

Can you help me translate this? Insert custom response "Lambda error: 'text'.

is there anyway to fix this? I was following along with TechWithLucy's project step-by-step and I can't get a response from her about it. It's been over a month of waiting.

asked 2 years ago518 views

1 Answer
0
  • In Lex V2, the ‘text’ that the user inputs is located in event['messages'][0]['content']. Make sure the format you are expecting is this.
  • Check also that the slot types are correctly configured. The AMAZON.FreeFormInput slot type should work for capturing general text input. If it’s showing up as red in the Lex console, there might be an issue with how it’s configured.

Remember to have a monitoring process in place to look at everything that happens

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.