【问题标题】:Why does Alexa SDK throw an error when migrating from Dialogflow为什么从 Dialogflow 迁移时 Alexa SDK 会抛出错误
【发布时间】:2018-10-20 20:07:44
【问题描述】:

我正在尝试迁移我的操作表单 Dialogflow,最重要的是意图架构。但是上传.json文件后,抛出错误Intent name must not be empty. Error code: MissingIntentName。这是 Intent schema.json

 {
"intents": [
{
  "intent": "SelectedSubjectsYes"
},
{
  "intent": "UserIsOk",
  "slots": [
    {
      "name": "okslot",
      "type": "OK"
    }
  ]
},
{
  "intent": "SelectedSubjectsNo"
},
{
  "intent": "UserIsNotOk",
  "slots": [
    {
      "name": "not_okslot",
      "type": "NOT_OK"
    }
  ]
},
{
  "intent": "DefaultWelcomeIntent"
},
{
  "intent": "HowAreYou?"
},
{
  "intent": "SelectedSubjects",
  "slots": [
    {
      "name": "subjectslot",
      "type": "SUBJECT"
    }
  ]
}
]
}

我从来没有编辑过它,为什么会出现错误?提前致谢。

【问题讨论】:

    标签: dialogflow-es alexa alexa-skills-kit alexa-skill


    【解决方案1】:

    交互模型的 JSON 结构明显不同。这就是它现在的样子。

    {
        "interactionModel": {
            "languageModel": {
                "invocationName": "Your invocation name",
                "intents": [
                    {
                        "name": "SelectedSubjectsYes",
                        "slots": [],
                        "samples": [
                            "provide sample for SelectedSubjectsYes intent",
                            "sample for SelectedSubjectsYes intent"
                        ]
                    },
                    {
                        "name": "UserIsOk",
                        "slots": [
                            {
                                "name": "okslot",
                                "type": "OK"
                            }
                        ],
                        "samples": [
                            "provide other samples for UserIsOk",
                            "I'm {okslot}",
                            "{okslot}"
                        ]
                    },
                    {
                        "name": "SelectedSubjectsNo",
                        "slots": [],
                        "samples": [
                            "provide sample for SelectedSubjectsNo intent",
                            "sample for SelectedSubjectsNo intent"
                        ]
                    },
                    {
                        "name": "UserIsNotOk",
                        "slots": [
                            {
                                "name": "not_okslot",
                                "type": "NOT_OK"
                            }
                        ],
                        "samples": [
                            "provide other samples for UserIsNotOk",
                            "i'm {not_okslot}",
                            "{not_okslot}"
                        ]
                    },
                    {
                        "name": "HowAreYou?",
                        "slots": [],
                        "samples": [
                            "provide sample for HowAreYou intent",
                            "sample for HowAreYou intent"
                        ]
                    },
                    {
                        "name": "SelectedSubjects",
                        "slots": [
                            {
                                "name": "subjectslot",
                                "type": "SUBJECT"
                            }
                        ],
                        "samples": [
                            "provide other samples for SelectedSubjects",
                            "i choose {subjectslot}"
                        ]
                    }
                ],
                "types": [
                    {
                        "name": "OK",
                        "values": [
                            {
                                "name": {
                                    "value": "ok"
                                }
                            },
                            {
                                "name": {
                                    "value": "yes"
                                }
                            }
                        ]
                    },
                    {
                        "name": "NOT_OK",
                        "values": [
                            {
                                "name": {
                                    "value": "not ok"
                                }
                            },
                            {
                                "name": {
                                    "value": "nope"
                                }
                            }
                        ]
                    },
                    {
                        "name": "SUBJECT",
                        "values": [
                            {
                                "name": {
                                    "value": "Physics"
                                }
                            },
                            {
                                "name": {
                                    "value": "Biology"
                                }
                            }
                        ]
                    }
                ]
            }
        }
    }
    

    不是从对话流转换,而是在 Alexa 技能生成器中设计一个非常容易。此外,对于 "yes""no" 话语,建议使用预定义的 AMAZON.YesIntentAMAZON.NoIntent

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-26
      • 2020-08-02
      • 1970-01-01
      • 2018-12-10
      • 2019-06-13
      • 2021-06-17
      • 2015-02-25
      相关资源
      最近更新 更多