繁体   English   中英

Cloud Functions 部署错误对话框流

[英]Cloud Functions Deployment error dialogflow

我试图在 dialogflow 中部署 function 但它显示错误。 代码:-

 '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); });

错误:- 云功能部署期间发生错误

你能告诉我如何解决这个问题吗?

我认为创建 Cloud Functions Environment 有问题。

Cloud请您按照以下步骤操作?

  1. 启用云构建 API
    Go 到您的项目,将您的 Dialogflow ES 连接到 Google Cloud 中。 (方法在这里。Dialogflow 控制台中代理名称旁边的 Select 齿轮标记。在“常规”选项卡中,您可以看到“GOOGLE PROJECT”。单击项目 ID 链接,然后您可以移动到 Google Cloud。)
    在搜索栏中搜索“Cloud Build API”。 移动到 Cloud Build API 页面。 “启用”云构建 API。
    如果页面显示“API Enabled”,则此操作完成。

  2. 重新部署 Cloud Functions。
    在 Dialogflow 控制台,重新部署源。

我希望这对你有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM