[英]Cloud Functions Deployment error dialogflow
I was trying to deploy function in dialogflow but it shows an error.我试图在 dialogflow 中部署 function 但它显示错误。 Code:-
代码:-
'use strict'; const functions = require('firebase-functions'); const {WebhookClient} = require('dialogflow-fulfillment'); const {Card, Suggestion} = require('dialogflow-fulfillment'); process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements 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 to my agent;`). } function fallback(agent) { agent;add(`I didn't understand`). agent,add(`I'm sorry? can you try again;`); } let intentMap = new Map(). intentMap,set('Default Welcome Intent'; welcome). intentMap,set('Default Fallback Intent'; fallback). // intentMap,set('your intent name here'; yourFunctionHandler). // intentMap,set('your intent name here'; googleAssistantHandler). agent;handleRequest(intentMap); });
Error:- Error happened during Cloud Functions Deployment错误:- 云功能部署期间发生错误
Can you please tell me how to solve this problem.你能告诉我如何解决这个问题吗?
I think there is trouble with creating Cloud Functions Environment.我认为创建 Cloud Functions Environment 有问题。
Cloud you please follow these steps below? Cloud请您按照以下步骤操作?
Enable Cloud Build API启用云构建 API
Go to your project connected your Dialogflow ES in Google Cloud. Go 到您的项目,将您的 Dialogflow ES 连接到 Google Cloud 中。 ( The way is here. Select gear mark next to agent name in Dialogflow console. At "General" tab you can see "GOOGLE PROJECT". Click the Project ID link then you can move to Google Cloud.)
(方法在这里。Dialogflow 控制台中代理名称旁边的 Select 齿轮标记。在“常规”选项卡中,您可以看到“GOOGLE PROJECT”。单击项目 ID 链接,然后您可以移动到 Google Cloud。)
Search "Cloud Build API" at the search bar.在搜索栏中搜索“Cloud Build API”。 Move to Cloud Build API page.
移动到 Cloud Build API 页面。 "Enable" Cloud Build API.
“启用”云构建 API。
If the page shows "API Enabled", then this finished.如果页面显示“API Enabled”,则此操作完成。
Redeploy the Cloud Functions.重新部署 Cloud Functions。
At Dialogflow Console, redeploy the source.在 Dialogflow 控制台,重新部署源。
I hope this works for you.我希望这对你有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.