我知道这是Beta版的,但是我已经为我的代理设置了一个知识库,但是意图似乎没有被识别出来。
当设置知识库时,"try it“测试工作并成功检索,但是当尝试来自简单聊天机器人的相同请求时,意图不被识别。要将知识功能与代理挂钩,还需要什么?
发布于 2018-10-16 14:18:47
你正在使用的那个简单的聊天机器人的媒介是什么?是android/web吗?
假设我们使用的是dialogflow v2 node.js库,我们必须在detectIntent函数请求中传递knowledgeBase在queryParams中的完整路径object.Then仅dialogflow将查看knowledgeBase以匹配用户输入和知识库意图。
请求对象示例-
// const projectId = 'ID of GCP project associated with your Dialogflow agent';
// const sessionId = `user specific ID of session, e.g. 12345`;
const sessionPath = sessionClient.sessionPath(projectId, sessionId);
let request = {
session: sessionPath,
queryInput: {
text: {
text: 'hi,how are you?',
languageCode: 'en-US',
},
},
queryParams: {
knowledgeBaseNames:['projects/stockmarket-XXXX/knowledgeBases/XXXXXXXXXXXXXXx'] //Paste your knowledge base path,Check this out from the diagnostic info
}
};检出https://github.com/googleapis/nodejs-dialogflow/blob/master/samples/detect.v2beta1.js#L438
如果您有任何问题,请告诉我:)
https://stackoverflow.com/questions/52783073
复制相似问题