Google助手使用模拟器使用默认意图“与...交谈”

时间:2019-07-07 15:53:49

标签: google-assistant-sdk

我正在通过Google Actions控制台使用Google Assistant配置。

虽然我已经使用action.json上传了一个非常简单的gactions文件,但是当我说“嘿Google,与Rasp Pi通话”(而“ R​​asp Pi”是在“调用”标签中定义的显示名称)

我打开了模拟器,它已经向我推荐了“与Rasp Pi对话”

一旦我单击“与Rasp Pi交谈”,就会发生错误: “我们很抱歉,但是出了点问题。请重试。”

下面是我成功上传的action.json。

{
"manifest": {
    "displayName": "Example",
    "invocationName": "Example",
    "category": "PRODUCTIVITY"
},
"locale": "de",
"actions": [
    {
        "name": "MAIN",
        "description": "Default Welcome Intent",
        "fulfillment": {
            "staticFulfillment": {
                "templatedResponse": {
                    "items": [
                        {
                            "simpleResponse": {
                                "textToSpeech": "Was kann ich tun?"
                            }
                        }
                    ]
                }
            }
        },
        "intent": {
            "name": "actions.intent.MAIN"
        }
    },

有什么想法吗?

更新

使用gactions test --project <project-id> --action_package action.json后,我收到以下消息,我打算从另一个启用了google的设备进行测试。 但尚未在模拟器上

Pushing the app for the Assistant for testing...
Your app for the Assistant for project speech-cd6e3 is now ready for testing on Actions on Google enabled devices or the Actions Web Simulator at https://console.actions.google.com/project/<project-id>/simulator/

1 个答案:

答案 0 :(得分:0)

答案很简单。

正如我在自己的问题中已经提到的那样,进行gactions test --project <project-id> --action_package action.json使其可用于模拟器(和其他设备)似乎很重要

每当您收到以下消息时,也要注意的重要一点:

很抱歉,出了点问题。请重试。*

这可能是由于actions.json中的定义不正确,或者是当实现不包含响应时(例如simpleResponse-> textToSpeech)

所以,我这样做了

  1. gactions update [...]
  2. 后跟gactions test [...]
  3. 始终确保action.json语法正确(拼写错误)
  4. 确保至少有一个“ textToSpeech”作为填充信息被返回

最后但并非最不重要的一点是,在模拟器上要耐心接受新上传的定义