如果代理 Lex v2 机器人是在 8 月 17 日之后创建的,fulfilled intend对已实现响应中发送的交互式消息会中断 AWS Connect 流程

0

【以下的问题经过翻译处理】 2022年8月17日,Amazon Lex V2发布了一种新的与用户管理对话的方式的变更。这个变更好像破坏了与AWS Connect交互流程,如果底层Lambda函数在fulfilled intend响应时发送交互式消息。

以下是我用于测试的AWS Lambda函数:

const isNextStepElicitIntent=true;
const useCustomPayload=true;

exports.handler = async (event) => {
    console.log("Request " + JSON.stringify(event));
    
    const customPayload={
        "templateType":"ListPicker",
        "version":"1.0",
        "data":{
            "content":{
                "title":"Interactive Test",
                "subtitle":"Tap to select option",
                "elements":[
                    {"title":"Option 1"},
                    {"title":"Option 2"}
                ]
            }
        }
    };
                
    var response;
    var message;
    
    if(useCustomPayload){
        message={
            "contentType": "CustomPayload",
            "content": JSON.stringify(customPayload)
        };
    }
    else{
         message={
            "contentType": "PlainText",                
            "content":"Help response"
         };
    }
    
    
    if (isNextStepElicitIntent){
        response = {
            "sessionState": {
                "sessionAttributes": {},
                "dialogAction": {
                    "type": "ElicitIntent"
                }
            },
            "messages": [
                message
            ]
        };
    }
    else{
        response = {
            "sessionState": {
                "sessionAttributes": {},
                "dialogAction": {
                    "type": "ElicitSlot",
                    "slotToElicit": "DummySlot"
                },
                "intent": {
                    "name": "Help",
                    "slots": {
                        "DummySlot": null
                    }
                }
            },
            "messages": [
                message
            ]
        };
    }
    
    console.log("Response: " + JSON.stringify(response));
    return response;
};

使用在8月17日之前创建的Lex v2 bot,在intent中添加help intent,将“help”作为utterance,并在intent中添加“DummySlot”,在“Code hooks”部分中

1 回答
0

【以下的回答经过翻译处理】 你好,感谢您提出关于自定义有效载荷的问题。我们已经确定了问题,正在以最高优先级进行修复。修复方案将在9/23之前提供。

profile picture
专家
已回答 7 个月前

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

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

回答问题的准则