How to retrieve and update data from database using Dialogflow chat bot - dialogflow-es

I am very new to api.ai(Dialogflow). In my scenario i have to create a chat bot who should be able to update customer information in the real time database by taking the input from customer.
I am not sure how to do this. By some research i understood either by writing code in firebase function it is possible or by writing webhook and deploying to server.
But i am not understanding how to write the code. Any one can give any suggestions or any reference so that i can start coding.
I tried to write by seeing the weather webhook but did not understand this.
Any help is appreciated.
Thanks

Related

How to make twitter bot track tweets from our followers?

I was making a twitter bot with Twit, I found making tutorials using T.stream('user')
to get stream data about our account, now its deprecated. So in 2021, how can i achieve these?
requirements:
Know when someone follows my bot, and make a thanks post.
Know when someone in my followers list or following list makes a tweet.
Also I have a doubt, when we use stream, old data is also coming, so how exactly stream works? if i only want latest tweets, I have to sent get by setting interval?
For the new followers, you will need to build something using the Account Activity API, which uses webhooks to send you event messages. You will need to filter for the follow events.
For new Tweets from people you are following, you will need to poll the home timeline endpoint. There’s no realtime method for this.

Azure Bot Creation with Natural Language understanding(LUIS)

I am facing issues while building a Voice bot using nodejs in Microsoft Azure, Currently i have made some research and built a sample chatbot which works fine using nodejs.
I have tried MS portals for voice bot integration and unable to take it forward, need guidance and suggestions.
My idea is getting a number from Twilio, then put my azure bot's end point URL in the twilio number.
Once my twilio gets an incoming call it will route the request to the Azure bot which will respond with a greeting and ask for few inputs, then the recorded voice should be passed to the LUIS app for Natural Language understanding and give the required text which will be further handled by the Azure bot.
I am not sure whether this is good solution, please suggest
I am not able to see any sample code for nodejs. Steps for integration and a basic sample code is what i need as a basic to start with, Your inputs/suggestions on this is highly appreciated.
Using the Bot Framework SDK for Node.js, you can specify text to be spoken by your bot on a speech-enabled channel in either of the following ways:
Set the IMessage.speak property and send the message using the session.send() method
Send the message using the session.say() method (passing parameters that specify display text, speech text, and options)
Send the message using a built-in prompt (specifying options speak and retrySpeak).
Feel free to review the following documentation provided and sample code for more details.
Update
Also check out Connect a bot to Twilio.

Firebase Messaging Push Notifications

hi guys I'm trying to add push notifications to my flutter app. I want them to be sent to specific users an hour before an event happens the time of the event will be stored in firebase by the user. I have been doing my research and I think need to write these conditions in a node.js file? I also want to send another notification if an entry is added which is pretty straight forward. However I only would want to send it to the users in the same area as the user who added the entry. In my flutter app I use geohashes and haversine to query firebase for the user in the same area would I need to do the same in the node.js file. I am having trouble finding some good examples if this correct please direct me to some better resources if not please help me better understand what I should be doing. Thank you
Your question's scope is wide but I will try to give you some kind of guideline for you to begin with.
First to set up an environment for firebase functions follow this, then there are different triggers for firebase functions like database write calls a function to be executed when new data is written to the database.
In your case when you add an event inside your trigger write some code to get the users near that area and send notifications, and to send the notifications you will need to get the token of every user when they login to your app and save it somewhere else.
For firebase functions, you need to know basic Javascript/TypeScript and for that, this video series of Doug Stevenson is very helpful. I recommend finishing the tutorial first.

Basic Concept of Chatbot using Wit.ai

I am trying to create a chatbot application where user can create their own bot like Botengine. After going through google I saw I need some NLP api to process user's query. As per wit.ai basic example I can set and get data. Now I am confused, How I am going to create a botengine?
So as far I understand the flow, Here is an example for pizza delivery:-
User will enter a welcome message i.e - Hi, Hello ...
Welcome reply will be saved by bot owner in my database.
User will enter some query, then I will hit wit.ai API to process that query. Example :- Users query is "What kind of pizza's available in your store" and wit.ai will respond with the details of intent "pizza_type"
Then I will search for the intent return by wit in my database.
So, is that the right flow to create a chatbot? Am I in the right direction? Could anyone give me some link or some example so I can go through it. I want to create this application using nodejs. I have also found some example in node-wit, but can't find how I will implement this.
Thanks
What you need is webhook. You need to call different API's based on the user intent. I believe you can distinguish between different intents using parameters available in request. Check this out - Creating nodejs webhook for dialogflow

How long does Twilio store chat history?

I've been browsing Twilio's docs and API reference but I was unable to find how long does the chat history is stored.
I don't have any own DB for storing messages as well as I don't have any other logic on my backend related to chat. I'm using Twilio to handle everything for me. I'm only using their client SDKs to interact.
Can anyone help me with that. Thanks in advance.
Twilio developer evangelist here.
My apologies for the delay from support getting back to you, but the good news is I have an answer for you.
At Twilio we store everything forever until you either:
Close your account
Delete the messages or channels yourself
Delete the entire service instance
So not fetching that from a database is the right choice in my opinion as it would potentially just add extra latency and logic into your code.
Hope this help yoiu.

Resources