Skip to main content

Complete On-Premise and Fully Customisable Chat Bot - Part 3 - Communicating to the Agent that has been built

Welcome back Folks !!

In our part 2 we created the Bot Kit server/ Agent that will respond to the hello message with a fallback.

Here we will be looking on how to communicate to the bot on the port 3000 using the web socket client.

Communcation With Bot On 3000 in Websocket.

To test the communication with the bot, temporarily we will use the web socket client plugin that comes as a extension in the Chrome / Firefox  plugin.

Follow the procedure as follows ,

1. Install the Chrome / Firefox from the below links


2. After installing the chrome or Firefox. Google for "Simple Websocket Client for Chrome / Firefox".

3. Open the first link and click on add to chrome.
4. Once if the extension has been added you can see it on the chrome like below

5. click on the simple web socket icon and the client opens as follows.

6. Now in the URL enter as "ws://localhost:3000" and click on the Open button. On Success the button will turn to close or it will alert the error. Ensure that the bot server that we created in the Part 2  is running.

7. In the request Section. paste the following message format and include your message in that.
{
      "type": "message",
      "text": "<user message >",
      "user": "<User name>",
      "channel": "Web",
      "timestamp": "<Date time>"
    }

Example
{
      "type": "message",
      "text": "Hello",
      "user": "Pranav",
      "channel": "Web",
      "timestamp": "Thursday, March 8, 2018 8:06:47 AM"
    }

Click on send button and you should get the reply from the bot as follows.



Hurrah !!! Our Bot in action. Modify the index.js to hear for more messages and play around with it.

In the next tutorial lets use the Natural Language Processing server to handle the message and classify the messages to the intents(Meaning full Category ) and lets create a beautiful conversation between the user and the bot. 

Stay Tuned ... !!  

Comments

  1. Appreciate your support and efforts.

    ReplyDelete
  2. Thank you for the nice article. Can you please provide links to next article to use NLP for message handling ?

    ReplyDelete
    Replies
    1. Thank you so much !! Updated the link to the next

      Delete

Post a Comment

Popular posts from this blog

How to access the each view of item by position in Recycler View in android ?

How to access the each view of item by position in Recycler View in android ? There are some methods to access the view of each item view to change or update the view during the run time. To access the view of the item view , consider the Recycler view as below, RecyclerView mainRecyclerView = (RecyclerView)view.findViewById(R.id.main_recycler_view); RecyclerAdapter adapter = new RecyclerAdapter(mContext); mainRecyclerView.setAdapter(adapter); main.setLayoutManager(new LinearLayoutManager(mContext));  To access the itemView of each position the following functions can be used,  1. View itemView = mainRecyclerView.getChildAt(positionOfItem);  2. View itemView = mainRecyclerView.findViewHolderForAdapterPosition(Position).itemView;  3. View itemView = mainRecyclerView.findViewHolderForPosition(Position).itemView;  4. Long itemId = mainRecyclerView.getAdapter().getItemId(position);       View itemView = mainRecyclerView....

How Machine Learning Works ? - Data Rules the Kingdom

W elcome Back Readers !, For those who have not read the previous post on How Machine Learning works ? Please do read previous one before continuing this so that it would be more easy to understand. You can find the previous post here How Machine Learning Works ? - Mathematics Every Where . For other who are ready to join with me in this journey to understand the Machine Learning, Thank you for being with this post. Till now we are discussing on the the title "How Machine Learning works? " and to understand that we have seen in the first post that there exist the patterns or trends in the data and we try to find that in terms of a mathematical equation called a model and try to fit to the new data that we have not came across for predicting the values. Wow may be we got the entire process complete with this. But there are few thinks that needs to be cared while training the model or creating the model or while processing the data for the model creation. ...

Machine Learning - Types of Learning - Explained

W elcome back readers !! So far we are trying to understand the Machine learning in a simple way, keeping the beginners context in mind ! This is one more post, I thought I would write on explaining the various learning types in the Machine Learning. Obviously the word says "Machine Learning" - means machine learn something. How do machine can learn something is what we understood in our various posts before ( here ). We will see about how many types of learning are possible by the machines. Here when I say types of learning, I say about the various classification of learning procedures (Algorithm - Step by step procedure to solve a problem). Types of Learning: Following types of learning procedures can be identified, Regression Classification Clustering Rule association  Ensemble  Reinforcement Deep Learning I can understand that this sounds Greek and Latin now, trust me I will make you understand all this in easy way. We can't cover all the types...