操作现在没有响应错误

Action isn't responding right now error

我在 Google webhook (Actions SDK) 上部署了一个 Actions,我正在使用模拟器与之交互。但是,我收到错误消息:"Action: action name isn’t responding right now. Try again soon." 如何解决此问题?

这些是我产生此错误所采取的步骤。

部署网络钩子。我确认它可以公开访问,使用 HTTPS,并且能够处理 example request。它还设置 Google-Assistant-API-Version 响应 header.

将 action.json 指向可公开访问的 webhook,然后预览操作:

gactions --verbose preview --action_package=action.json -invocation_name="action name"

启动模拟器:

gactions --verbose simulate

模拟交互:

Finished checking for updates -- no updates available
Reading credentials from: creds.data
User TTS (CTRL-C to stop): 
talk to action name
Sending POST request to: https://assistant.googleapis.com/v1/assistant:converse
Request body:
{
  "query": "talk to action name"
}

Response body:
{
  "response": "action name isn’t responding right now. Try again soon.\n",
  "audioResponse": "...",
  "debugInfo": {}
}

虽然消息表明操作没有响应,但我可以从我的 webhook 日志中看到它正在成功响应,HTTP 状态代码为 200,并且它正在生成看起来非常相似的 JSON 响应到 example responses.

如何调试这个问题?

附带说明一下,我收到的实际请求似乎与文档不完全匹配。这是实际请求的示例:

{"user":{"user_id":"..."},"conversation":{"conversation_id":"...","type":1},"inputs":[{"intent":"assistant.intent.action.MAIN","raw_inputs":[{"input_type":2,"query":"talk to action name"}],"arguments":[]}]}

请注意 conversation.type 是一个整数,而不是一个字符串。此外,没有提供 conversation_token 因此,我生成的响应中的 conversation_tokennull.

您可以使用 Web Simulator. Follow the same steps above, but after previewing the action using the gactions command, navigate to the Web Simulator 获取更多调试信息并输入您在命令行模拟器中输入的相同文本。这将填写 JSON 响应中的 debugInfo 字段。