Dialogflow es 在agentId的平台响应中找不到RichResponse或SystemIntent:
我已经实现了。这就是我的index.js文件的样子:Dialogflow es 在agentId的平台响应中找不到RichResponse或SystemIntent:,dialogflow-es,actions-on-google,Dialogflow Es,Actions On Google,我已经实现了。这就是我的index.js文件的样子: exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { const agent = new WebhookClient({ request, response }); console.log('Dialogflow Request headers: ' + JSON.stringify(request.h
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
function welcome(agent) {
agent.add(`Welcome, I am agent. What is your name?`);
}
function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try again?`);
}
function funtion_name(agent){
let x = agent.parameter.self_defined_identity;
if(x=='something'){
agent.add('WOW');
}
}
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
intentMap.set('Default Fallback Intent', fallback);
intentMap.set('Intent_name',function_name);
// intentMap.set('your intent name here', yourFunctionHandler);
// intentMap.set('your intent name here', googleAssistantHandler);
agent.handleRequest(intentMap);
});
它一直工作到应该调用“intent\u name”的值不是输入为止。调用此意图时,会出现以下错误:
Failed to parse Dialogflow response into AppResponse because of invalid platform response: Could not find a RichResponse or SystemIntent in the platform response for agentId: 12628eb5-d7af-48f9-b013-2e1607d77018 and intentId: 622559ad-9408-4e45-ab01-669528b7f227.
请帮助。此代码的语法正确吗?看起来您的
函数名中缺少了一个右括号。@NickFelker,这是一个拼写错误,请原谅。在实际代码中,括号就在那里。你是否应该有其他的条件,比如当x!='什么“
?