Alexa无法访问我的技能

时间:2016-08-01 17:26:14

标签: python amazon-web-services alexa-skills-kit

Amazon Developer Forums

上交叉发布

在开发我的一项技能时,我注意到在服务模拟器中,调用具有意图Welcome的技能 - 应该调度到我的get_welcome_response()函数 - 会失败,除非它认为这不是一个新的会议。当我在没有特定意图的情况下调用技能时再次使用实际的Echo设备进行测试时会反映这一点 - 这也应该默认为我的get_welcome_response()函数 - 我得到Alexa告诉我它在访问该特定内容时遇到问题技能。以下是此技能的get_welcome_response()功能:

def get_welcome_response():

session_attributes = {}
card_title = "Welcome"
speech_output = "Welcome to Bravo Lima." \
        "Please state username and password"
# If the user either does not reply to the welcome message or says something
# that is not understood, they will be prompted again with this text.
reprompt_text = "Unable to authenticate." \
        "Please repeat username and password"
should_end_session = False
return build_response(session_attributes, build_speechlet_response(
    card_title, speech_output, reprompt_text, should_end_session))

然而,由于整个技能本身非常复杂,我写了一个新的,很容易尝试,看看我是否可以简单地调用这个技能。该技能有一个功能,即get_welcome_response()

def get_welcome_response():

session_attributes = {}
card_title = "Welcome"
speech_output = "Hello. " \
                "Good morning, " \
                "is their coffee in that nebula?"
should_end_session = True
return build_response(session_attributes, build_speechlet_response(
    card_title, speech_output, None, should_end_session))

如果在没有意图的情况下调用此技能,它就会在这里。我还将其定义为在服务模拟器中进行测试的意图,无论是否认为是新会话,它都可以工作。 Alexa能够在使用Echo调用时识别此技能,并相应地做出响应。

AWS lambda服务器处理之前使用的更复杂的技能的方式,这个技术几乎没有任何不同。 get_welcome_response()函数之间唯一的两个区别是:

  1. 前者需要should_end_session = False,因为它需要将session_attributes变量传递给其他函数,以便技能中的各种其他意图正常工作。
  2. 后者没有责备文字
  3. 这两项技能都是使用亚马逊的MyColorIs模板创建的,因此代码开头的功能就像lambda_handleron_session_started,{{1}等功能在结构上是一样的。

    添加了一些信息以排除可能存在的问题(并表明这不是一个重复的问题):

    1. 我的Echo使用与我在AWS上的开发者帐户相同的帐户进行注册
    2. 我在每个技能的开发者控制台中输入了正确的ARN代码作为端点
    3. lambda服务器端的所有内容都正确执行
    4. 之前我已经问过与服务模拟器相关的similar question,并且知道它有/有一个严重的错误:我已经通过为他们的给定意图定义on_launch函数来解决这个问题。代码。
    5. 我在为技能定义调用名时遵循了这些指导原则:英语单词,没有专有名词,1-3个单词,2-50个字符等等。
    6. 我一直试图围绕这个问题绞尽脑汁 - 为什么Alexa可以注册我更简单的技能而不是我更复杂的技能,如果没有任何实质性区别于彼此的话 - 并且知道问题存在于交互模型的某个地方,但对我来说,它究竟在哪里并不明显。为了更好地衡量,这里是两种技能的交互模型:

      对于简单的测试技能

      意图架构:

      get_welcome_response()

      相关话语:

      {
        "intents": [
          {
            "intent": "Morning"
         }
        ]
      }
      

      更复杂的技能

      意图架构:

      Morning good morning
      

      相关话语:

         {
               "intents": [
                   {
                   "intent": "Welcome"
                   },
                 {
                   "intent": "Validate",
                   "slots": [
                     {
                       "name": "username",
                       "type": "LIST_OF_NAMES"
                     },
                     {
                       "name": "password",
                       "type": "AMAZON.NUMBER"
                     }
                   ]
                 },
                 { 
                   "intent": "Report"
                 }
               ]
            }
      

0 个答案:

没有答案
相关问题