Merge pull request #54 from Gonzalito87/patch-1

Update diaglogflow.js
This commit is contained in:
Leifer Mendez
2022-04-25 19:33:28 +02:00
committed by GitHub

View File

@@ -1,6 +1,6 @@
const dialogflow = require('@google-cloud/dialogflow');
const fs = require('fs')
const nanoid = require('nanoid')
//const nanoid = require('nanoid')
/**
* Debes de tener tu archivo con el nombre "chatbot-account.json" en la raíz del proyecto
*/
@@ -30,7 +30,7 @@ const checkFileCredentials = () => {
// Detect intent method
const detectIntent = async (queryText) => {
let media = null;
const sessionId = nanoid.nanoid()
const sessionId = 1
const sessionPath = sessionClient.projectAgentSessionPath(PROJECID, sessionId);
const languageCode = process.env.LANGUAGE
const request = {
@@ -72,4 +72,4 @@ const getDataIa = (message = '', cb = () => { }) => {
checkFileCredentials();
module.exports = { getDataIa }
module.exports = { getDataIa }