Lex Delegate not working

0

Hi there! I have the following Lambda code

import json


def router(event):
    intent_name = event['sessionState']['intent']['name']
    intent = event['sessionState']['intent']['name']
    slots = event['sessionState']['intent']['slots']
    
    print("event: ")
    
    response = {
        "sessionState": {
            "dialogAction": {
                "type": "Delegate"
            },
            "intent": {
                'name': intent,
                'slots': slots
            }
        }
    }
    
    return response

def lambda_handler(event, context):
    print(event)
    response = router(event)
    print("response", response)
    return response

I made it exact as here https://github.com/CumulusCycles/Amazon_Lex_demo/blob/main/Lambda/lambda_handler.py. But for some reason I always get error with the next message: Invalid Bot Configuration: No usable messages given the current slot, sessionAttribute, and requestAttribute set.

No Answers

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.

Guidelines for Answering Questions