Тёмный

Dialogflow Tutorials: Integrate Dialogflow Chatbot with Database 

AxleWeb Technologies
Подписаться 6 тыс.
Просмотров 61 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 303   
@arjunkv8919
@arjunkv8919 5 лет назад
How we can read multiple child from database
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Suppose there are multiple child, in that case, the data structure will change slightly. It will be something like this: data |_ 1 |_ first_name: Rahul |_ last_name: Sharma |_2 |_first_name: XYZ |_last_name: ABC You need something unique like ID (Here I used 1, 2 etc but you can use username, email or anything which is unique) to uniquely identify a record. Then the code to write into the database should be something like: return admin.database().ref("data").child(ID).set({ first_name: res.data.first_name, last_name: res.data.last_name }); Where ID can be 1, 2, 3.. and so on.... And code to read from database should be something like: return admin.database().ref("data").once("value").then((snapshot) => { const value = snapshot.child(ID).val(); const first_name = value.first_name; }
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
You can also refer to below documentation: firebase.google.com/docs/database/admin/save-data
@aswinsdeep3524
@aswinsdeep3524 5 лет назад
@@AxleWebTechnologiesthanks buddy
@sivakarthick2924
@sivakarthick2924 5 лет назад
@@AxleWebTechnologies Thanks man! I was stuck in this part for a while. Your video helped me a lot. Can you please post a video on how to access Firebase cloud functions using fulfilment. I have a JSON file in the Cloud function but I'm not able to access it in Dialogflow. Please help me with this.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
@@sivakarthick2924 Glad you find it useful. Will create a video on accessing Firebase cloud functions soon. Please subscribe and press the bell icon to get the updates.
@sanjanagupta3860
@sanjanagupta3860 Год назад
My code has been successfully deployed in cloud bhut changes are not visible in real-time database...
@mayankparikh4335
@mayankparikh4335 5 лет назад
Hi ..it's comming snapshot and value not defined..in the fullfilment can u help me out regarding this
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Probably something wrong with the format in which you are storing your data in firebase. Have a look here: stackoverflow.com/questions/43196547/firebase-unable-to-access-data-with-snapshot
@harshshah2675
@harshshah2675 4 года назад
Thank you very much Sir for posting this, but when I click on enable inline editor in fulfillments it asks to manage billing and a billing account. whereas in this video you weren't asked to enable billing? Have you already enabled billing and does it charge when we connect it to firebase?
@hapuertam91
@hapuertam91 4 года назад
Thanks for sharing, can u help me on how to add more records in DB instead of replace the only one existing? thanks in advance
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please have a look at the pinned comment. Hopefully, that will help.
@raghavsharma8512
@raghavsharma8512 5 лет назад
nice job done by u sir.....
@kamalpreetcheema9113
@kamalpreetcheema9113 4 года назад
hi, I have developed the chatbot in dialogflow (which is for diabetes patients), so now I need to save data. so for that should I need to write the same code as you wrote. plsss replyyyy
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Hi Kamalpreet, you dont need to write the same code. The code you will write depends on what you want to achieve. If you need any help, please drop me an email at anshul.shrivastava@axlewebtech.com
@laxmanawate5706
@laxmanawate5706 5 лет назад
function readdb(agent) { const mobileno=agent.parameters.text; return admin.database().ref('data').transaction((data) => { const mobileno=agent.parameters.text; let mob=data.mobile; let bal=data.balance; if(mobileno==mob) { agent.add(`Your account balance is`+bal); } else { agent.add(`not register`); } return data; } ); Firebase DB data is parent child is mobile no & balance now in that i have multiple mobile no and each no have different balance then how it work?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
I have replied to other similar comment. Please have a look at that one.
@anubhav1603
@anubhav1603 5 лет назад
How to add image in database
@davidmurati9403
@davidmurati9403 5 лет назад
Buenos dias, disculpe la molestia tengo un error que dice: "Webhook call failed. Error: Request timeout" esto sucede cuando trato de leer los datos. Algguien seria tan amable de ayudarme y decirme que hago mal.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Please check firebase console logs and see if there is any error?
@davidmurati9403
@davidmurati9403 5 лет назад
@@AxleWebTechnologies Ya los verifique muchisimas gracias!!! ya se conecto. de verdad gracias por tener la amabilidad de contestarme.
@ritikmehta9684
@ritikmehta9684 4 года назад
Hey I like your videos alot... Hello Sir I need your help regarding the chatbot project. Actually, in my project, I need different chatbot screens for the different users so that one user cannot see the other user messages and ita very difficult to me please help Please reply...! Thank you
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
You can implement OTP based login in your chatbot and then show the message only related to that particular user.
@everybot-it
@everybot-it 4 года назад
This doesn't seem to work in some cases. Particularly, when some credentials have been set and the ApplicationDefault isn't working.
@zahidkhan-ln3jv
@zahidkhan-ln3jv 4 года назад
What if I want to store multiple orders of a restaurant?how can I do that as this only gives the most recent value
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please have a look at the pinned comment.
@joseossesplaza4007
@joseossesplaza4007 4 года назад
i follow of the steps and i dont read my firebase :c, maybe exist other method for fix my mistake ?
@renielmallari3236
@renielmallari3236 4 года назад
Hi sir why am i getting a Webhook call failed. Error: DEADLINE_EXCEEDED. in reading the data from the firebase? i can already save the data but when i am trying to retrieve it there is that error. i followed you code and the error is still the same. can you help me sir function HandleReadFromDB(agent){ return admin.database().ref('data').once('value').then((snapshot)=>{ const value = snapshot.child('text').val(); if(value !== null){ agent.add(`The value from the database is ${value}`); } });
@muhamedkozic9440
@muhamedkozic9440 Год назад
I follow all steps, but in the end it is not working. When i write something to save to DB, the text parametar is not chaning in the firebase DB. It stay "ABCD". Do you have any solutions?
@waelbnd3536
@waelbnd3536 3 года назад
thank u for all ur videoes, but u alway use the Inline Editor in fulfilment and it's not free, plz try other free solutions and thaks again
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
Please watch our latest videos on Dialogflow and Integromat, That solution is completely free and does not require inline editor.
@waelbnd3536
@waelbnd3536 3 года назад
@@AxleWebTechnologies thanks
@abdelrahmanmustafa2955
@abdelrahmanmustafa2955 2 года назад
thank you so much for your tutorial, is it available to link DF CX with firebase to read and write like exactly DF ES
@rodcastillo2578
@rodcastillo2578 Год назад
Thank you!! I wish your next video is bigquery to dialogflow
@tonyaube7813
@tonyaube7813 5 лет назад
Deployment isn't working at 19:16. It says Snapshot and Value aren't defined and that Snapshot is missing a ): 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: /srv/index.js:41 return admin.database().ref('data').once('value').then((snapshot) ^ SyntaxError: missing ) after argument list function handleReadFromDB(agent){ return admin.database().ref('data').once('value').then((snapshot) const value = snapshot.child('text').val(); if(value !== null){ agent.add(`the value from database is ${value}`); } });
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
After snapshot you need to add =>
@tonyaube7813
@tonyaube7813 5 лет назад
@@AxleWebTechnologies Oh my god I saw it it was there for only 2-3 seconds I must have blinked my eyes. Can't believe I spent a day trying to troubleshoot this. Thanks for taking the time to reply to the email I really appreciate this!
@balloonscheduler4376
@balloonscheduler4376 3 года назад
function handleReadFromDB(agent){ //return admin.database().ref('data').once('value').then((snapshot) return admin.database().ref('data').once('value').then( snapshot => { const value = snapshot.child('text').val(); if(value != null){ agent.add(`The value from database is ${value}`); } }); }
@hemantsahu4757
@hemantsahu4757 2 года назад
Could you please tell me whether I can store the conversation done from chatbot by every user in the database to have a track on what all queries is being asked from the users. Please let me know!
@vikaskanchan6516
@vikaskanchan6516 6 месяцев назад
Can we connect Dialogflow to another database like Mongo DB etc..?
@saikirandas5461
@saikirandas5461 4 года назад
Is it possible to store documents.. Then How to store the documents in data base
@letsgoo5176
@letsgoo5176 3 года назад
excellent ... may i know can we develop multi language understandable bots though dialog flow ? English/Arabic
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
please drop an email to anshul.shrivastava@axlewebtech.com, we can discuss your requirements.
@Rickedydoo
@Rickedydoo 3 года назад
Why cant my bot read from database? It just says "not available" under default response after typing 'Read from Database' ;-;
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
There could be various reasons for this. Please drop an email to anshul.shrivastava@axlewebtech.com with some logs and screenshots. will have a look.
@praveenverma5079
@praveenverma5079 4 года назад
Hi Sir, When i push the data in firebase my data looks like this: Now i am trying to read the 'Price' data based on disease reference and Test name. From last 4-5 hrs , I am trying but its not happening. Could you please help us.It will be very grateful :) Data | |--Diabetes | |----UniqueIdGenerated when i push the data from dialoag flow | | |--Price:100 | | |--Test:'Diabetes Test' | | | |----UniqueIdGenerated when i push the data from dialoag flow | | |--Price:103 | | |--Test:'Sugar Level' | |--Heart Disorder | |----UniqueIdGenerated when i push the data from dialoag flow | |--Price:340 | |--Test:'VITAL CARE HEART' | | |----UniqueIdGenerated when i push the data from dialoag flow |--Price:402 |--Tets:'HEALTH HEART SCREEN' /*Read Function function handleReadFromDB(agent) { if(agent.prameter.Test==='VITAL CARE DIABETES'){ return admin.database().ref('Data/Diabetes').once('value').then((snapshot)=>{ const value = snapshot.child('Price').val(); if (value!==null) { agent.add(`The value is from database is ${value}`); } });}} let intentMap = new Map(); intentMap.set('Default Welcome Intent', welcome); intentMap.set('Default Fallback Intent', fallback); intentMap.set('savetodb', handleSaveToDB); intentMap.set('readfromdb', handleReadFromDB); agent.handleRequest(intentMap); }); */ /*Push function*/ function handleSaveToDB(agent){ //const TEXT = agent.parameters.TEXT; const Disorder = agent.parameters.Disorder; const Test = agent.parameters.Test; // const AGE = agent.parameters.AGE; const Price=agent.parameters.Price; // if(Disorder==='Diabetes'){ admin.database().ref('Data/'+Disorder).push({ //Disorder:Disorder, Test: Test, //AGE: '23', Price: Price });
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Try removing if condition and see if it works ie. this line if(agent.prameter.Test==='VITAL CARE DIABETES') { } if it still doesn't work, please drop me an email at anshul.shrivastava@axlewebtech.com ~Anshul
@tdoug1929
@tdoug1929 2 года назад
I receive this warning which I suspect is why I cannot access the database:"Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail",
@AxleWebTechnologies
@AxleWebTechnologies 2 года назад
It is common warning. You can ignore it.
@harshshah2675
@harshshah2675 4 года назад
Hello Anshul Sir, Can I connect chatbot to firebase database without enabling billing? If yes then can you tell how to do it
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes, you can do that by using Custom Webhook option (Fulfillment > Webhook) However, you need to keep in mind that you have to setup your own web server which can accept POST requests in order to get this working.
@asiskumarroy4470
@asiskumarroy4470 4 года назад
I have been getting this error for the last 20 days and could not solve it.Please Please Please can u tell me how to deal with it.This is really important as my entire project is based on this. When I click on the deploy button it shows an error"Error happened during Cloud Functions Deployment"..Please let me know how to debug it.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
It looks like you don't have permission for deployment. Please make sure you are the owner of the Google cloud project. If you are not, make sure you get owner permission from whoever is the owner of the project. Feel free to comment if you still see the issue.
@frankramirez4214
@frankramirez4214 3 года назад
Hello I hope you can help me ... I have the code as you wrote it and it worked very well but a few weeks ago I stopped writing my dialogflow in my firebasedb ... I did not change anything in the code or anything in the chatbot ... why will it be that no longer saves the data? first of all, Thanks
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
Have a look at Firebase database rules. Generally firebase rules are configured for allowing read write for 1 month from the initial setup date.
@pogrammerinthehouse8643
@pogrammerinthehouse8643 4 года назад
just came across this video,had subscribed already
@jpesmar
@jpesmar 5 лет назад
You deserve way way more subscribers. I've already told all my coworkers about your videos. Amazing stuff you have here. Thanks!
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Thank you so much for such a wonderful comment. Will try to keep adding more videos on chatbots frequently.
@shafmairaj6493
@shafmairaj6493 5 лет назад
I need help to solve this error, whenever i try to deploy it gives me this error.. 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: TypeError: Cannot read property 'app' of undefined at Object. (/srv/index.js:8:18) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at getUserFunction (/worker/worker.js:439:24) at loadUserCode (/worker/worker.js:495:18)
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
It looks like there is a syntax error. Please check your code (Line number 8)
@venkatabhilash4325
@venkatabhilash4325 4 года назад
I am retrieving json data according to my need from firebase. I am now facing problem on how to represent this array of data in the agent response. Can you suggest me any reading material or help with the code. Thanks in advance
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please try checking firebase documentation.
@FelipeMarquardt
@FelipeMarquardt 5 лет назад
Thank you very much for this tutorial! I´d like to ask: is it possible to save the sessionId on Firebase?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
yes definitely, sessionId depends on which platform you are using for e.g. facebook, slack etc. Check the response format for corresponding platform and then save it in firebase database.
@hhbounce
@hhbounce 4 года назад
@@AxleWebTechnologies is it possible to have an example?
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please email me at anshul.shrivastava@axlewebtech.com. will send you over email
@BenRunciman
@BenRunciman 5 лет назад
Hi, Thank you for this video tutorial! I'm just wanting to connect my Dialogflow Bot to a database of information about films. I want the user to be able to ask. Is Ant-man covered by my film license? and for the bot to respond Yes or No. I have a csv file with the data. What do you think would be the best way to do this?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Please contact me on Fiverr. fiverr.com/anshul0305
@nihalbuyukotcu6591
@nihalbuyukotcu6591 3 года назад
Thanks for sharing ! If I want to do this can i try it for free ? Can i open my dialogflow project in firebase with no pay ?
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
Yes, you can
@dungha6285
@dungha6285 5 лет назад
Hi bro, i did what you did before but the console log is Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail? How do i solve this bro?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
I believe you can ignore that warning. Please see if it is working or not.
@dungha6285
@dungha6285 5 лет назад
@@AxleWebTechnologies It is not working with my firebase database bro?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Try to select the Firebase blaze plan and see if that works. If still not, email me and will try to help you via screen sharing.
@raddyjtc1440
@raddyjtc1440 5 лет назад
Thanks! It worked well. However, this will not work if i deploy using node.
@hamademic
@hamademic 5 лет назад
@Axle Web Technologies Please Help
@stefanostanich2245
@stefanostanich2245 4 года назад
Thank you for video, it works fine. I need to read from firebase not only text, but other fileds to display Rich Response such as Basic Cards, Suggestion chips and simple response (Google Assistant integration). Do you have some codes or suggestions? Thank you so much!
@harshshah2675
@harshshah2675 4 года назад
Hello Anshul sir thanks a lot for your response I tried deploying a cloud function through inline editor but getting this error: Permission 'cloudfunctions.functions.setIamPolicy' denied on resource 'my-cloud-function-path' (or resource may not exist). Can you please assist or let me know what level of permission did u have while deploying this
@rohannayak5971
@rohannayak5971 4 года назад
I wanted to create a cart and store products. So how can I add multiple data in a same child.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please check the pinned comment
@walney2008
@walney2008 4 года назад
ola como faço para insert,delete and search ? existe use banco MySQL ? exemple, tnhks
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please watch these videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-v7k5vckSzNo.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-l01VaCy3ujM.html
@raghvendrakushwah753
@raghvendrakushwah753 5 лет назад
code of function readfromDB is not working. I guess some part of code is hidden. Can you pls post the code of that function in reply to this comment?
@rma1563
@rma1563 4 года назад
Someone please help. I Followed everything as it is. Data from some intents gets stored perfectly, but for some it does not get stored. Why? I have enable webhook call and the code is exactly same :(
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Are you seeing any errors in the console logs? Please share some code
@rma1563
@rma1563 4 года назад
@@AxleWebTechnologies can't paste all here. so here is a section. As you can see the function for name and age as exactly the same. but age is getting stored, but name isn't. 'x' is variable to store a unique ID so each users data will store under the separate parent node function namefn(agent) { const NameObj=agent.parameters.NameNew; admin.database().ref('USER'+x).update({ Name:NameObj }); } function age(agent) { const agee=agent.parameters.age; admin.database().ref('USER'+x).update({ age:agee }); } let intentMap = new Map(); intentMap.set('name',namefn); //not working intentMap.set('age',age); intentMap.set('email',email); intentMap.set('mobile number',mobile_number); intentMap.set('zip code',zip_code); intentMap.set('qualification',qualification); intentMap.set('languages',languages); intentMap.set('partTimeFullTime',partOrFull); //not working intentMap.set('job title',job_title); intentMap.set('experience',experience); intentMap.set('current salary',current_salary); intentMap.set('notice - period',noticeperiod); intentMap.set('Desiredsalary',Desired_salary); //not working intentMap.set('password',password); // I don't see a problem in console logs either :/ . As said earlier webhook is enabled for all intents and the parameter names also match. thanks
@renielmallari3236
@renielmallari3236 4 года назад
hi sir. how can i save the whole conversation of each user in the firebase?
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
For that you need to use Dialogflow Webhooks and APIs.
@oumaymameddeb2311
@oumaymameddeb2311 4 года назад
hi, i want to build a bot using alexa skill, dialogflow and firebase (with nodejs).Can you help me please !
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Sure We can help you. Please send your detailed requirements to anshul.shrivastava@axlewebtech.com
@oumaymameddeb2311
@oumaymameddeb2311 4 года назад
@@AxleWebTechnologies done !!! Thanks for your quick response
@venus3119
@venus3119 2 года назад
is it the same way with Mongodb? thanks!!
@AxleWebTechnologies
@AxleWebTechnologies 2 года назад
No,for mongodb we need to create an api.
@NithishKumar-uo7oz
@NithishKumar-uo7oz 4 года назад
how can we retrieve data from database (that was updated by agent data) into react native app
@ratulpahwa7220
@ratulpahwa7220 4 года назад
Will the data stay in the database once the session ends
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
yes absolutely
@adisimanjuntak1283
@adisimanjuntak1283 4 года назад
Hy there, i have seen your video. I have problem nowdays dialogflow use Api V 2.0, how i solve this problem, i check in raw api response this "message": "Webhook call failed. Error: DEADLINE_EXCEEDED."
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
This is due to webhook taking more than 5 seconds to respond. Please don't perform heavy operations on webhook which might take more than 5 seconds to respond.
@alanreyes6637
@alanreyes6637 5 лет назад
Muchas gracias, estuve buscando esto por la red durante varios días y no entendía nada hasta que acabo de ver tu vídeo. Ya me suscribo a tu canal y de nuevo gracias!
@chatbot3098
@chatbot3098 5 лет назад
why this error appears in firebase : Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Please do a Google search for this error. There are several fix to this issue.
@singhprakash194
@singhprakash194 4 года назад
I want to call external Rest Api(cloud application along with the Body ,Custom Header,Authentication) and want to get response in the chat from dialogflow ,any leads on it will be appreciated.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes, you can do that using axios library. Following link might help you: stackoverflow.com/questions/44617825/passing-headers-with-axios-post-request PS: Make sure to Enable billing account otherwise Dialogflow can't connect to external network.
@jjoshua95
@jjoshua95 4 года назад
Thanks for sharing the video. It is really useful .Although i followed the same steps , there are no errors but my values are NULL. I am not sure what is causing the problem.Please help me out .dialogflow.cloud.google.com/#/agent/avg-project-ombxgx/
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
It is difficult to tell the error without seeing the code. There are couple of things you can check 1. Make sure billing account is enabled 2. Make sure fulfillment is enabled in the intent 3. Make sure you can see some logs in the console.logs.
@tonyaube7813
@tonyaube7813 5 лет назад
Hey Anshul, at 13:11 I accidentally pressed the "Add" button and my "data-first_name" disappeared. Did I save this in the database? Could that cause problem down the line?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Yes that should be saved in database and you should be able to see it.
@MikeCairns1
@MikeCairns1 4 года назад
Did you publish your code for the fulfillment somewhere? I can't get my code to work and I know that there is a simple syntax that I missed. I got the write to work fine, but I can't get reading to work properly.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes here it is: Connect Dialogflow with MySQL gist.github.com/Anshul0305/aace32e8eabcb2ef49835d0079091e00 Connect Dialogflow with Spreadsheets gist.github.com/Anshul0305/0af703a063f51ca00213add2634cd88b Connect Dialogflow with External APIs gist.github.com/Anshul0305/405e050cf438975baec8a746ffda9991
@davidebelleri8992
@davidebelleri8992 4 года назад
Hey man, awesome tutorial! My database is bit complex, how can I read data "Nome" from this database? Every "Nome" there: prnt.sc/r457b9
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
You need to use Object.keys() method stackoverflow.com/questions/8763125/get-array-of-objects-keys
@virgilpillay
@virgilpillay 3 года назад
Is it possible to do this with google sheets?
@AxleWebTechnologies
@AxleWebTechnologies 3 года назад
Yes. Please checkout our other videos on how to integrate Dialogflow with Google sheets
@jonaszprzybycien6545
@jonaszprzybycien6545 4 года назад
5:12 I'm a little confused. Are the training phases the same regardless of how the database is used? Asking because we have an project at our college about creating a voicebot for a restaurant. We want it to work so that people can order pizzas without calling real people.
@AnshulShrivastavaOnline
@AnshulShrivastavaOnline 4 года назад
The training phrases are used to trigger an intent. Please contact me at anshul.shrivastava@axlewebtech.com if you any specific help.
@superAbtruse503
@superAbtruse503 4 года назад
I cant even enable the inline editor it shows this: Cloud Functions integration requires billing to be set up (more info on pricing and usage here: cloud.google.com/functions/pricing). Please go to Google Cloud Console to set up billing first.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes, you have to setup billing account for that. Please watch our video on how to connect Dialogflow with external APIs. In that we have explained how to enable billing account.
@asiskumarroy4470
@asiskumarroy4470 4 года назад
Error:Error happened during Cloud Functions Deployment. This error occurs when I click on deploy button
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please see my reply on your previous comment ~Anshul
@harshitasahai5397
@harshitasahai5397 4 года назад
Hey! Will this work even if I have intents as a follow up? Because I tried this but it is not showing the changes though getting deployed without any error
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes this should work. Make sure to enable fulfillment in your follow up intents, also in your code, make sure to write the correct code for the intent map.
@chinmaymunje9279
@chinmaymunje9279 5 лет назад
How we can build a Chatbot like Google home for only one category and fetch Realtime data from database. Also please make video on how to deploy this Chatbot in android studio.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
You can use Dialogflow for building Google home chatbot. They call it actions on Google. Visit developers.google.com/actions/ for more details. Android studio is for building apps for Android OS. I would recommend using Visual Studio Code for chatbot coding.
@rushj5227
@rushj5227 5 лет назад
Thanks for a great tutorial, I want to build an bot which asks users their Id and some 10-20 questions and then it should be saved in fire base with their mail -ids and answers can you please help? @Axle Web Technologies
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Yes, I can definitely help you with that. Please mail me the details on anshul.shrivastava@axlewebtech.com or visit us at axlewebtech.com
@nunongsantiago7795
@nunongsantiago7795 4 года назад
I had I few errors. Could you please share the code?
@kayderl
@kayderl 4 года назад
What if I have a second or 3rd degree nested data, are you able to assist on that? Example: data |_ 1 |_ name |_first_name: abc |_last_name: xyz How do I read and write these? Thanks.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please see the pinned comment. Hope that will help.
@MohamedSaad-hc3ol
@MohamedSaad-hc3ol 4 года назад
please help me in this , i want make agent help user to create his CV so i want the agent ask the user some Questions and save his answers in data base , but there is a problem in this agent we want ask him about his skill for Example so as this "Do you have skills want to add it ?" and if the answer of the user is yes ask him "what is your skill name ?" and if his answer is no ask him about different section such as "Do you want to add any studies for you ?" and make the same operation but aslo if he enter the name of skill for example we must ask him if he want to add anther skill or no as this "do you have anther skill want to add ?" please help me this is sooo important for me sir
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Please send me an email at anshul.shrivastava@axlewebtech.com
@philiplartey19
@philiplartey19 5 лет назад
Why does the data get overwritten all the time. I need to use this approach but need to find a way to store data from multiple users without overwriting them. Please help
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Please see my pinned comment for details.
@aswinsdeep3524
@aswinsdeep3524 5 лет назад
how we can store information of many number of people in firebase database? is there an option that, we can create automatically generating tree in firebase?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Hello, see my reply for following comment: "How we can read multiple child from database"
@what_to_watch_today
@what_to_watch_today 4 года назад
Hello, thanks for the video, why do you choose realtime database instead of cloud firestore ???
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
There is no specific reason. Both are great. In some projects we have used cloud firestore as well. The choice depends on your use case. Please refer to this link for more details: firebase.google.com/docs/database/rtdb-vs-firestore
@businesslegal2603
@businesslegal2603 5 лет назад
Dear Axle, thanks a lot for your video. I followed step by step your video but I got the following error. I rechecked and everything is equal to your video...Could you please advise? 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: TypeError: admin.initializeAPP is not a function at Object. (/user_code/index.js:8:7) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at getUserFunction (/var/tmp/worker/worker.js:435:24) at loadUserCode (/var/tmp/worker/worker.js:491:18)
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
It should be admin.initializeApp and not admin.initializeAPP (Lowercase pp in App). Hope that will fix the issue.
@businesslegal2603
@businesslegal2603 5 лет назад
@@AxleWebTechnologies Thnaks. It works perfect.
@ashishagru
@ashishagru 5 лет назад
Hi AxleWeb. Thank you very much for this excellent video. I followed your instructions. The SaveFromDB works very well, but the ReadFromDB gives the string The value from database is ${value} instead of converting text value in value. I have put them in backtick key. Also, I noticed that when my savetoDB command works, it stores information as "Hello World INSTEAD of "Hello World" in your example. Attached is my code. Can you help? 'use strict'; const functions = require('firebase-functions'); const admin = require('firebase-admin'); const {WebhookClient} = require('dialogflow-fulfillment'); const {Card, Suggestion} = require('dialogflow-fulfillment'); admin.initializeApp ({ credential: admin.credential.applicationDefault(), databaseURL: 'ws://dfdatabasedemo-xhpqqm.firebaseio.com/' }) ; 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 handleSaveToDB (agent) { const text = agent.parameters.text; return admin.database().ref('data').set({ first_name: 'Rahul', last_name: 'Sharma', text: text }); } function handleReadFromDB (agent) { return admin.database().ref('data').once('value').then((snapshot) => { const value = snapshot.child ('text').val(); if (value !== null) { agent.add('The value from database is ${value}'); } }); } let intentMap = new Map(); intentMap.set('Default Welcome Intent', welcome); intentMap.set('Default Fallback Intent', fallback); intentMap.set('SaveToDB', handleSaveToDB); intentMap.set('ReadFromDB', handleReadFromDB); agent.handleRequest(intentMap); });
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Hi Ashish, you need to use backtick in the below code agent.add('The value from database is ${value}'); so it should be something like this: agent.add(`The value from database is ${value}`);
@holdinvestors6935
@holdinvestors6935 4 года назад
hi, buddy, may I ask you a favor? I followed the vedio , Writing data feature is OK, but READ DATA feature has been wroten many time. hope you can introduce more knowledge about it.
@chinmaynema4506
@chinmaynema4506 5 лет назад
Hey how can I store multiple parameters in the database? For eg, I need to store the name and user id taken from a user.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Suppose there are multiple child, in that case, the data structure will change slightly. It will be something like this: data |_ 1 |_ first_name: Rahul |_ last_name: Sharma |_2 |_first_name: XYZ |_last_name: ABC You need something unique like ID (Here I used 1, 2 etc but you can use username, email or anything which is unique) to uniquely identify a record. Then the code to write into the database should be something like: return admin.database().ref("data").child(ID).set({ first_name: res.data.first_name, last_name: res.data.last_name }); Where ID can be 1, 2, 3.. and so on.... And code to read from database should be something like: return admin.database().ref("data").once("value").then((snapshot) => { const value = snapshot.child(ID).val(); const first_name = value.first_name; }
@ShuyaFay
@ShuyaFay 5 лет назад
Hi,I am having difficulties in saving the input data into database. The diagnostic info showed me 'Webhook call failed. Error: Request timeout'. Is there any solution for this?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Can you please show the code you have written to save the data?
@ShuyaFay
@ShuyaFay 5 лет назад
Sure, I copied to this pastebin. Have a look pastebin.com/G0APw2cZ
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Make sure you use backticks here ` agent.add('The value from database is ${value}'); It should be agent.add(`The value from database is ${value}`);
@ShuyaFay
@ShuyaFay 5 лет назад
@@AxleWebTechnologies I changed it but the problem still persists. This is the RAW API RESPONSE it gave me from Diagnostic Info: pastebin.com/8FKDZtpi
@jara_fly
@jara_fly 5 лет назад
you rock!
@saikirandas5461
@saikirandas5461 4 года назад
And then how to store the database in cloud
@jaceytan7116
@jaceytan7116 4 года назад
How can i implement this feature to my Android studio mobile app project ?
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
For that you need to use Dialogflow API. We will launch video tutorials on Dialogflow APIs soon. Please subscribe to our channel and press the bell icon to get the latest notifications.
@devpratap
@devpratap 5 лет назад
Hello sir ,your tutorials are great. Thanks for uploading them I wanted to know how to make a Chatbot which can place order on your behalf. E.g. Amazon . The bot should be able to search products, set quantity and direct you to payment directly.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
please contact me on Fiverr fiverr.com/anshul0305
@TechiesLab
@TechiesLab 4 года назад
Thanks for the vidoe and could you tell me how to connect dialogflow with aws redshift database
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
we haven't explored that yet, we will try to explore that and then will create a video tutorial on that.
@ashishajmani
@ashishajmani 5 лет назад
Thanks. great tutorial....I have written same code...but while ReadfromDB intent, it is not picking variable from db...instead is shows simple message -> The value from database is ${value} ......my code is as below: function handleReadfromDB(agent){ return admin.database().ref('data').once('value').then((snapshot) => { const value = snapshot.child('text').val(); if(value !== null) { agent.add('The value from database is ${value}') ; } }); } any guesses where I am doing wrong ?
@PenquinQQ
@PenquinQQ 5 лет назад
I got the same result as you.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Hi Ashish, you need to use backtick in the below code agent.add('The value from database is ${value}'); i.e. use ` instead of ' so it should be something like this: agent.add(`The value from database is ${value}`);
@mani5004
@mani5004 5 лет назад
can you please make a video on google home graph. ?
@fichafacil7936
@fichafacil7936 5 лет назад
Hi Alex!! When I want to capture new data of a person without knowing the name or other data and write it in the database the new data, how can I do it?
@shirishsonawane3807
@shirishsonawane3807 4 года назад
Thank you so much for your help and guidance. Please help me with the below queries . Appreciate any pointers from you :) queries ====== 1. can we give reference (vegetables in this case ) as input which is taken from user? (or does it need to be hardcoded ?) 2. how do i get value of parameter which is child of a child [in this case : input is patato -- i want to get soil_ph_value of patato ] 3. can we store image as a parameter here (patato pic for e.g)? structure in database : ================== vegetables patato growing_time soil_ph_value tamato growing_time soil_ph_value ================ Pseudocode : (not working) =================== const veg_input = agent.parameters.veg_input; agent.add(` veg input is :${veg_input}`); return admin.database().ref('vegetables').once('value').then((snapshot) => { const time_to_grow = snapshot.child('veg_input').child('grow_time').val(); agent.add(`your growingtime is :${time_to_grow}`); ===================== Please guide .. thanks
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Try this: const veg_from_db = snapshot.child(veg_input).val(); const time_to_grow = veg_from_db.growing_time
@shirishsonawane3807
@shirishsonawane3807 4 года назад
@@AxleWebTechnologies Thanks a lot for your help and guidance. It did work for me . :)
@frankramirez4214
@frankramirez4214 3 года назад
genial amigo , muchas gracias por el tutorial eres un maestro
@rosanasr
@rosanasr 5 лет назад
Hello, again! Do you have something on Yes and No answers? I searched but I couldn't find it. The problem I'm facing is that a lot of interactions have Yes and No flows, but the bot is mixing them. Or if I have same single words (even if they are in different entities and diferent intents) i gets mixed. I'm not sure if it is something in the contexts, the lifespam, the followup intent or any other issue. If the user answers with a simple yes or no, it gets mixed. If they say "yes I use paypal" it gets right. But in real use case I cannot demand a complete answer. Any tips? Thank you so much!
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Ok, here is what you can do. Let's say you have an intent "Use Paypal". When you ask a question, "Would you like to use Paypal", set an output context, "use-paypal" in that intent. Now create two more intents named "Use Paypal - Yes" and "Use Paypal - No" In "Use Paypal - Yes", input context should be "use-paypal" and training phrases should be "Yes, yeah" etc In "Use Paypal - No", input context should again be "use-paypal" but training phrases should be "No,nope" etc and then in both intents Use paypal - yes and no, you can write corresponding response in the response section. You can watch my video on contexts and follow up intents here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kIlZ8FgNVx0.html
@rosanasr
@rosanasr 5 лет назад
@@AxleWebTechnologies thank you, I'm still having trouble. Im going to answer in the context video so we don't mix up subjects here!
@sheebarizvi2330
@sheebarizvi2330 5 лет назад
Awesome!! This is so good😍😍😍🙏🙏🙏 So much in depth knowledge...Wow great!!!
@tinashegondwa
@tinashegondwa 4 года назад
Hi Axle, thanks for the tutorial, really helpful and educational. Is there a way to connect a Dialogflow Agent to an Oracle Database. If so may you please share how it can be done. Thanks
@AnshulShrivastavaOnline
@AnshulShrivastavaOnline 4 года назад
At the moment I am not sure about Oracle database, but will try to explore this and create a video
@tinashegondwa
@tinashegondwa 4 года назад
@@AnshulShrivastavaOnline Thanks so much. In anticipation
@rosanasr
@rosanasr 5 лет назад
Hey!! Tks so much for this video! I managed to go to the point of writing the first parameter in the database. But when I set the second one, the first one is erased from the database. (the first parameter turns red in firebase and the last one turns green) This is the code: function handleCompanyName(agent){ const text = agent.parameters.companyname; return admin.database().ref('data').set({ companyname: text }); } function handleAccountingType(agent){ const text = agent.parameters.accountingtype; return admin.database().ref('data').set({ accountingtype: text }); } let intentMap = new Map(); intentMap.set('welcome', welcome); intentMap.set('Default Fallback Intent', fallback); intentMap.set('company.name', handleCompanyName); intentMap.set('accounting.type', handleAccountingType); agent.handleRequest(intentMap); }); I'll have to do this for around 30 parameters, so I'm kind of lost on how to follow as is not working from the second one. The second question is that for some other intents I have up to 5 different parameters. For example, I have an Onboarding preferences intent, and I ask for datastart (using @sys.date) and financialswhen (using one entity I created called @financials-when). As they are all under one Intent I couldn't understand how to write this code. Thanks in advance for your help!
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Hello Rosana, Please see my pinned comment. You need to use ref("data").child(ID).set() Where ID is a unique ID of each entry in the database. Feel free to comment back if you still have any questions.
@rosanasr
@rosanasr 5 лет назад
@@AxleWebTechnologies yes, is working. Now the code is like: function saveCompanyName(agent){ const companyname = agent.parameters.companyname; return admin.database().ref('data').child('company name').set({ companyname: companyname }); } And the database is like: data accounting type accountingtype: "Quarterly" company name companyname: "Apple" :) I'm not sure if for the ID is better to use a number or a name as I'm doing now. But I can change later on if necessary. Now I'll try the multiple entries from one intent and let you know if successful or if I have more questions. Thanks a lot!
@rosanasr
@rosanasr 5 лет назад
@@AxleWebTechnologies Also done with more than one parameter from a unique Intent. Code that worked: function saveStartandOnboardingDate(agent){ const datastart = agent.parameters.datastart; const financialswhen = agent.parameters.financialswhen; return admin.database().ref('data').child('start and onboarding').set({ datastart: datastart, financialswhen: financialswhen }); } Thaaaanks!
@shonephuxuantran186
@shonephuxuantran186 4 года назад
why we have to change the https to ws?
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
We stands for websocket. We need to use web socket protocol here
@shonephuxuantran186
@shonephuxuantran186 4 года назад
@@AxleWebTechnologies Do you know how dialogflow handle when the input is broken into multiple entries ? e.g: I am happy today
@atineshs
@atineshs 5 лет назад
Thanks for the efforts, I wanted to know if we can connect Dialoglow with PostgreSQL database
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
Yes we can connect Dialogflow with PostgreSQL, MySQL, MariaDB etc. I will create a video on this topic soon. Please subscribe and press the bell icon to get the latest updates.
@ashishlal1996
@ashishlal1996 5 лет назад
Sir thankyou so much... I learned a lot from you I wanted to build a chatbot which queries the database for that i need help from you can you provide your email for contact
@devpratap
@devpratap 5 лет назад
Did you find anything?
@jayhu6075
@jayhu6075 4 года назад
What a great explanation. Hopely more in 2020? Many thanks.
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Yes definitely. Please subscribe to stay updated with latest videos.
@farazfaraz6220
@farazfaraz6220 5 лет назад
how can we connect dialogflow with sql server database?
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
You can create an API using express which is connected to MySQL or sql sever and then you can connect Dialogflow with your APIs. You can watch my other video on how to integrate Dialogflow with external APIs
@bjsmk5932
@bjsmk5932 5 лет назад
hi @Axle Web Technologies! i already have integrated my dialog flow with firebase database but the problem is that the values in my child nodes updates itself automatically with the values that i had stored previously.
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
I believe you want to store multiple values, for that please see the Pinned comment above (or below), I have explained there, how to store multiple values in the database.
@bjsmk5932
@bjsmk5932 5 лет назад
@@AxleWebTechnologies okay thanks will get back to you shortly
@bjsmk5932
@bjsmk5932 5 лет назад
@@AxleWebTechnologies thank you for your prompt response, completed the integration successfully
@deepakjain5169
@deepakjain5169 5 лет назад
Very helpful video. Actually, I'm looking to create a database layer where I save all the keywords, conversation, etc that's happening in dialogflow in the database and use it further
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
That's great. Are you facing any issues?
@dialogstack754
@dialogstack754 5 лет назад
@@AxleWebTechnologies Can you explain me how should I do that ?
@vinitkothari8502
@vinitkothari8502 5 лет назад
code for read doesn't work , please request you to post the code
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
const functions = require('firebase-functions'); const admin = require('firebase-admin'); const {WebhookClient} = require('dialogflow-fulfillment'); admin.initializeApp({ credential: admin.credential.applicationDefault(), databaseURL: 'ws://DATABASE_UNIQUE_ID.firebaseio.com/' }); exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { const agent = new WebhookClient({request, response}); function saveHandler(agent){ const text = agent.parameters.PARAMETER_NAME; return admin.database().ref(DATABASE_REFERENCE).transaction((DATABASE_REFERENCE) => { if(DATABASE_REFERENCE !== null){ DATABASE_REFERENCE.KEY = text; agent.add(`value ${text} is saved in db`); } return test; }, function(error, success){ console.log(success); }); } function fetchHandler(agent){ return admin.database().ref(DATABASE_REFERENCE).once("value").then((snapshot) => { const value = snapshot.child("KEY").val(); agent.add(`The value from DB is ${value}`); }); } let intentMap = new Map(); intentMap.set('SaveToDB', saveHandler); intentMap.set('FetchFromDB', fetchHandler); agent.handleRequest(intentMap); });
@MohammadHaryono
@MohammadHaryono 5 лет назад
how to reset context when i want to cancel to write to DB ?? thakns
@AxleWebTechnologies
@AxleWebTechnologies 5 лет назад
You can write agent.context.delete('context-name')
@hiphopsmiti
@hiphopsmiti 4 года назад
hi , i ve watched all your videos ! you helped me a lot but one thing is missing and don't get it , i want my chatbot in arabic language and i couldn't add translation to dialogflow , please help me ! thank you so much
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
Arabic is currently not supported in Dialogflow. Hopefully they will add it soon.
@hiphopsmiti
@hiphopsmiti 4 года назад
@@AxleWebTechnologies can i add translation ? And how ?
@AxleWebTechnologies
@AxleWebTechnologies 4 года назад
@@hiphopsmiti Please refer to this documentation cloud.google.com/dialogflow/docs/agents-multilingual
@garotospunkrock
@garotospunkrock 4 года назад
Cara !!! tu é muito muito muito bom !!! :) Me ajudou muito !!! Metodologia nota 10 !!!
Далее
DAXSHAT!!! Avaz Oxun sahnada yeg'lab yubordi
10:46
Просмотров 334 тыс.
Это нужно попробовать
00:42
Просмотров 368 тыс.
"Когти льва" Анатолий МАЛЕЦ
53:01
Don't Use ChatGPT Until You Watch This Video
13:40
Просмотров 1,7 млн
DAXSHAT!!! Avaz Oxun sahnada yeg'lab yubordi
10:46
Просмотров 334 тыс.