错误代码:InvalidIntentSamplePhraseSlot- [英] Error code: InvalidIntentSamplePhraseSlot -
问题描述
使用新的技能控制台构建模型时,出现错误代码错误代码:InvalidIntentSamplePhraseSlot
。
完整的错误消息是
I got the error code Error code: InvalidIntentSamplePhraseSlot
when I built the model using the new skills console.
The full error message is
Sample utterance "AddBookmarkIntent i am at {pageno} of {mybook}" in intent "AddBookmarkIntent" cannot include both a phrase slot and another intent slot. Error code: InvalidIntentSamplePhraseSlot -
其中 {pageno}
是 AMAZON.NUMBER
和 {mybook}
是 AMAZON.SearchQuery
有什么错误,我该如何解决?
What is the error about and how can I solve it?
edit :添加意图的JSON
edit: add the JSON for the intent
{
"name": "AddBookmarkIntent",
"slots": [
{
"name": "mybook",
"type": "AMAZON.SearchQuery"
},
{
"name": "pageno",
"type": "AMAZON.NUMBER"
}
],
"samples": [
"i am at {pageno} of the book {mybook}",
"save page {pageno} to the book {mybook}",
"save page {pageno} to {mybook}",
"i am at {pageno} of {mybook}"
]
}
推荐答案
不允许具有 AMAZON类型的插槽。在与另一个广告位相同的 Utterance 中的SearchQuery
,在您的情况下为 AMAZON.NUMBER
。
It's not allowed to have a slot of the type AMAZON.SearchQuery
in the same Utterance with another slot, in your case AMAZON.NUMBER
.
根据需要标记其中一个插槽,然后分别询问。
Mark one of the slots as required and ask for them separately.
一个小例子:
创建放置在话语和空格中的Intent:
Create the Intent put in the utterances and slots:
"intents": [
{
"name": "AddBookmarkIntent",
"samples": [
"I am at {pageno}"
],
"slots": [
{
"name": "mybook",
"type": "AMAZON.SearchQuery",
"samples": [
"For {mybook}"
]
},
{
"name": "pageno",
"type": "AMAZON.NUMBER"
}
]
}
根据需要标记特定的插槽,以便Alexa会自动要求它:
Mark the specific slot as required so Alexa will automatically ask for it:
"dialog": {
"intents": [
{
"name": "AddBookmarkIntent",
"confirmationRequired": false,
"prompts": {},
"slots": [
{
"name": "mybook",
"type": "AMAZON.SearchQuery",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicitation": "Elicit.Intent-AddBookmarkIntent.IntentSlot-mybook"
}
}
]
}
]
}
并创建提示询问插槽:
"prompts": [
{
"id": "Elicit.Intent-AddBookmarkIntent.IntentSlot-mybook",
"variations": [
{
"type": "PlainText",
"value": "For which book you like to save the page?"
}
]
}
]
此使用技能构建器BETA而不是其编辑器可能会容易得多,因为它将在后台自动创建JSON。
This is probably much easier with the skill builder BETA and not its editor because it will automatically create the JSON in the background.
这篇关于错误代码:InvalidIntentSamplePhraseSlot-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!