天道酬勤,学无止境

Alexa Dialog Model Step 和 dialogState 从未在 COMPLETED(Alexa Dialog Model Step and dialogState is never in COMPLETED)

问题

我正在使用 PHP 端点实现 Alexa 对话模型。 我使用了 Alexa 文档(https://developer.amazon.com/fr/docs/custom-skills/dialog-interface-reference.html)

这是我的例子: 我的技能:

请求意图

话语:在卧室里添加一个 {obj}

插槽:{obj} / 插槽填充

短语:

我:Alexa,在卧室里添加一个对象

Alexa:你想在卧室里添加什么物品?

我:我想在卧室里加一辆汽车

Alexa:你想在卧室里加一辆车吗?

我可以

步骤1:

DialogState 已启动

我使用 ElicitSlot 设置 {obj} 插槽

第2步:

对话状态为 IN_PROGRESS。

我使用 ConfirmIntent 要求用户确认

第三步:

用户说是/否

ConfirmIntent 现在设置为 CONFIRMED/DENIED

但仍处于 IN_PROGRESS

dialogState 应该是 COMPLETED 因为我设置了我所有的 slot 和 intent 值对吗? 那么为什么不应该在这里工作呢?

提前致谢

回答1

您的dialogStateCOMPLETE的原因是因为您使用的是Dialog.ElicitSlot指令。 COMPLETED状态仅在您使用Dialog.Delegate指令时才有可能。

在此处使用Dialog.Delegate指令控制对话框的更多信息

回答2

DialogState 只有以下状态:“STARTED”、“IN_PROGRESS”、“COMPLETED”。

未完成的原因可能是因为并非所有步骤都已完成,或者 IntentRequest 没有所有必需的槽值。

回答3

对我来说,我必须在 Alexa Developer Console 的接口中启用自动委派选项。

让 Alexa 根据您的对话模型自动确定并完成对话的每个步骤。 对话完成后,您的技能会收到一个 IntentRequest。 您可以在意图级别覆盖此设置。 了解有关自动委派的更多信息。

完成所有步骤后,技能会收到最终的IntentRequest ,其中dialogState设置为COMPLETED

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • Alexa Dialog Model Step and dialogState is never in COMPLETED
    I'm implementing an Alexa Dialog Model with an PHP Endpoint. I used the Alexa doc (https://developer.amazon.com/fr/docs/custom-skills/dialog-interface-reference.html) Here is my example: My skill: RequestIntent Utterance : add an {obj} in the bedroom Slots : {obj} / Slot Filling Phrase: Me : Alexa, Add an object in the bedroom Alexa : What object do you want to add in bedroom ? Me : I would like to add a cars in the bedroom Alexa : You want to add a car in the bedroom ? Me : Yes STEP1: DialogState is STARTED I use ElicitSlot to set the {obj} slot STEP2: dialogState is IN_PROGRESS. I use
  • 如何在 Alexa 的 java SDK 中使用 Dialog Directives(How to use Dialog Directives with Alexa's java SDK)
    问题 我正在尝试使用 java 技能工具包创建我自己的 Alexa 技能,并且我想使用对话框界面。 我已经使用 beta 中的技能构建器创建了我的对话模型,但现在我不明白我需要通过我的网络服务返回什么才能委托我的对话。 我应该使用哪个类向 Alexa 发送命令来处理对话框中的下一个回合? 此外,我在 IntentRequest 类中没有 dialogState 属性...... 回答1 首先, dialogState属性在IntentRequest 。 我使用以下依赖项 (maven) 的 1.3.1 版。 要获取该值,请使用yourIntentRequestObject.getDialogState() 。 <dependency> <groupId>com.amazon.alexa</groupId> <artifactId>alexa-skills-kit</artifactId> <version>1.3.1</version> </dependency> 下面您将看到onIntent方法中Speechlet一些示例用法: if ("DoSomethingSpecialIntent".equals(intentName)) { // If the IntentRequest dialog state is STARTED // This is where you can
  • How to return Dialog.Delegate directive to Alexa Skill model?
    I want to create a simple multi-turn dialog with the Alexa Skill model. My intent consists of 3 slots, each of which are required to fulfill the intent. I prompt every slot and defined all of the needed utterances. Now I want to handle the request with a Lambda function. This is my function for this specific Intent: function getData(intentRequest, session, callback) { if (intentRequest.dialogState != "COMPLETED"){ // return a Dialog.Delegate directive with no updatedIntent property. } else { // do my thing } } So how would I go on to build my response with the Dialog.Delegate directive, as
  • Alexa Recursive Intent Delegation when using Confirmations
    I am writing an Alexa dialog with intent confirmation. When confirmation is denied I want to restart the same dialog again by delegating to this very dialog. I am proceeding like described in this stack overflow question. As described in the solution to this question I do the delegation when the dialogState is still IN_PROGRESS. In my case Alexa always responds with the not very meaningful message There was a problem with the requested skill's response. No error message in the application log. My skill model and the lambda code are as follows: { "interactionModel": { "languageModel": {
  • 使用确认时的 Alexa 递归意图委托(Alexa Recursive Intent Delegation when using Confirmations)
    问题 我正在编写带有意图确认的 Alexa 对话框。 当确认被拒绝时,我想通过委托给这个对话框来重新启动同一个对话框。 我正在按照此堆栈溢出问题中的描述进行操作。 如该问题的解决方案中所述,当dialogState仍为IN_PROGRESS时,我会进行委托。 在我的情况下,Alexa 总是用不太有意义的消息响应请求的技能响应有问题。 应用程序日志中没有错误消息。 我的技能模型和lambda代码如下: { "interactionModel": { "languageModel": { "invocationName": "hello", "intents": [ { "name": "UserIntent", "slots": [ { "name": "UserName", "type": "AMAZON.FirstName", "samples": [ "My name is {UserName}", "I am {UserName}", "{UserName}" ] } ], "samples": [ "My name is {UserName}", "I am {UserName}" ] } ], "types": [] }, "dialog": { "delegationStrategy": "SKILL_RESPONSE", "intents": [ { "name":
  • 使用 node.js 和 aws lambda 将 Alexa 技能连接到 mysql 数据库(Connecting Alexa skill to mysql database using node.js and aws lambda)
    问题 我正在尝试使用 AWS Lambda 中的 node.js 将我的 Alexa 技能连接到 Amazon RDS mySQL 数据库。 我在将它上传到 lambda 之前测试了连接并且它可以工作,但是当我上传它时,我收到“完成请求之前退出进程”或“技能响应有问题”错误。 'use strict'; const Alexa = require('alexa-sdk'); const APP_ID = 'amzn1.ask.skill.11069fc0-53bc-4cd0-8961-dd41e2d812f8'; var testSQL = 'SELECT weight, height from users where pin=1100'; //========================================================================================================================================= //Database connection settings //======================================================================================================
  • How to use Dialog Directives with Alexa's java SDK
    I'm trying to create my own Alexa's skill with the java skill kit, and I would like to use the Dialog Interface. I have created my Dialog model with the skill builder in beta, but now I don't understand what I need to return via my webservice in order to delegate my dialog. Which class should I use to send Alexa a command to handle the next turn in the dialog ? Moreover, I don't have the dialogState property in the IntentRequest class...
  • Connecting Alexa skill to mysql database using node.js and aws lambda
    I am trying to connect my Alexa skill to an Amazon RDS mySQL database using node.js in AWS Lambda. I tested the connection before uploading it to lambda and it worked but when I upload it I get a 'process exited before completing request' or a 'There was a problem with the skills response' error. 'use strict'; const Alexa = require('alexa-sdk'); const APP_ID = 'amzn1.ask.skill.11069fc0-53bc-4cd0-8961-dd41e2d812f8'; var testSQL = 'SELECT weight, height from users where pin=1100'; //==================================================================================================================
  • Intent ConfirmationStatus cannot be changed with Dialog.Delegate directive
    I have a dialog where I delegate Alexa to collect two slots and ask the confirmation prompt. If the user says "no" to the confirmation prompt, I want to restart the dialog by deleting the slot values and setting the intent confirmationStatus to "NONE". While Alexa starts to elicit the first slot, the confirmation status remains as "DENIED" which leads to a loop. I used the method described here to reset the status. This is the updated intent sent back from my skill { "name": "StartSingleGameIntent", "confirmationStatus": "NONE", "slots": { "player_one": { "name": "player_one",
  • 无法使用 Dialog.Delegate 指令更改 Intent ConfirmationStatus(Intent ConfirmationStatus cannot be changed with Dialog.Delegate directive)
    问题 我有一个对话框,我委托 Alexa 收集两个插槽并询问确认提示。 如果用户对确认提示说“否”,我想通过删除槽值并将意图确认状态设置为“无”来重新启动对话框。 当 Alexa 开始引出第一个槽时,确认状态保持为“DENIED” ,从而导致循环。 我使用这里描述的方法来重置状态。 这是从我的技能发回的更新意图 { "name": "StartSingleGameIntent", "confirmationStatus": "NONE", "slots": { "player_one": { "name": "player_one", "confirmationStatus": "NONE", "source": "USER" }, "player_two": { "name": "player_two", "confirmationStatus": "NONE", "source": "USER" } } } 但是下一个请求仍然具有“DENIED”状态: { "name": "StartSingleGameIntent", "confirmationStatus": "DENIED", "slots": { "player_one": { "name": "player_one", "value": "ben", "confirmationStatus": "NONE",
  • How to make an asynchronous api call for Alexa Skill application with a Lambda function?
    I want to call an api from a Lambda function. My handler is triggered by an intent which includes two required slots. Therefore I don't know in advance whether I will be returning a Dialog.Delegate directive or my response from the api request. How do I promise these return values by the time the intent handler is called? This is my handler: const FlightDelayIntentHandler = { canHandle(handlerInput) { return handlerInput.requestEnvelope.request.type === 'IntentRequest' && handlerInput.requestEnvelope.request.intent.name === 'MyIntent'; }, handle(handlerInput) { const request = handlerInput
  • 如何获取和使用确认“是”或“否”来进行 Alexa 技能意图响应(How to get and use confirmation 'yes' or 'no' for Alexa skill intent response)
    问题 我正在开发一项 Alexa 技能,在启动时它会询问Do you want to perform something ? 根据用户的回答'yes'或'no'我想启动另一个意图。 var handlers = { 'LaunchRequest': function () { let prompt = this.t("ASK_FOR_SOMETHING"); let reprompt = this.t("LAUNCH_REPROMPT"); this.response.speak(this.t("WELCOME_MSG") + ' ' + prompt).listen(reprompt); this.emit(':responseReady'); }, "SomethingIntent": function () { //Launch this intent if the user's response is 'yes' } }; 我确实看过dialog model ,它似乎可以达到目的。 但我不确定如何实现它。 回答1 从技能中执行您正在寻找的操作的最简单方法是从您的技能中处理AMAZON.YesIntent和AMAZON.NoIntent (确保也将它们添加到交互模型中): var handlers = { 'LaunchRequest': function () { let
  • 从 LaunchRequest 中调用另一个 Alexa 意图(Calling Another Alexa intent from within LaunchRequest)
    问题 我正在研究 Alexa 技能,当他通过 LaunchRequest 打开技能时,我希望将用户重定向到一个意图。 用户说Open xyz skill LaunchRequest 接收此信息并将请求转发到另一个意图。 this.emit('AnotherIntent') AnotherIntent有一个 SLOT,它的功能是必需的。 我已根据需要设置了 SLOT,并且AnotherIntent在AnotherIntent调用时确实可以正常工作。 但是,当我启动该技能并尝试从其中调用AnotherIntent (如上面第 2 步所述)时,Alexa 技能无法启动。 需要注意的另一件事是,当我在此场景的技能构建器中测试相同的 Alexa 技能时,输出 json 正确地向我显示了被引出的 SLOT。 不确定当我尝试从 Echo 设备运行它时发生了什么。 我正在使用 NodeJS 和 Lambda 来部署我的 Alexa 处理程序。 任何帮助,将不胜感激。 基于评论的进一步参考 - 处理程序 - var handlers = { 'LaunchRequest': function () { console.log("LaunchRequest::" + JSON.stringify(this.event.request)); this.emit('fooIntent'); },
  • How to get and use confirmation 'yes' or 'no' for Alexa skill intent response
    I am developing a Alexa skill in which on launch it will ask Do you want to perform something ? Depending upon user's reply 'yes' or 'no' I want to launch another intent. var handlers = { 'LaunchRequest': function () { let prompt = this.t("ASK_FOR_SOMETHING"); let reprompt = this.t("LAUNCH_REPROMPT"); this.response.speak(this.t("WELCOME_MSG") + ' ' + prompt).listen(reprompt); this.emit(':responseReady'); }, "SomethingIntent": function () { //Launch this intent if the user's response is 'yes' } }; I did have a look at dialog model and it seems that it will serve the purpose. But I am not sure
  • 如何创建从 HTTP/HTTPS API 获取数据的 Alexa 技能(在 AWS Lambda 上为 Node.js 使用“Alexa Skills Kit”)(How do I create an Alexa Skill that gets data from an HTTP/HTTPS API (using “Alexa Skills Kit” for Node.js on AWS Lambda))
    问题 我想为 Amazon Alexa 创建一项技能——当由语音命令触发时——通过 HTTPS 请求从 API 获取一些信息,并将结果用作对 Alexa 用户的口头回答。 由于 node.js 的事件驱动概念和适用于 Node.js 的 Alexa Skills Kit 的内部结构,这里存在一些挑战(特别是对于 node.js 新手)。 从用户那里获取参数也不是那么容易。 有人可以提供一些示例代码吗? 回答1 预赛 要开始使用,您需要一个 Amazon 帐户,并且必须为该帐户启用 AWS。 然后在亚马逊网站上有一个很好的分步指南:https://developer.amazon.com/edw/home.html#/skills 它会逐步引导您完成创建“技能”的过程。 技能是 Alexa 用自然语言回答问题的能力。 在此过程中,您还将创建一个 Lambda 函数(选择创建一个演示脚本应用程序,您将自动获得所有必需的库) 然后您可以在 AWS 控制台的 WebUI 中编辑代码)。 “技能”会在您所有的个人 Alexa 设备上自动启用,例如我在家中的 Amazon Echo dot。 请记住,您可以在 AWS 控制台的 AWS Cloudwatch 部分查看控制台输出。 我必须理解的两件事(其他人也可能会遇到) 当我创建我的第一个 Alexa Skill 时,我是新的 node.js
  • 在 botframework Python 中获取活动对话框 ID - 具有多个对话框和 QnA Maker 的调度模型(Get the active dialog id in botframework Python - Dispatch model with multiple Dialog and QnA Maker)
    问题 我的机器人处理传入的用户消息并根据意图采取行动。 对于不需要用户和机器人之间多次传递的简单一次性答案,它运行良好。 现在当我想实现一个对话框时,它变得越来越困难。 一旦用户发送消息并且 Dialog 被触发,机器人就会要求用户输入。 用户提供输入后,LUIS 将再次处理此输入以理解意图。 但是,我不希望这种情况发生,因为这会放弃正在进行的对话。 我想了解是否有某种方法可以检测对话框是否正在进行中以及它是什么对话框。 如果我知道这一点,我可以跳过 LUIS 意图检查部分并将逻辑定向到 Dialog。 我已经使用多转弯提示作为这个基础。 以下是我的期望。 from botbuilder.core import ActivityHandler, TurnContext, MessageFactory, IntentScore, ConversationState, UserState from botbuilder.schema import ChannelAccount,Attachment from botbuilder.ai.luis import LuisApplication,LuisPredictionOptions,LuisRecognizer from botbuilder.ai.qna import QnAMakerEndpoint,QnAMakerOptions
  • Get the active dialog id in botframework Python - Dispatch model with multiple Dialog and QnA Maker
    My bot processes incoming user messages and takes action based on the intent. For simple, one shot answers that do not require multiple passes between users and the bot, it works well. Now when I want to implement a dialog, it's getting tough. Once the user sends the message and the Dialog gets triggered, the bot asks the user for input. Once the user provides the input, this input is being again processed by LUIS to understand the intent. However, I do not want this to happen as this abandons the ongoing Dialog. I want to understand if there some way I can detect if a Dialog is under progress
  • CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
    I posted a question yesterday and today I have got a problem with the same project different error: my credentials and config files look like this: [ask-cli-Falkowsky] aws_access_key_id =XXXXXXXXXXXX aws_secret_access_key =XXXXXXXXXXXX [default] aws_access_key_id = XXXXXXXXXXXXX aws_secret_access_key = XXXXXXXXXXXXX [default] output = json region = eu-central-1 [profile ask-cli-Falkowsky] output = json region = eu-central-1 The Error I receive is also the Headline: CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1 The AWS Lambda function is
  • 访问模型/数据库而不将 UserState 注入每个对话框(Accessing model/database without injecting the UserState to every dialog)
    问题 我正在从旧的 bo​​tframework v4 迁移到最新版本。 我有大约 50 个对话框类,将用户状态依赖注入到所有这些类上需要做很多工作。 在我可以通过以下代码访问模型之前: var userstate = await (stepContext.Context.TurnState["BasicAccessors"] as BasicAccessors).BasicUserStateAccessor.GetAsync(stepContext.Context); 并且不需要在每个对话框中注入 userState。 我尝试这样做,但遇到了 500 错误和其他错误。 如何将此方法复制到最新版本? 这是旧版本的代码。 BasicAccessors 类: public class BasicAccessors { public BasicAccessors(ConversationState conversationState, UserState userState) { ConversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState)); UserState = userState ?? throw new ArgumentException
  • using slots in skill intent to search dynamodb
    I'm new to alexa, nodejs and coding in general but i am currently trying to create a skill to find machine states from my dynamodb table using date and time. I currently have set up my skill to get alexa and lambda to understand my slot values but im not sure how i can use these values for a dynamodb query and have alexa call out the state for that corresponding time My table is setup with a primary and sort key which are date and time and i have a third column for machine state. I'm not sure if i should set up a custom slot for machine state as it would be easy to do since there are only 4