3
votes

I'm trying to build a chatbot using Amazon's boto3 library. Right now, I am trying to create an intent using the put_intent function. My code is as follows:

intent = lexClient.put_intent(name = 'test',                                 
                              sampleUtterances = ["Who is messi?"]  
                              )

When I try running this, I get the following exception:

botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the PutIntent operation: RelativeId does not match Lex ARN format: intent:test2:$LATEST

Can anyone tell me what I'm doing wrong?

3

3 Answers

5
votes

I got the same error when trying to have a digit in intent name field. Realized that was not allowed when trying to do the same from AWS console.

Error handling could really be more specific.

3
votes

Try taking the question mark out of the utterance, that has caused me issues in the past!

0
votes

You need to run GetSlotType. That will return current checksum for that slot. Put that checksum in your PutSlotType checksum. Big bang boom.

https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/LexModelBuildingService.html#getSlotType-property

var params = { name: "AppointmentTypeValue", checksum:'54c6ab5f-fe30-483a-a364-b76e32f6f05d',

description: "Type of dentist appointment to schedule'",
enumerationValues: [
    {
        value: "cleaning"
    },
    {
        value: "whitening"
    },
    {
        value: "root canal"
    },
    {
        value:"punch my face"
    }
]

};