gpt4 book ai didi

javascript - 找不到模块 'actions-on-google',正在使用 dialogflow

转载 作者:行者123 更新时间:2023-11-30 19:15:34 25 4
gpt4 key购买 nike

我是第一次使用 dialogflow fulfillment 库,这里是要求

// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions');

// The Firebase Admin SDK to access the Firebase Realtime Database.
const admin = require('firebase-admin');
var db = admin.initializeApp();
const { WebhookClient } = require('dialogflow-fulfillment');
process.env.DEBUG = "dialogflow:debug";

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((req, res) => {
const _agent = new WebhookClient({ req, res });

let params = req.body.queryResult.parameters;
let actions = req.body.queryResult.action;
这是 package.json 文件

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
},
"dependencies": {
"actions-on-google": "^2.12.0",
"firebase-admin": "^8.0.0",
"firebase-functions": "^3.1.0"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.1.6"
},
"private": true
}

错误是Error: Error parsing triggers: Cannot find module 'actions-on-google'我已经在 this 尝试了所有答案问题。我只想在 firebase 上部署我的应用程序

最佳答案

只需尝试使用此命令在您目录中的 functions 文件夹内的 package.json 中安装一个 actions-on-google 模块

npm i actions-on-google --save

这个包是必需的,因为 dialogflow 提供了与 google assistant 的集成,所以为了确保它正常工作,我们也必须安装这个包。

关于javascript - 找不到模块 'actions-on-google',正在使用 dialogflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58044924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com