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.

已提问 8 个月前105 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则