代码之家  ›  专栏  ›  技术社区  ›  AkshayM

有人能为Alexa Skill的交互模型解释这种行为吗?

  •  0
  • AkshayM  · 技术社区  · 6 年前

    {
        "interactionModel": {
            "languageModel": {
                "invocationName": "greeter",
                "intents": [
                    {
                        "name": "HelloWorldIntent",
                        "slots": [
                            {
                                "name": "phrase",
                                "type": "phrase"
                            }
                        ],
                        "samples": [
                            "{phrase}"
                        ]
                    }
                ],
                "types": [
                    {
                        "name": "phrase",
                        "values": [
                            {
                                "name": {
                                    "value": "HelloWorldIntent asdf {phrase}"
                                }
                            }
                        ]
                    }
                ]
            }
        }
    }
    

    注意短语slot type的值。当我这样设置它时,无论我对alexa说什么,整个原始查询都被填充到请求对象的短语槽的值字段中。

    “Launch greeter”==>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"
                }
            }
        }
    

    我无法理解这个交互模型是如何在短语槽的“值”字段中为我提供原始查询的。

    0 回复  |  直到 6 年前