Почему Alexa SDK выдает ошибку при миграции из Dialogflow - PullRequest
0 голосов
/ 20 октября 2018

Я пытаюсь перенести свою форму действий в Dialogflow, и самое главное - это схема намерений.Но после загрузки файла .json выдается ошибка Intent name must not be empty. Error code: MissingIntentName.Вот намерение 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"
    }
  ]
}
]
}

Я никоим образом не редактировал его, так почему ошибка?Заранее спасибо.

1 Ответ

0 голосов
/ 21 октября 2018

Структура 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"
                            }
                        }
                    ]
                }
            ]
        }
    }
}

Вместо того, чтобы конвертировать из потока Dialog, его довольно легко спроектировать в построителе навыков Alexa.Кроме того, рекомендуется использовать предопределенные AMAZON.YesIntent и AMAZON.NoIntent для "да" или "нет" высказываний.

...