Actions on google 将身份验证与Dialogflow/Google操作链接时出现验证错误

Actions on google 将身份验证与Dialogflow/Google操作链接时出现验证错误,actions-on-google,dialogflow-es,Actions On Google,Dialogflow Es,我们正在尝试让DialogFlow/Google操作链接到对话中的外部OAuth帐户。在下面的例子中,我们不断地得到我们不知道如何解决的请求验证错误。据我所知,我们一切都是按部就班的 我们的问题: 为什么DialogFlow不启动身份验证过程 所记录的文档没有与标准相同的模式。登录助手响应是否应用于其他用途 我们尝试过的事情: 我们已根据配置了应用程序和OAuth凭据 我们已经验证了可以通过OAuth 2.0从服务获取OAuth令牌 我们已在操作上启用了事务 我们的意向代码如下: const

我们正在尝试让DialogFlow/Google操作链接到对话中的外部OAuth帐户。在下面的例子中,我们不断地得到我们不知道如何解决的请求验证错误。据我所知,我们一切都是按部就班的

我们的问题:

  • 为什么DialogFlow不启动身份验证过程
  • 所记录的文档没有与标准相同的模式。登录助手响应是否应用于其他用途
  • 我们尝试过的事情:

    • 我们已根据配置了应用程序和OAuth凭据
    • 我们已经验证了可以通过OAuth 2.0从服务获取OAuth令牌
    • 我们已在操作上启用了事务
    我们的意向代码如下:

    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();
        }
        ...
      }
      ...
    }
    
    当我们执行此意图时,我们会收到以下关于
    语音
    字段的调试错误消息

    "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."
        }
      }
    }
    
    "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."
        },
      }
    }
    
    相反,如果我们尝试使用ActionsSdkApp,
    sdkapp.askForSignIn()
    ,我们会收到一条关于
    对话\u令牌
    字段的错误消息

    "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."
        }
      }
    }
    
    "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最近的默认设置,在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"
      }
    }
    

    我们确定,除了为应用程序启用事务外,您还必须将
    开发沙盒
    切换为
    活动


    您是否有意使用Dialogflow v2 API?(这与Google v2 API上的操作不同。)我们已经在v1和v2 API上进行了尝试,但都遇到了问题。v1是推荐的版本吗?Dialogflow v2仍处于测试阶段,尚未推荐用于生产。主要是想缩小范围。