【问题标题】:Allow users to issue multiple commands to Alexa after using the launch phrase once允许用户在使用一次启动短语后向 Alexa 发出多个命令
【发布时间】:2018-07-30 15:48:41
【问题描述】:

如果每个意图都需要技能的调用名称,那么启动短语的目的是什么?

例如,这是有道理的:

"Alexa, open adventure game"  (launch phrase)
"move forward"                (intent)
"pick up item"                (intent)
"close adventure game"        (exit)

但据我所知,您必须这样做:

"Alexa, open adventure game"                (launch phrase)
"Alexa, ask adventure game to move forward" (intent)
"Alexa, ask adventure game to pick up item" (intent)
"Alexa, close adventure game"               (exit)

我真正的问题是“Alexa,问 {invocation_name} 到 {utterance}”的对话结构过于臃肿,从文档中很难看出如何解决这个问题。我希望我在启动短语的工作方式中遗漏了一些东西,这将使我的用户能够更自然地发出命令。

【问题讨论】:

    标签: alexa alexa-skills-kit


    【解决方案1】:

    如果您保持会话处于活动状态,则不必每次都使用调用名称。为此,您必须在响应 JSON 中包含 shouldEndSession 参数并将其设置为 false。当shouldEndSession 设置为true 或不存在时,Alexa 结束会话。

    Ex: for LaunchRequest 给出这样的回复。

    {
       'version':'1.0',
       'sessionAttributes':{
    
       },
       'response':{
          'outputSpeech':{
             'type':'PlainText',
             'text':'Launch phrase here'
          },          
          'reprompt':{
             'outputSpeech':{
                'type':'PlainText',
                'text':'re-prompt phrase here'
             }
          },
          'shouldEndSession':false
       }
    }
    

    注意shouldEndSession 是假的,这会使会话保持活动状态。并且用户可以直接说“向前移动”,而无需使用调用名称。

    当你真正想结束会话时,将shouldEndSession 设置为true

    :对于Amazon.StopIntent

    注意:即使您将 shouldEndSession 设置为 false ,默认的 Alexa 会话超时时间为 8 秒且不可配置。

    【讨论】:

      【解决方案2】:

      每个意图并不需要调用名称。

      以下情况很有可能:

      "Alexa, open adventure game"  (launch phrase)
      "move forward"                (intent)
      "pick up item"                (intent)
      "close adventure game"        (exit)
      

      您是否遇到过技能问题,或者只是您在阅读技能商店中的示例话语时注意到的问题?

      如果您在技能方面遇到问题,可能是会话超时,并且开发人员没有提供任何重新提示。在这种情况下,唤醒词+调用(Alexa,开放冒险游戏)不得不说再次启动技能。

      如果您只是通过您给出的示例(第二组),您必须了解每个话语不仅仅是一个意图话语,它是一个启动+意图话语。这意味着,这些示例中的每一个都旨在启动一项技能一个意图。所以基本上你的例子是

      "Alexa, open adventure game"                (launch phrase)
      "Alexa, ask adventure game to move forward" (launch phrase + intent)
      "Alexa, ask adventure game to pick up item" (launch phrase + intent)
      "Alexa, close adventure game"               (launch phrase + exit)
      

      这些话语并不是要一个接一个地说,它们都是独立的命令。

      启动技能后,只要会话处于活动状态,您就无需一次又一次地重复调用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-11-21
        • 1970-01-01
        • 1970-01-01
        • 2018-09-30
        • 2017-02-14
        • 1970-01-01
        • 2019-05-14
        • 2015-07-08
        相关资源
        最近更新 更多