我想在我的DialogFlow机器人中使用Firestore,但是它显示了某些错误。这是我的index.js代码:
function writeToDb () {
console.log(`Inside writeToDb`);
// Get parameter from Dialogflow with the string to add to the database
const databaseEntry = {
'eMail':'shashank@gmail.com'
};
console.log(
这是我想要实现的
if user is exist in firestore
show the data
else
add it to firestore
下面是我的代码
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
// for Dialogflow fulfillment library docs, samples, and to report issues
'use strict';
const functions = require('fire
我在对话框流中使用内联编辑器,目的是对我在Firestore中创建的数据库进行查询。简而言之,用户请求一个课程列表,我希望聊天机器人然后从db中获取该信息并将其显示给用户。下面我尝试创建一个函数来实现这个功能,我想要接受用户的输入,说“艺术课程”,并让我的db返回那些结果。
到目前为止,我已经创建了一个功能,它是在意图匹配时触发的,如下所示;
function getCourses(agent){
let courseRequest = agent.parameters.courseRequest;
if (getCourses){
console.log(&
默认意图调用云函数会产生错误
Error: No handler for requested intent
at WebhookClient.handleRequest (/user_code/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:287:29)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/user_code/index.js:73:11)
at cloudFunction (/user_code/node_
我已经在Dialogflow中创建了一个聊天机器人,现在我想用Pycharm将其实现到我自己的Python环境中。我还需要采取哪些其他步骤来连接这两者,以便能够基于用户输入触发对话框流意图,所有这些都是通过Python实现的?我在下面的代码中测试了一个防火墙查询,它已经成功地工作了,所以我知道AdminSDK的设置是正确的。
import os
import json
import sys
import dialogflow
from dialogflow_v2beta1 import *
import firebase_admin
from firebase_admin import fir
我的错误越来越少。
Error: Argument "data" is not a valid Document. Input is not a plain JavaScript object.
at Object.exports.(anonymous function) [as isDocument] (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/validate.js:86:15)
at WriteBatch.set (/user_code/n
我想使用我在Dialogflow项目中获得的数据来集成Firestore。
我在网上搜索,发现了一些随机的东西。我在里面写了一些console.log,因为我想了解它是如何工作的,但似乎什么都没有发生,我甚至不知道在哪里可以找到我的日志。
下面是我的index.js对话框代码:
'use strict';
// Import the Dialogflow module from the Actions on Google client library.
//const {dialogflow} = require('actions-on-google');
c
我正在尝试从firestore获取数据并将其显示在DialogFlow响应中。当我在DialogFlow中触发"buyerBusiness“intent时,函数web fulfillment成功,但检索到的数据没有显示为响应。当我安慰他们时,它会记录在日志中。下面是为此编写的处理程序函数。
function buyerBusiness(agent) {
console.log("buyer name is " + params.BuyerEntity);
var abc = new Set();
var results =
我的聊天机器人是在对话框中创建的,现在我正在尝试从Python中访问它,以便在GUI中获取用户输入和显示输出(假设是一个基本的chatbot gui)。
我已经将我的Python环境连接到了对话框流和火药库,
下面是检测意图的代码;
#Detection of Dialogflow intents, project and input.
def detect_intent_texts(project_id, session_id, texts, language_code):
#Returns the result of detect intent with texts as input
当我运行这个Firebase函数时,我一直收到这个错误:
TypeError: Cannot read property 'add' of undefined
at visaCountry (/srv/index.js:51:11)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/srv/index.js:105:40)
at cloudFunction (/srv/node_modules/firebase-functions/lib/providers/http
我已经创建了一个对话框聊天机器人。在其中,我创建了一个webhook来将它与firebase集成。当用户从内部对话框(聊天窗口)向机器人询问问题时,聊天机器人和web钩子运行良好。
我想创建我的自定义聊天窗口。因此,我创建了一个使用角6。集成我的角前端与对话框流聊天代理。对于这个角度聊天窗口,对话框流聊天机器人可以很好地处理静态问题,但是当我查询使用web钩子的意图时,我在日志中得到了以下错误:
(/user_code/node_modules/dialogflow-fulfillment/src/v2-agent.js:108:86) at (/user_code/node_modules