将身份验证与 Dialogflow / Google 操作链接时出现验证错误
Validation errors when linking authentication with Dialogflow / Google Action
我们正在尝试将对话中的 DialogFlow / Google 操作 link 发送到外部 OAuth 帐户。按照这些示例,我们不断收到我们不知道如何解决的请求验证错误。据我所知,我们正在按照这本书做所有事情。
我们的问题:
- 为什么 DialogFlow 不启动身份验证过程?
- 记录webhook response for requesting the sign-in helper not have the same schema as a standard DialogFlow webhook response。登录助手响应是否应该用于其他用途?...
我们尝试过的事情:
- 我们已经根据 the documentation
配置了我们的应用程序和 OAuth 凭据
- 我们已验证我们可以通过 OAuth 2.0 游乐场从服务中获取 OAuth 令牌
- 我们已在 Action 上启用交易。
我们的意图代码如下:
const { DialogflowApp } = require('actions-on-google');
const { ActionsSdkApp } = require('actions-on-google');
function processV2Request (request, response) {
...
let app = new DialogflowApp({request: request, response: response});
let sdkapp = new ActionsSdkApp({request: request, response: response});
const actionHandlers = {
'pto': () => {
app.askForSignIn();
}
...
}
...
}
当我们执行这个意图时,我们收到以下关于 speech
字段的调试错误消息。
"agentToAssistantJson": {
"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
"id": "751e4716-a94d-4d11-908d-3ee193092d9c",
"timestamp": "2017-12-05T19:52:01.962Z",
"lang": "en-us",
"result": {},
"status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: speech in message google.cloud.dialogflow.v2beta1.WebhookResponse."
}
}
}
如果我们尝试使用 ActionsSdkApp,sdkapp.askForSignIn()
,我们会收到有关 conversation_token
字段的错误消息。
"agentToAssistantJson": {
"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
"id": "7de79093-6db8-44ee-8717-16b0f317174c",
"timestamp": "2017-12-05T19:54:29.709Z",
"lang": "en-us",
"result": {},
"status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: conversation_token in message google.cloud.dialogflow.v2beta1.WebhookResponse."
},
}
}
如果对您有帮助,请阅读我们的 package.json。这是 DialogFlow 最近的默认设置,具有 actions-on-google
的升级版本。
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "~6.0"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^1.6.x",
"firebase-admin": "^4.2.1",
"firebase-functions": "^0.5.7",
"apiai": "^4.0.3"
}
}
我们确定除了为应用程序启用交易之外,您还必须将 Development Sandbox
切换为 Active
:
我们正在尝试将对话中的 DialogFlow / Google 操作 link 发送到外部 OAuth 帐户。按照这些示例,我们不断收到我们不知道如何解决的请求验证错误。据我所知,我们正在按照这本书做所有事情。
我们的问题:
- 为什么 DialogFlow 不启动身份验证过程?
- 记录webhook response for requesting the sign-in helper not have the same schema as a standard DialogFlow webhook response。登录助手响应是否应该用于其他用途?...
我们尝试过的事情:
- 我们已经根据 the documentation 配置了我们的应用程序和 OAuth 凭据
- 我们已验证我们可以通过 OAuth 2.0 游乐场从服务中获取 OAuth 令牌
- 我们已在 Action 上启用交易。
我们的意图代码如下:
const { DialogflowApp } = require('actions-on-google');
const { ActionsSdkApp } = require('actions-on-google');
function processV2Request (request, response) {
...
let app = new DialogflowApp({request: request, response: response});
let sdkapp = new ActionsSdkApp({request: request, response: response});
const actionHandlers = {
'pto': () => {
app.askForSignIn();
}
...
}
...
}
当我们执行这个意图时,我们收到以下关于 speech
字段的调试错误消息。
"agentToAssistantJson": {
"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
"id": "751e4716-a94d-4d11-908d-3ee193092d9c",
"timestamp": "2017-12-05T19:52:01.962Z",
"lang": "en-us",
"result": {},
"status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: speech in message google.cloud.dialogflow.v2beta1.WebhookResponse."
}
}
}
如果我们尝试使用 ActionsSdkApp,sdkapp.askForSignIn()
,我们会收到有关 conversation_token
字段的错误消息。
"agentToAssistantJson": {
"message": "Unexpected apiai response format: Empty speech response",
"apiResponse": {
"id": "7de79093-6db8-44ee-8717-16b0f317174c",
"timestamp": "2017-12-05T19:54:29.709Z",
"lang": "en-us",
"result": {},
"status": {
"code": 206,
"errorType": "partial_content",
"errorDetails": "Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: conversation_token in message google.cloud.dialogflow.v2beta1.WebhookResponse."
},
}
}
如果对您有帮助,请阅读我们的 package.json。这是 DialogFlow 最近的默认设置,具有 actions-on-google
的升级版本。
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "~6.0"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^1.6.x",
"firebase-admin": "^4.2.1",
"firebase-functions": "^0.5.7",
"apiai": "^4.0.3"
}
}
我们确定除了为应用程序启用交易之外,您还必须将 Development Sandbox
切换为 Active
: