Dialogflow Tutorials: Integrate Dialogflow with MySQL Database

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 196

  • @Viralplace
    @Viralplace 5 років тому +2

    Yessss :D make others video with php please, you are the Numbers 1! Numero 1 🇮🇹

  • @saniduanupama5818
    @saniduanupama5818 Рік тому

    This was very helpful! Thanks for sharing

  • @RETECHMART-u3c
    @RETECHMART-u3c 2 місяці тому

    Do you create any video or steps for connecting Hostinger DB to google dialog flow. I have followed the same steps but no luck getting Access denied issue.

  • @smileygupta7437
    @smileygupta7437 Рік тому

    Hi Anshul
    Could u please tell is it possible to return multiple rows of data from db to dialogflow as response?

  • @smileygupta7437
    @smileygupta7437 Рік тому

    Thanks for uploading such useful content 🙂

  • @mauriceesquierdo8492
    @mauriceesquierdo8492 Рік тому

    Do i need to connect it first to Firebase?

  • @vrashikeshpatil9315
    @vrashikeshpatil9315 Рік тому

    Thank You for amazing video
    can you guide me why i am getting this error in GCP
    FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail

  • @bcyrille
    @bcyrille 2 роки тому

    Thank you for this tutorial. I have one question: How if we want to execute multiple statments under one intent. i.e you want to confirm a custumer exists, fetch its id and then insert some record like an order, using one intent (fetch some data, if data feteched and compared, then execute the insert statement). Thanks in advance

  • @akd9977
    @akd9977 5 років тому +1

    Thanks for sharing. Is it possible to do the same work from SAS using dialogflow in stead of MySQL

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому +1

      Sorry no experience of using SAS but will try to explore that.

  • @bmayer710
    @bmayer710 5 років тому +1

    Nice tutorials, keep it up, good job :)

    • @geovilla821
      @geovilla821 5 років тому

      Hi Benjamin, did you try to execute the codes? In my case, the BOT does not fetch the records in my MYSQL database hosted in a webhosting. Is there any configuration to do in the webhosting to allow the DATABASE to be access?

    • @AnshulShrivastavaOnline
      @AnshulShrivastavaOnline 4 роки тому

      @@geovilla821 you may need to whitelist the IP address from which you are trying to access the database.

  • @hemonk
    @hemonk 3 роки тому

    Thankyou so much

  • @blackewe216
    @blackewe216 3 роки тому +1

    hi thanks for the video but i have a problem. i have my MySQL database at clevercloud and i did the same as you and my agent returned "webhook failed: not available". I think the problem is that clevercloud dont provide an IP to identificate the host, it gives me an url and maybe that makes the connection not working. So my question is: is it possible to connect dialogflow with a database at deployed at clevercloud?
    Thankss

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      Not sure about clevercloud but make sure to enable remote connection for your mySQL database.

    • @blackewe216
      @blackewe216 3 роки тому

      @@AxleWebTechnologies i have been looking for that but i think is enabled as default because i didnt find anything like remote connections settings and it says to me that the database is 'running' so its weird.

  • @laxmanawate1013
    @laxmanawate1013 5 років тому

    Hey tysm long time video but really appreciate

  • @odhabi947
    @odhabi947 5 років тому +1

    To enable remote MYSQL on hostGator you need to specify the address of the server that will access the MySQL server. Which address did you use?

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому

      It is the IP address of your hosting provider. I have added some details in the video, please have a look here: ua-cam.com/video/v7k5vckSzNo/v-deo.html

    • @kennycolonia296
      @kennycolonia296 5 років тому

      @@AxleWebTechnologies
      It refers to the IP side of the Dialogflow to allow queries. Please help us!

    • @sayedmaysoor6361
      @sayedmaysoor6361 4 роки тому

      @@kennycolonia296 did you find a solution for this?

    • @sayedmaysoor6361
      @sayedmaysoor6361 4 роки тому

      did you find solution for this?

    • @sayedmaysoor6361
      @sayedmaysoor6361 4 роки тому

      @@AxleWebTechnologies please help on this matter

  • @philiplartey19
    @philiplartey19 5 років тому +1

    Great Tutorial, When are you releasing remaining Part of CRUD

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому

      We will release by next week. Please subscribe to our channel and press the bell icon to stay updated

    • @philiplartey19
      @philiplartey19 5 років тому

      @@AxleWebTechnologies That's really great. I will be waiting for fior this.

  • @paramotor1223
    @paramotor1223 3 роки тому

    Hi I need to get some data from tow tables
    first table "cust_tbl" has (name, email, id )
    and balance table Has the (id, cust_id, balance)
    so how i can show the customer name with the ambulance ?
    thanks

    • @paramotor1223
      @paramotor1223 3 роки тому

      just need the query
      Select * from cust_tbl,bulnce_tbl ****?

  • @dhirenpathak
    @dhirenpathak Рік тому

    Thanks

  • @citracelljbr
    @citracelljbr 3 роки тому

    is it free price for develop with external database like mysql from hosting??

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      There might be some charge depending on where are you hosting MySQL

  • @cyberpau2298
    @cyberpau2298 4 роки тому

    Thank you for this tutorial, very informative. However, there are some issues when using Google Cloud SQL (mysql)... and apparently I can't make it work. Do you have any thoughts on how can I fix this? Thank you

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Few things to check
      1. Make sure your billing account is enabled
      2. Make sure that fulfillment option is enabled in the intent
      3. Make sure remote access is allowed for the MySQL Database

    • @vinaydubasi6419
      @vinaydubasi6419 4 роки тому

      @cyberpau were you able to solve using Google Cloud SQL (mysql)? Please let me know it would be very helpful been stuck there, not able to connect using dialogflow though my database accepts remote connections.

    • @vinaydubasi6419
      @vinaydubasi6419 4 роки тому

      @@AxleWebTechnologies Hey Anshul all these have been enabled but still not able to connect using Google Cloud SQL (mysql), though i'm able to set up and use through firebase, can you please help :/
      My COde:
      'use strict';

      const functions = require('firebase-functions');
      const {WebhookClient} = require('dialogflow-fulfillment');
      const {Card, Suggestion} = require('dialogflow-fulfillment');
      const {mysql}= require('mysql');
      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?`);
      }
      function connectToDatabase(){
      const connection = mysql.createConnection({
      host : 'xx.xx.xxx.xxx',
      user : 'user',
      password : 'pwd',
      database : 'db'
      });
      return new Promise((resolve,reject) => {
      connection.connect();
      resolve(connection);
      });

      }

      function queryDatabase(connection){
      return new Promise((resolve, reject) => {
      connection.query('select *from user', (error, results, fields) => {
      resolve(results);
      console.log("connections success");
      });
      });
      }

      function handleReadFromMySQL(agent){
      const user_email = agent.parameters.email;
      return connectToDatabase()
      .then(connection => {
      return queryDatabase(connection)
      .then(result => {
      console.log(result);
      result.map(user => {
      if(user_email === user.email){
      agent.add(`First Name: ${user.firstname} and Last Name: ${user.lastname}`);
      }
      });
      connection.end();
      });
      });
      }
      let intentMap = new Map();
      intentMap.set('Default Welcome Intent', welcome);
      intentMap.set('Default Fallback Intent', fallback);
      intentMap.set('getDataFromMySQL', handleReadFromMySQL);
      // intentMap.set('your intent name here', yourFunctionHandler);
      // intentMap.set('your intent name here', googleAssistantHandler);
      agent.handleRequest(intentMap);
      });
      Error :
      "webhookStatus": {
      "code": 14,
      "message": "Webhook call failed. Error: UNAVAILABLE."
      }

  • @ipofficeavaya1794
    @ipofficeavaya1794 3 роки тому

    Hi, can you help me, i'm getting this error "Webhook call failed. Error: DEADLINE_EXCEEDED." Also in logs in the google cloud console I received this Warning, "FIREBASE_CONFIG environment variable is missing. Initializing"

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      Deadline exceeded means your webhook code did not responded back within 5 seconds. Try to reduce the processing you are doing in your code/logic. Also if there is an external API call, please make sure your external api responds within 5 seconds.
      If you still face any issue, please send an email to dialogflow.team@axlewebtech.com with error logs and screenshot of errors you are facing. Someone from our team will help you.

  • @examplaza
    @examplaza 4 роки тому

    it seems like it is not working on a shared server. I tried using 31.31.196.194:2082 but didn't work for me.

  • @Jared-kd9jv
    @Jared-kd9jv 4 роки тому

    Could this work for querying information from a mySQL DB that is not part of a predefined/ system entity

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Yes absolutely, You can fetch any information from mySQL. There is no correlation between system entities and mySQL database information.

  • @validampong8447
    @validampong8447 3 роки тому

    Hi, i did everything you said, but i get this error
    TypeError: result is not a function
    at queryDatabase.then.result

  • @SomethingSpiritual
    @SomethingSpiritual 4 роки тому

    Hi Anshul,
    Can we do the same with mssql connection?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому +1

      You can create an API which is connected to your MSSQL database and then you can connect your Dialogflow agent to MSSQL using those APIs. We haven't tried connecting Dialogflow directly to MSSQL so not sure about that.

    • @SomethingSpiritual
      @SomethingSpiritual 4 роки тому

      @@AxleWebTechnologies thats good too. Thank you for your guidance.

  • @hapuertam91
    @hapuertam91 4 роки тому

    Hello Axle! i got undefined too. I dont know how to get the host name using phpmyadmin mysql service, there is a way that i can do that without hostgator? thanks in advance

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Your server IP address should be your hostname, you can contact hostgator support to get these details. You can try connecting to MySQL from Workbench, Navicat or Sequel Pro before connecting through Dialogflow. One more thing, you need to enable remote access to your MySQL database to the remote IP. Please refer to this article: www.hostgator.com/help/article/how-to-connect-to-the-mysql-database-remotely

  • @emptycoder3630
    @emptycoder3630 3 роки тому

    After implementing according to your tutorial getting following error:
    "handleRequest must contain a map of Dialogflow intent names to function handlers"
    Please help me I am fully stuck.

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      make sure you put correct intent name in the intent handler function.

  • @andreavedruccio2227
    @andreavedruccio2227 4 роки тому

    I have this error
    The deployment of your Cloud Function failed:
    Function failed on loading user code. Error message: Code in file index.js can't be loaded.
    Is there a syntax error in your code?
    Detailed stack trace: ReferenceError: agent is not defined
    at Object. (/srv/index.js:115:3)
    What can i do?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Looks like something messed up. Try creating a new Dialogflow agent and do the steps again.

  • @lion10711
    @lion10711 4 роки тому

    i have use xampp for phpmyadmin what to do?

  • @beliabaez9385
    @beliabaez9385 4 роки тому

    Hi. Your video is great. I follow step by step the video but after typing the email the default response "not available" and I get this error Webhook call failed. Error: UNAVAILABLE. Could you help me with that? Thankyou

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      There could be several reasons for this error. Please share the console logs. You can join our Slack Channel for quick discussion.

    • @beliabaez9385
      @beliabaez9385 4 роки тому

      @@AxleWebTechnologies Yes, how can I join the slack channel?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Please join the slack channel using below link and post your queries in the channel:
      join.slack.com/t/dialogflow-awt/shared_invite/enQtOTUwMzAwOTI3Mjk2LWRiOGYwOGIyOGU4ZjNkNWI3NTJiMTgyMmMyNTM2OWE2YzZmZjkwNmEyMWZmOWIyZTRmNzY3MTY2ZDYzNWVhYzQ

  • @samiullapathan5277
    @samiullapathan5277 4 роки тому

    Hi sir. Thank you for nice tutorials. I followed step explained in the video but facing some issue
    Error is: ECONNREFUSE error

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Looks like your MySQL database is refusing to connect. You have to enable remote access to your MySQL database.

  • @agung4834
    @agung4834 4 роки тому

    Hi! I have followed your tutorial, but in minute 13:00, I don't have a message like you in Firebase Functions, and when I type MySQL, I don't get any result in Functions, any suggestion?

    • @agung4834
      @agung4834 4 роки тому

      and in fulfillment status is : Webhook call failed. Error: UNKNOWN.

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      There could be couple of things that might cause the issue. Please check the following
      1. Have you enabled the billing account
      2. Have you enabled the fulfilment option in the intent
      3. Have you added console.log in your code
      4. Have you added mysql package in package.json?
      Try these and let me know if it still doesn't works.

    • @agung4834
      @agung4834 4 роки тому

      @@AxleWebTechnologies I have to do all the things, still cannot connect, can you see it?

    • @agung4834
      @agung4834 4 роки тому

      @@AxleWebTechnologies I don't get any RowDataPacket in 13:14

    • @kirandeepmarala5541
      @kirandeepmarala5541 4 роки тому

      @@agung4834 I have the same problem ,can you help me to solve

  • @bahaaeldin2656
    @bahaaeldin2656 3 роки тому

    what if I want to get all the rows that have the same namel
    so maybe 3 people with same name
    and that gives me 3 emails for 1 response how to achieve that?

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      You can loop through responses and add agent.add for each response

  • @SuTtIk0rN
    @SuTtIk0rN 4 роки тому

    May I ask you .log file that show dialogflowFirebaseFulfillment undefined. how can I sovle it.

    • @SuTtIk0rN
      @SuTtIk0rN 4 роки тому

      Update Error: Cannot enqueue Handshake after already enqueuing a Handshake.

    • @TrictoYT
      @TrictoYT 4 роки тому

      @@SuTtIk0rN look for my previous comment

  • @johnnytawil
    @johnnytawil 4 роки тому

    some extra code/lines are used but not showing in your video. I have followed your videos step by step but still showing me like "results not defined". Here "results" is the variable used

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Please refer to the code here and make sure there are no errors in your code. gist.github.com/Anshul0305/aace32e8eabcb2ef49835d0079091e00
      Also if possible, share your code so that I can have a look.

  • @diegosiltel
    @diegosiltel 4 роки тому

    Hi, first of all great tutorial and tnks, now i followed step explained in the video but facing some issue Error: No responses defined for platform: DIALOGFLOW_CONSOLE
    at WebhookClient.send_ (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:488:13)
    at promise.then (/workspace/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:306:38)
    at process._tickCallback (internal/process/next_tick.js:68:7)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Please share the source code for index.js file with anshul.shrivastava@axlewebtech.com, I will have a look ~ Anshul

  • @taktikoseomarketingdigital3431
    @taktikoseomarketingdigital3431 4 роки тому

    i need have the Enterprise Edition
    Essentials plan activate?

  • @philiplartey19
    @philiplartey19 5 років тому

    Hi, Can you help I am getting below error, have tried all and can't figure it out...I turned on SSH at my server Side but Still not working.
    "webhookStatus": {
    "code": 13,
    "message": "Webhook call failed. Error: 500 Internal Server Error."

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому

      Looks like some problem in your code. Please check firebase console logs. That might help.

    • @philiplartey19
      @philiplartey19 5 років тому

      @@AxleWebTechnologies I am using your code on Github the same way just query and Sever credentials changed. See error from the firebase console. Please let me know if I contact you directly. Please share your contact.
      TypeError: Cannot read property 'map' of undefined
      at queryDatabase.then.result (/srv/index.js:118:16)
      at
      at process._tickDomainCallback (internal/process/next_tick.js:229:7)

  • @TrictoYT
    @TrictoYT 4 роки тому

    I want to query my database to see if certain data is there or not and if it isn't I want a response to be given how do I do that please help

    • @TrictoYT
      @TrictoYT 4 роки тому

      I tried an if statement but it still didn't work

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Please try asking your query on stackoverflow with the full code and paste the link to your question here. Need to see your code in order to help you.

  • @sasuriebot1111
    @sasuriebot1111 4 роки тому

    I am repeatedly getting this error along with unhandled rejection
    TypeError: Cannot read property 'map' of undefined
    at queryDatabase.then.result (/srv/index.js:72:17)
    at
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Maybe you need to enable remote access to your mysql database. Try login to your control panel and follow the steps as mentioned in the below tutorial.
      ua-cam.com/video/xXOq9U9fzOo/v-deo.html

    • @sasuriebot1111
      @sasuriebot1111 4 роки тому

      @@AxleWebTechnologies Even enabling remote access it's with same error sir.

  • @alejandrocontrerasacontreras
    @alejandrocontrerasacontreras 4 роки тому

    Hi i have this error
    TypeError: Cannot read property 'map' of undefined
    at queryDatabase.then.result (/srv/index.js:55:16)
    at
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Looks like you are not getting the data back from mysql, please try adding console logs and try to log the results of queryDatabase function.

    • @alejandrocontrerasacontreras
      @alejandrocontrerasacontreras 4 роки тому

      @@AxleWebTechnologies dialogflowFirebaseFulfillment
      p7ea7wnqhj41
      Connection { domain: Domain { domain: null, _events: { error: [Function] }, _eventsCount: 1, _maxListeners: undefined, members: [ [Object] ] }, _events: {}, _eventsCount: 0, _maxListeners: undefined, config: ConnectionConfig { host: '162.241.2.113', port: 3306, localAddress: undefined, socketPath: undefined, user: 'tendenc6_trackin', password: 'tracking100', database: 'tendenc6_tracking', connectTimeout: 10000, insecureAuth: false, supportBigNumbers: false, bigNumberStrings: false, dateStrings: false, debug: undefined, trace: true, stringifyObjects: false, timezone: 'local', flags: '', queryFormat: undefined, pool: undefined, ssl: false, localInfile: true, multipleStatements: false, typeCast: true, maxPacketSize: 0, charsetNumber: 33, clientFlags: 455631 }, _socket: Socket { connecting: true, _hadError: false, _handle: TCP { reading: false, owner: [Circular], onread: [Function: onread], onconnection: null, writeQueueSize: 0 }, _parent: null, _host: null, _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: [Object], length: 0, pipes: null, pipesCount: 0, flowing: true, ended: false, endEmitted: false, reading: true, sync: false, needReadable: true, emittedReadable: false, readableListening: false, resumeScheduled: false, destroyed: false, defaultEncoding: 'utf8', awaitDrain: 0, readingMore: false, decoder: null, encoding: null }, readable: false, domain: Domain { domain: null, _events: [Object], _eventsCount: 1, _maxListeners: undefined, members: [Array] }, _events: { end: [Array], _socketEnd: [Function: onSocketEnd], data: [Function], error: [Function: bound ], connect: [Array], timeout: [Object] }, _eventsCount: 6, _maxListeners: undefined, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: false, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: false, errorEmitted: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: true, allowHalfOpen: false, _bytesDispatched: 0, _sockname: null, _pendingData: null, _pendingEncoding: '', server: null, _server: null, _idleTimeout: 10000, _idleNext: TimersList { _idleNext: [Circular], _idlePrev: [Circular], _timer: [Object], _unrefed: true, msecs: 10000, nextTick: false }, _idlePrev: TimersList { _idleNext: [Circular], _idlePrev: [Circular], _timer: [Object], _unrefed: true, msecs: 10000, nextTick: false }, _idleStart: 65789, _destroyed: false, [Symbol(asyncId)]: 87, [Symbol(bytesRead)]: 0, [Symbol(asyncId)]: 91, [Symbol(triggerAsyncId)]: 81 }, _protocol: Protocol { domain: Domain { domain: null, _events: [Object], _eventsCount: 1, _maxListeners: undefined, members: [Array] }, _events: { data: [Function], end: [Array], handshake: [Function: bound _handleProtocolHandshake], initialize: [Function: bound _handleProtocolInitialize], unhandledError: [Function: bound ], drain: [Function: bound ], enqueue: [Function: bound _handleProtocolEnqueue] }, _eventsCount: 7, _maxListeners: undefined, readable: true, writable: true, _config: ConnectionConfig { host: '162.241.2.113', port: 3306, localAddress: undefined, socketPath: undefined, user: 'tendenc6_trackin', password: 'tracking100', database: 'tendenc6_tracking', connectTimeout: 10000, insecureAuth: false, supportBigNumbers: false, bigNumberStrings: false, dateStrings: false, debug: undefined, trace: true, stringifyObjects: false, timezone: 'local', flags: '', queryFormat: undefined, pool: undefined, ssl: false,

    • @alejandrocontrerasacontreras
      @alejandrocontrerasacontreras 4 роки тому

      @@AxleWebTechnologies this is the logs for the connection

  • @HossamAyman
    @HossamAyman 5 років тому

    Awesome

  • @vivekshah7385
    @vivekshah7385 3 роки тому

    Permission denied (HTTP 403): Cloud Functions API has not been used in project 647263654951 before or it is disabled

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      Try enabling cloud functions API. You can do a google search to know how to do that.

  • @kose25
    @kose25 5 років тому

    Why you don't use this query instead to save some code lines "select name, lastname from users where email='agent.parameters.email'? It's more efficient

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому +1

      Yes definitely you can do the refactoring like that. My main purpose was to make it easier to understand so that even beginners can understand.

    • @kose25
      @kose25 5 років тому +1

      @@AxleWebTechnologies oh I got it, thank you for explaining. I like your videos I really hope you can continue with some advanced querys for better user experience. Something like when the user says "I want to see the users created yesterday" or " I want to se the older user name", it's just a suggestion. Thanks in advance

  • @shekanyasetijo5695
    @shekanyasetijo5695 4 роки тому

    Hi can you help..
    This error keeps popping up
    dialogflowFirebaseFulfillment
    Function execution took 60003 ms, finished with status: 'timeout'

    • @shekanyasetijo5695
      @shekanyasetijo5695 4 роки тому

      nvm I found the answer.. please check your code before you run it guys..
      anyway.. new problem.. the results is undefined.. help please

    • @freddyling4266
      @freddyling4266 4 роки тому

      @@shekanyasetijo5695 what is the solution?

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      @@shekanyasetijo5695 even i am facing this error and also this error { Error: connect ETIMEDOUT at Connection._handleConnectTimeout
      Please help me out if you will get the solution. Thanks in advance

  • @davidaching1617
    @davidaching1617 2 роки тому

    Can I do that with php webhook?

  • @SomethingSpiritual
    @SomethingSpiritual 4 роки тому

    Hi Anshul, Please help me out with this..
    TypeError: Cannot read property '0' of undefined
    at queryDatabase.then.result (/srv/index.js:56:35)
    at
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Can you please share the code of index.js file

    • @SomethingSpiritual
      @SomethingSpiritual 4 роки тому

      @@AxleWebTechnologies
      here it is..
      // See github.com/dialogflow/dialogflow-fulfillment-nodejs
      // for Dialogflow fulfillment library docs, samples, and to report issues
      'use strict';

      const functions = require('firebase-functions');
      const {WebhookClient} = require('dialogflow-fulfillment');
      const {Card, Suggestion} = require('dialogflow-fulfillment');
      const mysql=require('mysql');

      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?`);
      }
      function connectToDatabase(){
      const connection=mysql.createConnection({
      host:'185.27.134.162',
      user:'epiz_26025202',
      password:'YerusJbltT7N34',
      database:'epiz_26025202_Botdata'
      });

      return new Promise((resolve,reject) =>{
      connection.connect();
      resolve(connection);
      });
      }

      function queryDatabase(connection){
      return new Promise((resolve,reject) =>{
      connection.query('SELECT * from demo',(error,results,fields) => {
      resolve(results);
      });
      });
      }


      function handlereadfromMysql(agent) {
      return connectToDatabase()
      .then(connection => {
      return queryDatabase(connection)
      .then(result => {
      console.log(result);

      agent.add(`Fname: ${result[0].fname}`);
      connection.end();
      });
      });
      }

      let intentMap = new Map();
      intentMap.set('Default Welcome Intent', welcome);
      intentMap.set('Default Fallback Intent', fallback);
      intentMap.set('getDataMysql', handlereadfromMysql);
      // intentMap.set('your intent name here', yourFunctionHandler);
      // intentMap.set('your intent name here', googleAssistantHandler);
      agent.handleRequest(intentMap);
      });

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Did you enabled remote access for your MySQL database?

    • @SomethingSpiritual
      @SomethingSpiritual 4 роки тому

      @@AxleWebTechnologies will it be possible with infinityfree.net/ ?
      i am using it for learning and testing

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому +1

      Not sure about that please check with their customer service team

  • @spcyrusmultiservicos8194
    @spcyrusmultiservicos8194 4 роки тому

    what can this error be
    TypeError: Cannot read property 'map' of undefined
    at queryDatabase.then.result (/srv/index.js:54:16)
    at
    at process._tickDomainCallback (internal / process / next_tick.js: 229: 7)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Check line number 54. Array on which you are calling .map is null or undefined.

  • @jongmedellin4890
    @jongmedellin4890 4 роки тому

    hi, i have project can help me

  • @venkatabhilash4325
    @venkatabhilash4325 4 роки тому

    Hi, I am getting this error while connecting my local Mysql. Can you help with this
    Error: { Error: connect ECONNREFUSED 127.0.0.1:3306 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14) -------------------- at Protocol._enqueue (/srv/node_modules/mysql/lib/protocol/Protocol.js:144:48) at Protocol.handshake (/srv/node_modules/mysql/lib/protocol/Protocol.js:51:23) at Connection.connect

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      You cannot connect you dialogflow with MySQL server running on localhost. There are couple of things you can do
      1. host the SQL server on cloud such as AWS or Google cloud
      2. tunnel your localhost using ngrok or similar tool

    • @venkatabhilash4325
      @venkatabhilash4325 4 роки тому

      @@AxleWebTechnologies Thank you for the help

  • @jonaszprzybycien6545
    @jonaszprzybycien6545 4 роки тому

    Would that also work with voicebot?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Yes, it will work. Which voicebot, are you referring to?

    • @jonaszprzybycien6545
      @jonaszprzybycien6545 4 роки тому

      @@AxleWebTechnologies dialogflow voicebot that's what we settled on during brainstorm

    • @jonaszprzybycien6545
      @jonaszprzybycien6545 4 роки тому

      @@AxleWebTechnologies We are also using a SIP called Voximplant to call the voicebot from a cellphone to order pizza from a restaurant (college project)

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      @@jonaszprzybycien6545 Please watch our another video on how to integrate Dialogflow with Voximplant.

  • @suvakantamohapatra2538
    @suvakantamohapatra2538 4 роки тому

    i am unable to open the control panel in hostgater .please help me

  • @choirulsatriyo4484
    @choirulsatriyo4484 4 роки тому

    hi anshul can you help me, i tried the tutorial you gave and got an error "unhandle rejection" and "Cannot read property 'map' of undefined at queryDatabase.then.result", can you check my code that will be sent via email thank you, sorry my english is bad

    • @choirulsatriyo4484
      @choirulsatriyo4484 4 роки тому

      hey anshul (@axle) I have sent you an email, please check it. Thank you

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Hello Choirul, I have replied to your email. Looks like your database is not remotely accessible. Please check this link to enable remote access: www.hostgator.com/help/article/how-to-connect-to-the-mysql-database-remotely

  • @alaukiktandlekar114
    @alaukiktandlekar114 4 роки тому

    { Error: connect ETIMEDOUT at Connection._handleConnectTimeout I am facing this error please help me out sir
    and another error is undefined i don't know what it is?

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      Solution found:
      use socketPath instead of host like this
      socketPath : '/cloudsql/[instance-connection-name]'
      socketPath: '/cloudsql/charbot2-ivjagp:asia-south1:auction-instance',
      user : '',
      password : '',
      database : 'db'

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      Note : solution for google cloud mysql users only

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому +1

      Glad you found a solution.

    • @kirandeepmarala5541
      @kirandeepmarala5541 4 роки тому

      @@AxleWebTechnologies but for hostinger mysql database ,how to solve that problem

    • @devantryxdev569
      @devantryxdev569 4 роки тому

      @@AxleWebTechnologies
      hello, I am using your github code, I am using GCP Mysql, I have access from the Mysql Workbench client and still I get as an "undefined" answer in the firebase console and in dialogflow diagnostic info I get Webhook call failed. Error: DEADLINE_EXCEEDED.
      Can someone help me with the problem?

  • @mercadopiso
    @mercadopiso 4 роки тому

    Hello bro, I need Google Cloud with Billing? I have my SQL but no billing in google cloud

    • @arnedevroede4311
      @arnedevroede4311 4 роки тому

      just set your billing account and you will receive a free trial for a year(with 300$ credits) and then 'buy' the Flame package in Firebase and it's OK!

    • @mercadopiso
      @mercadopiso 4 роки тому

      @@arnedevroede4311 Yeah bro but i dont have a card, i just have a prepaid and google cloud dont accept it:(

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Check with your bank, some bank provides virtual cards with some prepaid balance. Hopefully you can use such virtual card.

    • @hiiibay551
      @hiiibay551 4 роки тому

      @@AxleWebTechnologies but google cloud is not accepting virtual cards

  • @belingaestelle6078
    @belingaestelle6078 3 роки тому

    hi,
    I have the impression that my database does not communicate with dialogflow

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      Yes may need to enable remote access to your mysql database.

    • @belingaestelle6078
      @belingaestelle6078 3 роки тому

      @@AxleWebTechnologies
      already, I added my public ip address but still nothing

  • @srinivasamoorthy7289
    @srinivasamoorthy7289 4 роки тому

    Hi IAM getting error " webhook call failed : DEADLINE_EXCEEDED

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      You get this error when either API call in your webhook fails for some reason or if API call takes more than 5 seconds to respond

  • @devantryxdev569
    @devantryxdev569 4 роки тому

    I am getting this error : Webhook call failed. Error: DEADLINE_EXCEEDED.

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      This error means something went wrong in your webhook code

    • @devantryxdev569
      @devantryxdev569 4 роки тому

      @@AxleWebTechnologies hello, I am using your github code, I am using GCP Mysql, I have access from the Mysql Workbench client and still I get as an "undefined" answer in the firebase console .Can someone help me with the problem?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      @@devantryxdev569 Can you please share some code, need to have a look at the code to understand what might be the issue.

  • @TrictoYT
    @TrictoYT 4 роки тому +1

    I keep getting undefined as a response in my execution logs

    • @shekanyasetijo5695
      @shekanyasetijo5695 4 роки тому

      me too

    • @shekanyasetijo5695
      @shekanyasetijo5695 4 роки тому

      did you find a solution to this?

    • @TrictoYT
      @TrictoYT 4 роки тому

      Shekanya Setijo I had to host my database on a free hosting site

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Make sure you have enabled remote access. Try following steps in the following video. Try using %.%.%.% for remote IP.
      ua-cam.com/video/xXOq9U9fzOo/v-deo.html

  • @belingaestelle6078
    @belingaestelle6078 3 роки тому

    hello, my problem was not resolute

    • @AxleWebTechnologies
      @AxleWebTechnologies  3 роки тому

      Please drop an email to anshul.shrivastava@axlewebtech.com, we will have a look.

    • @belingaestelle6078
      @belingaestelle6078 3 роки тому

      @@AxleWebTechnologies the mail don't pass

  • @AxleWebTechnologies
    @AxleWebTechnologies  4 роки тому

    Hello Friends, our Udemy course is out now. Please check it out here:
    www.udemy.com/course/mastering-dialogflow-build-smart-chatbots-using-dialogflow/?referralCode=F2B97D95121392E3FFAE
    We just published this course and we will keep refreshing this course with the latest Dialogflow tutorials. Please subscribe to our Udemy course now.

  • @satpathyshubham
    @satpathyshubham 5 років тому

    Sir connecting to mongo DB will be better ... this was good but you know how NO-SQL is famous.

    • @AxleWebTechnologies
      @AxleWebTechnologies  5 років тому

      We have a video on Dynamo DB and Firebase Database. Please watch that on our channel.

  • @CarlosJobs
    @CarlosJobs 2 роки тому

    Hello, your video is very good, it helps me, in this code there is an example of data validation in mysql.
    Example: ReadMySQL query, when it doesn't find the request.
    if(user_cpf === user.cpf){
    agent.add(`First name: ${user.first_name}: Last name: ${user.last_name}`);
    }
    ELSE {USER NOT FINDER}

  • @anmolgarg_IT
    @anmolgarg_IT 4 роки тому

    Connection TimeOut Error { Error: connect ETIMEDOUT
    at Connection._handleConnectTimeout

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      I am also facing this error, please help me out if you will get the solution

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      Solution found:
      use socketPath instead of host like this
      socketPath : '/cloudsql/[instance-connection-name]'
      socketPath: '/cloudsql/charbot2-ivjagp:asia-south1:auction-instance',
      user : '',
      password : '',
      database : 'db'

    • @alaukiktandlekar114
      @alaukiktandlekar114 4 роки тому

      Note : Solution is only for google cloud mysql users only

  • @belingaestelle6078
    @belingaestelle6078 3 роки тому

    please help me

  • @RDBC379
    @RDBC379 4 роки тому

    starting this moment 16:15 my agent just response "Not available". I have the exactly same code that you have on github.

    • @AnshulShrivastavaOnline
      @AnshulShrivastavaOnline 4 роки тому

      Make sure you have enabled fulfillment option in your intent, make sure you have billing account enabled and also make sure the IP address from which you are accessing the database is whitelisted in database hosting.

    • @RDBC379
      @RDBC379 4 роки тому

      @@AnshulShrivastavaOnline Al ready checket it. when I comment out the lines 55, 56, 58 and 59 (Github). The agent respose again in the console. I can't find the problem. Sorry, my English isn't good.

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      Looks like something is wrong with Parameters. Please send an email to anshul.shrivastava@axlewebtech.com (or share your agent with this email address), I will have a look.

    • @RDBC379
      @RDBC379 4 роки тому

      @@AxleWebTechnologies I already shared it! I Thank you

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому

      @@RDBC379 I fixed it please check now.

  • @carloshenrimatos
    @carloshenrimatos 5 років тому

    Up

  • @luisrhenals6182
    @luisrhenals6182 3 роки тому

    Hi!...i have this error log:
    dialogflowFirebaseFulfillment
    Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail
    I see that yo have a FireBase configuration but you don`t explain this part. Can you help me with that? Thanks!

  • @rogerbolano5700
    @rogerbolano5700 4 роки тому

    I got this error when I deploy it "Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail". Can you help me?

    • @AxleWebTechnologies
      @AxleWebTechnologies  4 роки тому +1

      This is not an error but just a warning. You can ignore this. Ideally this should work for you. If this is not working, there might be some other error.

    • @RDBC379
      @RDBC379 4 роки тому

      @@AxleWebTechnologies I love your channel! Thanks a lot