动作更新:服务器没有 return HTTP 200

gactions update: Server did not return HTTP 200

我正在为 Google 上的操作创建演示。
当运行以下命令时:

./gactions --verbose test --action_package action.json --project chatbot-36b55

我收到以下错误:

Checking for updates...
Successfully fetched update metadata
Finished checking for updates -- no updates available
Pushing the app for the Assistant for testing...
POST /v2/users/me/previews/chatbot-36b55:updateFromAgentDraft?updateMask=previewActionPackage.actionPackage.actions%2Cpre
viewActionPackage.actionPackage.conversations%2CpreviewActionPackage.actionPackage.types%2CpreviewActionPackage.startTime
stamp%2CpreviewActionPackage.endTimestamp HTTP/1.1
Host: actions.googleapis.com
User-Agent: Gactions-CLI/2.0.7 (linux; amd64; stable/6f4c996f8ee63dc5760c7728f674abe37bfe5fc4)
Content-Length: 329
Content-Type: application/json
Accept-Encoding: gzip
{"name":"users/me/previews/chatbot-36b55","previewActionPackage":{"actionPackage":{"actions":[{"fulfillment":{"conversati
onName":"HelloWorld"},"intent":{"name":"actions.intent.MAIN"},"name":"MAIN"}],"conversations":{"HelloWorld":{"name":"Hell
oWorld","url":"http://35.189.xx.xx/"}}},"name":"users/me/previews/chatbot-36b55"}}
Reading credentials from: creds.data
ERROR: Failed to test the app for the Assistant
ERROR: Request contains an invalid argument.
Field Violations:
#  Field  Description
1         URL is invalid 'http://35.189.xx.xx/'
2017/07/20 14:42:50 Server did not return HTTP 200

我刚刚按照 the steps 创建了动作包。 这是我的 actions.json 文件:

{
  "actions": [
    {
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "HelloWorld"
        },
      "intent": {
        "name": "actions.intent.MAIN"
      }
    }
  ],
  "conversations": {
    "HelloWorld": {
      "name": "HelloWorld",
      "url": "http://35.189.xx.xx/"
    }
  }
}

我需要设置 https 来测试吗?如果这是问题,有人知道我该如何解决吗?

https://developers.google.com/actions/reference/rest/Shared.Types/ConversationFulfillment 处的文档说明 url 参数:

The HTTPS endpoint for the conversation (HTTP is not supported).

此外,URL 必须可以从 public Internet 访问(您没有显示完整的 IP 地址,这是有充分理由的,所以我无法判断这是真的还是不是)。

无论哪种方式,您都可以使用 ngrok to create an HTTPS endpoint and secure tunnel to your 35.189.x.x host. This will give you a public DNS entry and HTTPS endpoint. See also https://developers.google.com/actions/tools/ngrok 之类的东西来了解有关将 ngrok 与 Actions 结合使用的一些详细信息。