小编cry*_* S.的帖子

Dialogflow CX Webhook 用于使用 NodeJS 回复用户

我尝试使用dialogflow-fulfillment库,但我猜它是针对Dialogflow ES的,所以现在我使用@google-cloud/dialogflow-cx库,但我不知道如何使用这个库进行webhook连接来回复使用fulfilments的用户,可用于 Dialogflow CX 的材料非常少。

// use credentials or keyFilename i'm using keyFile
    credentials: {
        private_key: "-----BEGIN PRIVATE KEY-----==\n-----END PRIVATE KEY-----\n",
 
        client_email:"pro1a3711.iam.gserviceaccount.com",
    },                                                                                                                                                                                                                                                                                                                                                                              
        keyFilename: './pr.json'
}

const {SessionsClient} = require('@google-cloud/dialogflow-cx');
const projectId = 'pro1-293711';
const location = 'global';
const agentId = 'da2271f5-0221-4dce-98d3-efa----9dd';
const languageCode = 'en';
 const query = ['hello'];
// Imports the Google Cloud Some API library
//console.log(WebhooksClient)
const client = new SessionsClient(config);
   //console.log("client",client)
     async function detectIntentText() {
        const sessionId = Math.random().toString(36).substring(7);
    const sessionPath = client.projectLocationAgentSessionPath(
      projectId,
      location,
      agentId, …
Run Code Online (Sandbox Code Playgroud)

webhooks node.js dialogflow-cx

4
推荐指数
1
解决办法
5614
查看次数

标签 统计

dialogflow-cx ×1

node.js ×1

webhooks ×1