You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Alexa AutoDelegation未触发:插槽填充流程异常排查求助

Alexa插槽委托失效:新技能直接进入COMPLETED状态问题

所有新创建的技能,哪怕是最基础的示例,AutoDelegation(或任何插槽填充方法)都无法生效,只有一个旧技能能正常运行。核心问题是插槽委托完全未触发——无论插槽是否必填、是否需要确认,整个流程都会直接进入COMPLETED状态,所有配置似乎都被忽略。

具体流程

  • 用不含插槽的话语触发意图
  • 命中InProgressSlotIntentHandler,此时dialogState为STARTED
  • 返回addDelegateDirective(currentIntent)
  • 状态突然变为COMPLETED,未填充任何插槽
  • 命中SlotIntentHandler,因插槽未填充导致代码报错

日志请求数据明确显示无插槽被确认,却直接进入COMPLETED状态:

{
    "type": "IntentRequest",
    "requestId": "amzn1.echo-api.request.786ea058-6258-4e8e-8eac-a777f561b3a6",
    "locale": "en-US",
    "timestamp": "2024-09-20T09:35:22Z",
    "intent": {
        "name": "SlotIntent",
        "confirmationStatus": "NONE",
        "slots": {
            "firstName": {
                "name": "firstName",
                "confirmationStatus": "NONE"
            },
            "testSlot": {
                "name": "testSlot",
                "confirmationStatus": "NONE"
            }
        }
    },
    "dialogState": "COMPLETED"
}

即使完全复制可运行的模板也无法解决问题。

最简交互模型提取内容

{
    "interactionModel": {
        "languageModel": {
            "intents": [
                {
                    "name": "SlotIntent",
                    "slots": [
                        {
                            "name": "testSlot",
                            "type": "AMAZON.DATE",
                            "samples": [
                                "give me a fact about {testSlot}",
                                "tell me some facts about {testSlot}",
                                "{testSlot}"
                            ]
                        }
                    ],
                    "samples": [
                        "tell me",
                        "tell me about {testSlot}"
                    ]
                }
            ]
        },
        "dialog": {
            "intents": [
                {
                    "name": "SlotIntent",
                    "confirmationRequired": false,
                    "prompts": {},
                    "slots": [
                        {
                            "name": "testSlot",
                            "type": "AMAZON.DATE",
                            "confirmationRequired": false,
                            "elicitationRequired": true,
                            "prompts": {
                                "elicitation": "Elicit.Slot.251925459829.983270759031"
                            }
                        }
                    ]
                }
            ],
            "delegationStrategy": "ALWAYS"
        },
        "prompts": [
            {
                "id": "Elicit.Slot.251925459829.983270759031",
                "variations": [
                    {
                        "type": "PlainText",
                        "value": "Give me a date."
                    }
                ]
            }
        ]
    }
}

处理委托和最终输出的代码

const InProgressSlotIntentHandler = {
  canHandle(handlerInput) {
    const request = handlerInput.requestEnvelope.request;
    return request.type === 'IntentRequest' &&
      request.intent.name === 'SlotIntent' &&
      request.dialogState !== 'COMPLETED';
  },
  handle(handlerInput) {
    const currentIntent = handlerInput.requestEnvelope.request.intent;
    return handlerInput.responseBuilder
      .addDelegateDirective(currentIntent)
      .getResponse();
  },
};

const SlotIntentHandler = {
  canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === 'IntentRequest'
      && handlerInput.requestEnvelope.request.intent.name === 'SlotIntent';
  },
  async handle(handlerInput) {
    const responseBuilder = handlerInput.responseBuilder;

    let speechText = `Here's is your slot - ${handlerInput.requestEnvelope.request.intent.slots.testSlot}`;
    
    return responseBuilder
      .speak(speechText)
      .getResponse();
  },
};

在Utterance Profiler中能正常工作,但部署后(设备、应用或模拟器中)直接返回“Here is your slot - undefined”。

想问这是Alexa当前的故障,还是我存在根本性错误?毕竟我有一个技能的其他意图能正常使用委托,但所有新创建的都不行。


内容的提问来源于stack exchange,提问作者Luke Schwoebel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 05:05:06