Это мой код выполнения.Я хочу просто отобразить значение, соответствующее финансам или чему-либо еще, и отправить его в диалоговый поток, но всякий раз, когда я запускаю этот код, все, что я получаю, это ответ «Извините, я не знаю этого».
'use strict';
var https = require('https');
const functions = require('firebase-functions');
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const action = request.body.queryResult.action;
//const agent = new WebhookClient({ request, response });
response.setHeader('Content-Type', 'application/json');
if (action != 'input.getfunc1') {
response.send(buildChatResponse("I'm sorry, I don't know this"));
return;
}
const parameters = request.body.queryResult.parameters;
var c = parameters.commitee;
getfunc1(c, response);
});
function func1(c, CloudFnResponse) {
var e = {
'corporate strategy & implementation':
'CSI is a dynamic committee that is the on-ground army of Aaruush. Responsible for internal and external publicity, strategizing work-plans and executing them.',
'operations & resource management':
'Operations & Resource Management is a committee which deals with all the resources required for the team, permissions required for proper work flow of Aaruush team. ',
finance:
'The Finance Committee examines the accounts, scrutinizes the proposals for expenditures and submits the annual budget for the Aaruush. No expenditure in the budget is incurred without the prior approval of the Finance Committee',
};
var g = e[c.toLowerCase()];
var chat = g;
CloudFnResponse.send(buildChatResponse(chat));
}
function buildChatResponse(chat) {
return JSON.stringify({ fulfillmentText: chat });
}