Alexa-全包

Jul*_*Coo 5 alexa alexa-skills-kit api-ai dialogflow-es

我有一个聊天机器人,它已插入后端和DialogFlow / ApiAI。我正在尝试建立Alexa的技能,以便我可以掌握所讲技能的所有内容,然后将其转发给后端,以便可以使用现有的基础架构和convo设计。

我一直在努力与Alexa建立一种意图,以抓住一切并转发它。据我了解,您应该使用AMAZON.SearchQuery,但在尝试设置意图时出现以下错误:

意图“ CATCH_ALL”的构建失败样本话语“ CATCH_ALL {any}”必须包含一个载体词组。短语类型的样本意图发声不能仅包含空位。错误代码:MissingCarrierPhraseWithPhraseSlot-

意向配置

有人知道怎么做吗?我也尝试使用AMAZON.Literal,但它似乎已被弃用,使用时我无法建立该技能。我有点卡住了。如果有人有解决方案,那就太好了...

谢谢。

小智 6

您可以将AMAZON.SearchQuery替换为AMAZON.Person。通常,AMAZON.SearchQuery 需要短语和槽位。使用AMAZON.Person则不需要短语和槽位。它会接受您传递给 Intent 的任何值。

               {
                "name": "CATCH_ALL",
                "slots": [
                    {
                        "name": "any",
                        "type": "AMAZON.Person"
                    }
                ],
                "samples": [
                    "{any}"                      
                ]
            }
Run Code Online (Sandbox Code Playgroud)

  • “`AMAZON.SearchQuery` 需要一个短语和槽位” - 这是关键! (3认同)

Jul*_*Coo 5

我最终通过执行以下操作来做到这一点:

    {
        "interactionModel": {
            "languageModel": {
                "invocationName": "test",
               "intents": [
                {
                "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "CATCHALL",
                    "slots": [
                        {
                            "name": "any",
                            "type": "AMAZON.LITERAL"
                        }
                    ],
                        "samples": [
                            "{hey|any}",
                            "{hey hey|any}",
                           "{hey hey hey|any}",
                            "{hey hey hey hey|any}",
                            "{hey hey hey hey hey|any}"
                        ]
                    }
                ],
                "types": []
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

意图CATCHALL的样本指示您要捕获的单词数。所以轻装上阵,我会抓住一个和这五个字之间的任何句子。

不过,我不确定提交应用程序时是否会出现问题。

请注意,除英语(美国)以外,其他语言均不支持AMAZON.LITERAL,因此这对我来说不是解决方案,因为它是法语和英语聊天机器人。所以我又回来了...

编辑:这是没有字面意义的解决方案:

{ "interactionModel": { "languageModel": { "invocationName": "mon invocation", "intents": [ { "name": "AMAZON.CancelIntent", "samples": [] }, { "name": "AMAZON.HelpIntent", "samples": [ "que puis-je faire" ] }, { "name": "AMAZON.StopIntent", "samples": [ "je veux quitter" ] }, { "name": "CATCH_ALL", "slots": [ { "name": "any", "type": "ANYTHING" } ], "samples": [ "{any}" ] } ], "types": [ { "name": "ANYTHING", "values": [ { "name": { "value": "hey" } }, { "name": { "value": "hey hey" } }, { "name": { "value": "hey hey hey" } }, { "name": { "value": "hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey hey hey" } } ] } ] } } }


Pri*_*ner 3

不幸的是,目前没有解决方案。Alexa 不支持按照您想要的方式获取所有文本的方法。