Rasa WebChat integration











up vote
1
down vote

favorite
1












I have created a chatbot on slack using Rasa-Core and Rasa-NLU by watching this video : https://vimeo.com/254777331



It works pretty well on Slack.com. But what I need is to add this to our website using a code snippet. When I looked up on that, I was able to find out that RASA Webchat (https://github.com/mrbot-ai/rasa-webchat : A simple webchat widget to connect with a chatbot ) can be used to add the chatbot to the website. So, I pasted this code on my website inside the < body > tag.



    <div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.4.1.js"></script>
<script>
WebChat.default.init({
selector: "#webchat",
initPayload: "/get_started",
interval: 1000, // 1000 ms between each message
customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
socketUrl: "http://localhost:5500",
socketPath: "/socket.io/",
title: "Title",
subtitle: "Subtitle",
profileAvatar: "http://to.avat.ar",
})
</script>


“Run_app.py” is the file which starts the chatbot ( It’s available in the video : https://vimeo.com/254777331 )



Here is the code of Run_app.py :

from rasa_core.channels import HttpInputChannel
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_slack_connector import SlackInput



nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
agent = Agent.load('./models/dialogue', interpreter = nlu_interpreter)

input_channel = SlackInput('xoxp-381510545829-382263177798-381274424643-a3b461a2ffe4a595e35795e1f98492c9', #app verification token
'xoxb-381510545829-381150752228-kNSPU0X7HpaS8oJaqd77TPQE', # bot verification token
'B709JgyLSSyKoodEDwOiJzic', # slack verification token
True)

agent.handle_channel(HttpInputChannel(5004, '/', input_channel))


I want to connect this python chat-bot to the “Rasa-webchat” instead of using Slack. But I don’t know how to do that. I tried looking everywhere, But I couldn’t find anything helpful on the internet. Can someone help me? Thank you.










share|improve this question


























    up vote
    1
    down vote

    favorite
    1












    I have created a chatbot on slack using Rasa-Core and Rasa-NLU by watching this video : https://vimeo.com/254777331



    It works pretty well on Slack.com. But what I need is to add this to our website using a code snippet. When I looked up on that, I was able to find out that RASA Webchat (https://github.com/mrbot-ai/rasa-webchat : A simple webchat widget to connect with a chatbot ) can be used to add the chatbot to the website. So, I pasted this code on my website inside the < body > tag.



        <div id="webchat"/>
    <script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.4.1.js"></script>
    <script>
    WebChat.default.init({
    selector: "#webchat",
    initPayload: "/get_started",
    interval: 1000, // 1000 ms between each message
    customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5500",
    socketPath: "/socket.io/",
    title: "Title",
    subtitle: "Subtitle",
    profileAvatar: "http://to.avat.ar",
    })
    </script>


    “Run_app.py” is the file which starts the chatbot ( It’s available in the video : https://vimeo.com/254777331 )



    Here is the code of Run_app.py :

    from rasa_core.channels import HttpInputChannel
    from rasa_core.agent import Agent
    from rasa_core.interpreter import RasaNLUInterpreter
    from rasa_slack_connector import SlackInput



    nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
    agent = Agent.load('./models/dialogue', interpreter = nlu_interpreter)

    input_channel = SlackInput('xoxp-381510545829-382263177798-381274424643-a3b461a2ffe4a595e35795e1f98492c9', #app verification token
    'xoxb-381510545829-381150752228-kNSPU0X7HpaS8oJaqd77TPQE', # bot verification token
    'B709JgyLSSyKoodEDwOiJzic', # slack verification token
    True)

    agent.handle_channel(HttpInputChannel(5004, '/', input_channel))


    I want to connect this python chat-bot to the “Rasa-webchat” instead of using Slack. But I don’t know how to do that. I tried looking everywhere, But I couldn’t find anything helpful on the internet. Can someone help me? Thank you.










    share|improve this question
























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I have created a chatbot on slack using Rasa-Core and Rasa-NLU by watching this video : https://vimeo.com/254777331



      It works pretty well on Slack.com. But what I need is to add this to our website using a code snippet. When I looked up on that, I was able to find out that RASA Webchat (https://github.com/mrbot-ai/rasa-webchat : A simple webchat widget to connect with a chatbot ) can be used to add the chatbot to the website. So, I pasted this code on my website inside the < body > tag.



          <div id="webchat"/>
      <script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.4.1.js"></script>
      <script>
      WebChat.default.init({
      selector: "#webchat",
      initPayload: "/get_started",
      interval: 1000, // 1000 ms between each message
      customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
      socketUrl: "http://localhost:5500",
      socketPath: "/socket.io/",
      title: "Title",
      subtitle: "Subtitle",
      profileAvatar: "http://to.avat.ar",
      })
      </script>


      “Run_app.py” is the file which starts the chatbot ( It’s available in the video : https://vimeo.com/254777331 )



      Here is the code of Run_app.py :

      from rasa_core.channels import HttpInputChannel
      from rasa_core.agent import Agent
      from rasa_core.interpreter import RasaNLUInterpreter
      from rasa_slack_connector import SlackInput



      nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
      agent = Agent.load('./models/dialogue', interpreter = nlu_interpreter)

      input_channel = SlackInput('xoxp-381510545829-382263177798-381274424643-a3b461a2ffe4a595e35795e1f98492c9', #app verification token
      'xoxb-381510545829-381150752228-kNSPU0X7HpaS8oJaqd77TPQE', # bot verification token
      'B709JgyLSSyKoodEDwOiJzic', # slack verification token
      True)

      agent.handle_channel(HttpInputChannel(5004, '/', input_channel))


      I want to connect this python chat-bot to the “Rasa-webchat” instead of using Slack. But I don’t know how to do that. I tried looking everywhere, But I couldn’t find anything helpful on the internet. Can someone help me? Thank you.










      share|improve this question













      I have created a chatbot on slack using Rasa-Core and Rasa-NLU by watching this video : https://vimeo.com/254777331



      It works pretty well on Slack.com. But what I need is to add this to our website using a code snippet. When I looked up on that, I was able to find out that RASA Webchat (https://github.com/mrbot-ai/rasa-webchat : A simple webchat widget to connect with a chatbot ) can be used to add the chatbot to the website. So, I pasted this code on my website inside the < body > tag.



          <div id="webchat"/>
      <script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.4.1.js"></script>
      <script>
      WebChat.default.init({
      selector: "#webchat",
      initPayload: "/get_started",
      interval: 1000, // 1000 ms between each message
      customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
      socketUrl: "http://localhost:5500",
      socketPath: "/socket.io/",
      title: "Title",
      subtitle: "Subtitle",
      profileAvatar: "http://to.avat.ar",
      })
      </script>


      “Run_app.py” is the file which starts the chatbot ( It’s available in the video : https://vimeo.com/254777331 )



      Here is the code of Run_app.py :

      from rasa_core.channels import HttpInputChannel
      from rasa_core.agent import Agent
      from rasa_core.interpreter import RasaNLUInterpreter
      from rasa_slack_connector import SlackInput



      nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
      agent = Agent.load('./models/dialogue', interpreter = nlu_interpreter)

      input_channel = SlackInput('xoxp-381510545829-382263177798-381274424643-a3b461a2ffe4a595e35795e1f98492c9', #app verification token
      'xoxb-381510545829-381150752228-kNSPU0X7HpaS8oJaqd77TPQE', # bot verification token
      'B709JgyLSSyKoodEDwOiJzic', # slack verification token
      True)

      agent.handle_channel(HttpInputChannel(5004, '/', input_channel))


      I want to connect this python chat-bot to the “Rasa-webchat” instead of using Slack. But I don’t know how to do that. I tried looking everywhere, But I couldn’t find anything helpful on the internet. Can someone help me? Thank you.







      chatbot rasa-nlu rasa-core web-chat






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 10:01









      Dilanka Dias

      85




      85
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          In order to connect Rasa Core with your web chat do the following:





          1. Create a credentials file (credentials.yml) with the following content:



            socketio:
            user_message_evt: user_uttered
            bot_message_evt: bot_uttered



          2. Start Rasa Core with the following command (I assume you have already trained your model):



            python -m rasa_core.run 
            --credentials <path to your credentials>.yml
            -d <path to your trained core model>
            -p 5500 # either change the port here to 5500 or to 5005 in the js script



          Since you specified the socketio configuration in your credentials file, Rasa Core automatically starts the SocketIO Input Channel which the script on your website then connects to.



          To add NLU you have to options:




          1. Specify the trained NLU model with -u <path to model> in your Rasa Core run command

          2. Run a separate NLU server and configure it using an endpoint configuration. This is explained here in depth


          The Rasa Core documentation might also help you.






          share|improve this answer




























            up vote
            0
            down vote













            In order to have a web channel, you need to have a front-end which can send and receive chat utterances. There is an opensource project by scalableminds. Look at the demo first



            demo



            To integrate your Rasa bot with this chatroom, you can install the chatroom project as shown in the below Github project. It works with latest 0.11 Rasa version as well.



            Chatroom by Scalableminds






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187184%2frasa-webchat-integration%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              In order to connect Rasa Core with your web chat do the following:





              1. Create a credentials file (credentials.yml) with the following content:



                socketio:
                user_message_evt: user_uttered
                bot_message_evt: bot_uttered



              2. Start Rasa Core with the following command (I assume you have already trained your model):



                python -m rasa_core.run 
                --credentials <path to your credentials>.yml
                -d <path to your trained core model>
                -p 5500 # either change the port here to 5500 or to 5005 in the js script



              Since you specified the socketio configuration in your credentials file, Rasa Core automatically starts the SocketIO Input Channel which the script on your website then connects to.



              To add NLU you have to options:




              1. Specify the trained NLU model with -u <path to model> in your Rasa Core run command

              2. Run a separate NLU server and configure it using an endpoint configuration. This is explained here in depth


              The Rasa Core documentation might also help you.






              share|improve this answer

























                up vote
                0
                down vote













                In order to connect Rasa Core with your web chat do the following:





                1. Create a credentials file (credentials.yml) with the following content:



                  socketio:
                  user_message_evt: user_uttered
                  bot_message_evt: bot_uttered



                2. Start Rasa Core with the following command (I assume you have already trained your model):



                  python -m rasa_core.run 
                  --credentials <path to your credentials>.yml
                  -d <path to your trained core model>
                  -p 5500 # either change the port here to 5500 or to 5005 in the js script



                Since you specified the socketio configuration in your credentials file, Rasa Core automatically starts the SocketIO Input Channel which the script on your website then connects to.



                To add NLU you have to options:




                1. Specify the trained NLU model with -u <path to model> in your Rasa Core run command

                2. Run a separate NLU server and configure it using an endpoint configuration. This is explained here in depth


                The Rasa Core documentation might also help you.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  In order to connect Rasa Core with your web chat do the following:





                  1. Create a credentials file (credentials.yml) with the following content:



                    socketio:
                    user_message_evt: user_uttered
                    bot_message_evt: bot_uttered



                  2. Start Rasa Core with the following command (I assume you have already trained your model):



                    python -m rasa_core.run 
                    --credentials <path to your credentials>.yml
                    -d <path to your trained core model>
                    -p 5500 # either change the port here to 5500 or to 5005 in the js script



                  Since you specified the socketio configuration in your credentials file, Rasa Core automatically starts the SocketIO Input Channel which the script on your website then connects to.



                  To add NLU you have to options:




                  1. Specify the trained NLU model with -u <path to model> in your Rasa Core run command

                  2. Run a separate NLU server and configure it using an endpoint configuration. This is explained here in depth


                  The Rasa Core documentation might also help you.






                  share|improve this answer












                  In order to connect Rasa Core with your web chat do the following:





                  1. Create a credentials file (credentials.yml) with the following content:



                    socketio:
                    user_message_evt: user_uttered
                    bot_message_evt: bot_uttered



                  2. Start Rasa Core with the following command (I assume you have already trained your model):



                    python -m rasa_core.run 
                    --credentials <path to your credentials>.yml
                    -d <path to your trained core model>
                    -p 5500 # either change the port here to 5500 or to 5005 in the js script



                  Since you specified the socketio configuration in your credentials file, Rasa Core automatically starts the SocketIO Input Channel which the script on your website then connects to.



                  To add NLU you have to options:




                  1. Specify the trained NLU model with -u <path to model> in your Rasa Core run command

                  2. Run a separate NLU server and configure it using an endpoint configuration. This is explained here in depth


                  The Rasa Core documentation might also help you.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 9 at 8:18









                  Tobias

                  1316




                  1316
























                      up vote
                      0
                      down vote













                      In order to have a web channel, you need to have a front-end which can send and receive chat utterances. There is an opensource project by scalableminds. Look at the demo first



                      demo



                      To integrate your Rasa bot with this chatroom, you can install the chatroom project as shown in the below Github project. It works with latest 0.11 Rasa version as well.



                      Chatroom by Scalableminds






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        In order to have a web channel, you need to have a front-end which can send and receive chat utterances. There is an opensource project by scalableminds. Look at the demo first



                        demo



                        To integrate your Rasa bot with this chatroom, you can install the chatroom project as shown in the below Github project. It works with latest 0.11 Rasa version as well.



                        Chatroom by Scalableminds






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          In order to have a web channel, you need to have a front-end which can send and receive chat utterances. There is an opensource project by scalableminds. Look at the demo first



                          demo



                          To integrate your Rasa bot with this chatroom, you can install the chatroom project as shown in the below Github project. It works with latest 0.11 Rasa version as well.



                          Chatroom by Scalableminds






                          share|improve this answer












                          In order to have a web channel, you need to have a front-end which can send and receive chat utterances. There is an opensource project by scalableminds. Look at the demo first



                          demo



                          To integrate your Rasa bot with this chatroom, you can install the chatroom project as shown in the below Github project. It works with latest 0.11 Rasa version as well.



                          Chatroom by Scalableminds







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 13 at 9:33









                          Karthik Sunil

                          315




                          315






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187184%2frasa-webchat-integration%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              這個網誌中的熱門文章

                              Academy of Television Arts & Sciences

                              L'Équipe

                              1995 France bombings