我们希望保留持久的价值观。我们使用以下简单代码进行了尝试,但没有保留该值。我们犯了什么错误?
index.js
'use strict';
const functions = require('firebase-functions');
const { dialogflow } = require('actions-on-google');
const app = dialogflow();
app.intent('FirstIntent', conv => {
conv.user.storage.value = 'A';
conv.followup('SecondEvent');
});
app.intent('SecondIntent', conv => {
conv.close('value is ' + conv.user.storage.value);
});
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
包.json
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "8"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.6.1"
}
}
FirstIntent 在启动时被调用。将持久值保存在 FirstIntent 中并引发 SecondEvent。调用 SecondIntent。读取 SecondIntent 中的持久值以创建响应。显示“值未定义”。
我们找到了以下日志。
Billing account not configured.
External network is not accessible and quotas are severely limited.
Configure billing account to remove these restrictions
我们升级到flame,确认日志没有显示,但是持久值还没有保存。不收费能解决这个问题吗?