我一直在研究 POC,我能够从外部 API 调用 Dialogflow 实现 webhook 并获取响应,但在禁用 Beta 功能选项时无法获取知识库响应。当我启用 Beta 功能时,我得到了知识库响应,但没有得到 webhook 响应。无法使知识库和 webhook 与 beta 功能选项一起使用。
Dialogflow CX 可以吗?Knowledge 有效,但 Webhook 无效,如下所示:
const knflow = require('@google-cloud/dialogflow').v2beta1;
const ksclient = new knflow.SessionsClient({
keyFilename: "C:/Temp/XXXXXX.json"
});
const sessionPath = ksclient.projectAgentSessionPath(
projectId,
sessionId
);
var responses = await ksclient.detectIntent(request);
Webhook works but not knowledgebase with the following:
const sessionPath = sessionClient.sessionPath(projectid,sessionid);
var chatMessage = chatRequest.messageDetails.message;
var responses = await sessionClient.detectIntent(request);