这是我正在使用的交互模型:
{
"interactionModel": {
"languageModel": {
"invocationName": "greeter",
"intents": [
{
"name": "HelloWorldIntent",
"slots": [
{
"name": "phrase",
"type": "phrase"
}
],
"samples": [
"{phrase}"
]
}
],
"types": [
{
"name": "phrase",
"values": [
{
"name": {
"value": "HelloWorldIntent asdf {phrase}"
}
}
]
}
]
}
}
}
注意短语槽位类型的值。当我这样设置时,无论我对alexa说什么,整个原始查询都被填充在请求对象的短语槽的value字段中。
例如:
“启动问候” ==> LaunchIntent(显而易见)
“无论我说什么都会触发Hello World意图” ==>
"intent": {
"name": "HelloWorldIntent",
"confirmationStatus": "NONE",
"slots": {
"phrase": {
"name": "phrase",
"value": "no matter what I say it triggers hello world intent",
"resolutions": {
"resolutionsPerAuthority": [
{
"authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.6c1d0991-f895-45fa-ba37-6880d3cc95f1.phrase",
"status": {
"code": "ER_SUCCESS_NO_MATCH"
}
}
]
},
"confirmationStatus": "NONE"
}
}
}
我无法弄清楚这种交互模型是如何在短语槽的“值”字段中给我原始查询的。