我在Google webhook(Actions SDK)上部署了一個Actions,我正在使用模擬器與它進行交互。但是,我收到錯誤消息:「操作:操作名稱現在不響應,請儘快再試。」我如何解決這個問題?操作現在沒有響應錯誤
這些是我用來產生此錯誤的步驟。
部署webhook。我證實它是公開訪問的,使用HTTPS,並且能夠處理example request。它還設置了Google-Assistant-API-Version
響應標頭。
點action.json到可公開訪問的網絡掛接,然後預覽動作:
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_token
是null
。