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.

Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande