Cloudkibo / ChatBot

AI Chat Bot
0 stars 1 forks source link

Prebuilt Bots on API.AI #14

Open sojharo opened 7 years ago

sojharo commented 7 years ago

Here is the list of prebuilt bots on API.AI

screen shot 2017-06-19 at 4 37 47 pm screen shot 2017-06-19 at 4 38 05 pm screen shot 2017-06-19 at 4 38 19 pm screen shot 2017-06-19 at 4 38 35 pm
jekram commented 7 years ago

Please create a new BOT and import the following: 1) Weather 2) Restaurant Booking 3) MAPs 4) Food Delivery 5) Flight. Post the Widget as a separate Tab. The purpose of this is to Do a demo of a BOT.

sojharo commented 7 years ago

I have created a bot which has the mixture of these 5 bots: 1) Weather 2) Restaurant Booking 3) MAPs 4) Food Delivery 5) Flight.

These bots have the defined questions with entities, intents and actions. They don't have any answers. Also we would need to connect this bot to external web server. The bot will parse the user query and take the actionable data out of it. E.g. if user on the bot asks: "What is weather of Karachi in Celsuis" The bot will give the following information to our server:

query: weather city: karachi type: celsius

Now it is up to our web server to query the Weather APIs and get the weather information. I think I have understood how the API.AI should be used. For Vantros, we have been using it in a bad manner. Instead of defining answers on API.AI dashboard, we should use the API.AI to get the actionable data from user query. Once we have this data, then our server can use this data to generate the response.

API.AI service will help us in converting the user query into use structured data (they call it actionable data).

In this task, after creating this mixture bot, I went on to learning how to use web hooks and also call their API. I am ready to work on this tomorrow when we have our server for testing. I also read the forums to understand how other users are doing this.

jekram commented 7 years ago

@sojharo what is the update here?

I also, do not understand your statement here: Please explain:

"For Vantros, we have been using it in a bad manner. Instead of defining answers on API.AI dashboard, we should use the API.AI to get the actionable data from user query"

sojharo commented 7 years ago

I didn't complete work on this as next step here was to configure server to integrate this mixture of bots with our server and then use the server to get information like weather and maps.

Regarding above comment, as we discussed in our yesterday's meeting, that the correct way to use the bot is to connect it with server. The bot should be used to not give answers but to parse the query of user into actionable data. By actionable data, I mean, that if users asks "what is the weather in karachi tomorrow in celsius". Then Bot should be able to parse actionable data from it which is:

action : "weather" city : "karachi" when : "tomorrow" type : "celsius"

So, our bot instead of giving the reply should send this actionable data to our server in form of JSON and our server will use this data to generate the following answer to give to the bot. Answer will be like "Tomorrow, it will 37 degree celsius in Karachi. It would be little Cloudy".

Currently, the way our bots are configured they are just taking question and giving the predefined answers. They are not producing any actionable data that our server can use.

jekram commented 7 years ago

Ok. Got it. I agree with some information will be stored outside the BOT. Like Weather or Shopify customer information.

Here is the Server information: Please store this Google Drive with the rest.

Droplet Name: ChatBotServer IP Address: 104.236.118.212 Username: root Password: 709b14aeb33796249865d297d5

@dayemsiddiqui @zarmeen92

To call the backend we should define a API (Swagger) ?

sojharo commented 7 years ago

I worked on this task and used the Yahoo weather API to get the information of weather and fill it in the bot response according to user query. Here is the result of our server side rest API which listens to user query and then check if it is for weather, it calls weather api and return the formatted response to client. I tested this inside the REST API client tool postman:

screen shot 2017-06-28 at 3 06 50 am

Furthermore, I worked more on this for using maps features as well. This couldn't complete as the server couldn't determine the current location of user. I am working to return the location from browser now. This part is under construction.

Other work that I did on Saturday was to use the webhook with API.AI. However, the API.AI didn't allow the webhook, because our server is not on https. Webhook needs to be on https server and must have ssl for webhook to be used on API.AI. However, I did the reverse work. Instead of API.AI calling our webhook to get the weather information and give back to user on user query, I used the server to take the user query and asked API.AI to parse the query into actionable data and then call the weather api and make response.

As this is just for demo purpose, it would be ok, if we don't use webhooks. As webhooks are defined in server to help api.ai to get some data whenever user asks question. However, if server itself acts as user asking question and api.ai would give the parsed query to server then server will call the weather api to put more data in the response. It is just two sides of coin.

Next, in this, I would complete the work on maps bot and then provide the sample data for other types of bots that we have integrated. I don't think that we would use real data for bots like flight, restaurant booking and food delivery. For weather and maps, we can use the real data. Also, I would put another widget on the kiboengage website for this, for now, I am using rest api tool to test.

jekram commented 7 years ago

@sojharo what portion of this Bot is available. This is an experiment. Release it now and continue to enhance it The purpose of this task it to release pre built bot.

sojharo commented 7 years ago

The portion about the weather is working. We can ask about weather of any city with provided unit (celsius or fahrenheit). I will release the bot now. However, it is better that queries should go through our new server. As server will be able to query weather api. If the queries are directed to api.ai then api.ai will not have weather information. Also, Api.ai can't talk to our webhook as webhook needs to be on https.

jekram commented 7 years ago

For the server, you need ssl certs? Please let me know where we have ssl certs deployed. If we are of ssl certs then I will get new one.

sojharo commented 7 years ago

Yes, I am thinking to use the same droplet for both this test bot and our complete bot solution for which i am doing design. Sooner or later, we would need the domain name and ssl for this. I think, it would be better to use our same domain www.kibosupport.com and use new subdomain under this domain called "chatbot.kibosupport.com". This way we would be able to use the certs that we already have. We would just need to refresh them

On Wed, Jun 28, 2017 at 1:46 PM, Cloudkibo notifications@github.com wrote:

For the server, you need ssl certs? Please let me know where we have ssl certs deployed. If we are of ssl certs then I will get new one.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Cloudkibo/ChatBot/issues/14#issuecomment-311596885, or mute the thread https://github.com/notifications/unsubscribe-auth/AFitCWhiMXf_YmAxHEXwqa59DBwLu2yJks5sIhLpgaJpZM4N-HPW .

-- Regards,

Sojharo

sojharo commented 7 years ago

I have added manual responses for other bot features. I have deployed the bot as 3rd widget on the kiboengage. However, it is giving me some CORS issues. I tried disabling the CORS but it is having problems. I would work more on this on Friday. I am able to get response when I run it on postman:

screen shot 2017-06-28 at 6 18 19 pm

But it does issue when I run same API on kiboengage widget.

screen shot 2017-06-28 at 6 18 02 pm

I would discuss the fetch library that zarmeen is using for http request from reactjs. It used to work in angularjs.

sojharo commented 7 years ago

I have the branch on kiboengage as well.

jekram commented 7 years ago

@zarmeen92 FYI

jekram commented 7 years ago

@sojharo

your note said"

"I have deployed the bot as 3rd widget on the kiboengage."

I do not see it?

image

sojharo commented 7 years ago

Yes, it is on the separate branch which will be merged with master branch by zarmeen first and then zarmeen will push it to production. I would discuss the problem of CORS with zarmeen and will solve it today and then make pull request for zarmeen to merge. The CORS issue that I am having is I think due to no SSL certificates. Browser might be stopping it.

sojharo commented 7 years ago

I have been able to make the widget work successfully. I moved the code from client side widget to the server side to call the chat bot. As server doesn't force us to use same origin, so I didn't get the CORS issue. I am submitting a pull request in fifteen minutes after showing the button on the homepage, then zarmeen will merge it and publish it.

screen shot 2017-07-03 at 10 24 10 am
sojharo commented 7 years ago

Zarmeen has merged the bot and it is now ready for test. I think I have completed the work on this until we need to do further work in providing more real data. For now, it is providing real data for weather as it uses weather api for it.

screen shot 2017-07-03 at 11 31 53 am

You can click the third button there. "Chat bot help 2"

jekram commented 7 years ago

@sojharo Thanks.

Can you please send the list of questions that Bot is currently trained for

sojharo commented 7 years ago

yes, please initially try these, I would send more:

On Mon, Jul 3, 2017 at 2:14 PM, Cloudkibo notifications@github.com wrote:

@sojharo https://github.com/sojharo Thanks.

Can you please send the list of questions that Bot is currently trained for

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Cloudkibo/ChatBot/issues/14#issuecomment-312593165, or mute the thread https://github.com/notifications/unsubscribe-auth/AFitCZw_OYirzra0mCAkrRQ5E2l1xMqBks5sKLEFgaJpZM4N-HPW .

-- Regards,

Sojharo

jekram commented 7 years ago

Please send the rest of the questions

sojharo commented 7 years ago

Yes, mostly other questions would be variations of these. However, the maps bot which is not connected to map gives the answer like under construction: