Rasa Webchat Integration - Getting Started with Rasa / Tutorials, Resources & Videos - Rasa Community Forum

Rasa Webchat Integration

Getting Started with Rasa Tutorials, Resources & Videos

You have selected 0 posts.

select all

cancel selecting

Oct 2019

1 / 186

Oct 2019

Aug 2023

post by JiteshGaikwad on Oct 17, 2019

JiteshGaikwad Rasa Certified Developer

1

Oct 2019

Hi all,

I had created a video tutorial in which I have shown how you can connect Rasa bot with the Webchat:

Rasa Webchat Integration 🤖

30.2k views 43 likes 50 links 45 users

33](https://forum.rasa.com/u/JiteshGaikwad "JiteshGaikwad")

15](https://forum.rasa.com/u/muthukumars "muthukumars")

15](https://forum.rasa.com/u/lluchini "lluchini")

14](https://forum.rasa.com/u/Horizon733 "Horizon733")

11](https://forum.rasa.com/u/nik202 "nik202")

read 22 min

Top replies

3 months later

post by ashu on Jan 6, 2020

ashu

Jan 2020

That works! thanks.

post by JiteshGaikwad on Jan 6, 2020

JiteshGaikwad Rasa Certified Developer

Jan 2020

Welcome, glad that it helped you

1 month later

post by Aashay1 on Feb 10, 2020

Aashay1Aashay

Feb 2020

Hey , hope you are doing well . I want to fetch te userID from the html as below , That is once the user logs in the website , i want to fetch the userID to make api calls .

Chat widget

// Or you can replace latest with a specific version

Thank you

post by rishier827 on Feb 10, 2020

rishier827Rishie Ramasinghe

Feb 2020

Here im running my application with,

> rasa run --enable-api -vv

because of my notification thing but here i want to try with, **

> rasa run -m models --enable-api --cors “*” --debug so how can i combine them and run

post by JiteshGaikwad on Feb 11, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

Hey @rishier827, I didn’t understand what are you trying to say can you explain in detail

post by rishier827 on Feb 11, 2020

rishier827Rishie Ramasinghe

Feb 2020

Thankz problem solved☺

post by Aashay1 on Feb 11, 2020

Aashay1Aashay

Feb 2020

@JiteshGaikwad to use customdata in actions.py file , or fill slots with it ?

Thankz

post by JiteshGaikwad on Feb 11, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

Hi @Aashay1, sorry for the late reply, I have updated the socket.io channel for extracting the customData that you can send from the rasa-webchat, just follow the below steps and it will work:

Step1: Just add the socketChannel.py file from this repository to your project :

https://github.com/JiteshGaikwad/socketChannel_RasaBot/blob/master/socketChannel.py

Step2: Now register the above channel in your credentials.py file as mentioned in this repo:

https://github.com/JiteshGaikwad/socketChannel_RasaBot/blob/cae5b9c314238dfd927634f66b9a5c2a962bd662/credentials.yml#L19

Step3: Now in the bot-ui i.e rasa-webchat, add the customData that you want to send as mentioned here:

GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront

Step4: Now if you want to extract the customData, just write down the below code in your actions.py file:

https://github.com/JiteshGaikwad/socketChannel_RasaBot/blob/cae5b9c314238dfd927634f66b9a5c2a962bd662/actions.py#L35

I have written the function that extracts the metadata from the tracker, you can get it here:

https://github.com/JiteshGaikwad/socketChannel_RasaBot/blob/cae5b9c314238dfd927634f66b9a5c2a962bd662/actions.py#L17

Note: I have just updated the socket.io channel’s handle_message method to extract the customData as metadata :

https://github.com/JiteshGaikwad/socketChannel_RasaBot/blob/cae5b9c314238dfd927634f66b9a5c2a962bd662/socketChannel.py#L193

Let me know if this helps you

post by Aashay1 on Feb 11, 2020

Aashay1Aashay

Feb 2020

Hi @JiteshGaikwad, I am sorry to ask a silly questions as I am a fresher , but how to add multiple custom Data

post by JiteshGaikwad on Feb 11, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

Try the below code and let me know if this helps:

{“customData”:[{“key1”:“value1”,“key2”:“value2”}]}

post by JiteshGaikwad on Feb 11, 2020

JiteshGaikwad Rasa Certified Developer

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Feb 2020

Did this solved your problem?

post by Aashay1 on Feb 11, 2020

Aashay1Aashay

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Feb 2020

Just one last question , My actions server and webchat is running and i want to know the current tracker state , How am i suppose to do it in python

Thanks a lot ,

post by JiteshGaikwad on Feb 11, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

You can get the current tracker state using the below code:

tracker.current_state()

https://rasa.com/docs/rasa/api/tracker/#rasa.core.trackers.DialogueStateTracker.current_state

post by Aashay1 on Feb 12, 2020

Aashay1Aashay

Feb 2020

Hi @JiteshGaikwad, I Think i am using it the wrong way ,

Please have a look at my actions.py and index.script file below

from future import absolute_import from future import division from future import unicode_literals

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher

from rasa.core.actions.action import Action from rasa.core.events import SlotSet from rasa_sdk import Tracker from rasa_sdk.executor import CollectingDispatcher

from typing import Dict, Text, Any, List import requests from rasa_sdk import Action from rasa_sdk.events import SlotSet, FollowupAction from rasa_sdk.forms import FormAction

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher

def extract_metadata_from_tracker(tracker): events = tracker.current_state()[‘events’] user_events = [] for e in events: if e[‘event’] == ‘user’: user_events.append(e) print(e[‘event’])


return user_events[-1]['metadata']

class GetLeaveBalance(Action):


def name(self):
    return 'get_leave_balance'

def run(self, dispatcher, tracker, domain):

#importing lib to connect with wsdl
    from suds.client import Client
    from suds.sax.element import Element

#specfying the wsdl url and setting the client
    url = "http://devmobileapi.xxxxxxxxxxxxxxxxx.in/API/xxxxxxxxxxxxxxxxx.svc?wsdl"
    client = Client(url)

#creating the headers for auth in service xml and setting the values for both API-key and API-Code
    Namespace = ('ns2', 'http://xxxxxxxxxxxxxxxxxxx.com/v1')
    name_space = Element('APICode', ns=Namespace).setText('xxxxxxxxxxxxxxxx')

Apikey =('ns2',"http://xxxxxxxxxxxxxxxxxxxx.com/v1")
    api_key = Element('APIKey',ns= Apikey).setText('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ')

client.set_options(soapheaders=(name_space,api_key))

# getting the leave data from GetLeaveBalance for specific user
    #leave=client.service.GetLeaveBalance("1")      **I want to fill this field**
    leave_data= Client.dict(leave)

##################### Creating list of leave types


leave_list= tracker.get_slot("leave_type")
    leave_t = leave_list[0]

leave_type=["short_leave", "casual_leave", "sick_leave","earned_leave", "leave_without_pay",\
                "paid_leave","paternity_leave","leave"]
    if leave_t in leave_type:

if leave_t == "leave":
            short_l=leave_data['LeaveBalance']["LeaveBalanceData"][0]["Balance"]
            casual_l=leave_data['LeaveBalance']["LeaveBalanceData"][1]["Balance"]
            sick_l=leave_data['LeaveBalance']["LeaveBalanceData"][2]["Balance"]
            earned_l=leave_data['LeaveBalance']["LeaveBalanceData"][3]["Balance"]
            without_pay_l=leave_data['LeaveBalance']["LeaveBalanceData"][4]["Balance"]
            privilege_l=leave_data['LeaveBalance']["LeaveBalanceData"][5]["Balance"]
            Paternity_l=leave_data['LeaveBalance']["LeaveBalanceData"][6]["Balance"]

text_leave=(""" Your Leave balance summary is as follows:
                Short Leave :{}
                Casual Leave : {}
                Sick Leave: {}
                Earned Leave : {}
                Leave Without Pay : {}
                Privilege Leave : {}
                Paternity Leave : {}""".format(short_l,casual_l,sick_l,earned_l,without_pay_l,privilege_l,privilege_l,Paternity_l))

if leave_t=="short_leave":
              short_l=leave_data['LeaveBalance']["LeaveBalanceData"][0]["Balance"]

text_leave=("""you have {} short leave left""".format(short_l))

if leave_t=="casual_leave":
             casual_l=leave_data['LeaveBalance']["LeaveBalanceData"][1]["Balance"]
             text_leave=("""you have {} casual leave left""".format(casual_l))

if leave_t=="sick_leave":
             sick_l=leave_data['LeaveBalance']["LeaveBalanceData"][2]["Balance"]
             text_leave=("""you have {} sick leave left""".format(sick_l))

if leave_t=="earned_leave":
             earned_l=leave_data['LeaveBalance']["LeaveBalanceData"][3]["Balance"]
             text_leave=("""you have {} earned leave left""".format(earned_l))

if leave_t=="leave_without_pay":
             #without_pay_l=leave_data['LeaveBalance']["LeaveBalanceData"][4]["Balance"]
             text_leave=("""You are limited to have only 30 unplaned leaves in a year""")

if leave_t=="paid_leave":
             privilege_l=leave_data['LeaveBalance']["LeaveBalanceData"][5]["Balance"]
             text_leave=("""you have {} paid leave left""".format(privilege_l))

if leave_t=="paternity_leave":
             Paternity_l=leave_data['LeaveBalance']["LeaveBalanceData"][6]["Balance"]
             text_leave=("""you have {} paternity leave left""".format(Paternity_l))
    else:
        text_leave=("please enter a valid leave type")

dispatcher.utter_message(text_leave)

return []

Index.html (script )file div id=“webchat” script src=“ https://storage.googleapis.com/mrbot-cdn/webchat-latest.js”></script // Or you can replace latest with a specific version script WebChat.default.init({ selector: “ #webchat”, initPayload: “/get_started”, customData: {“language”: “en”," useID":“1”}, // arbitrary custom data. Stay minimal as this will be added to the socket socketUrl: “ http://localhost:5005”, socketPath: “/socket.io/”, title: “Title”, subtitle: “Subtitle”, }) script

post by JiteshGaikwad on Feb 12, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

what’s the error?

post by Aashay1 on Feb 12, 2020

Aashay1Aashay

Feb 2020

Hi @JiteshGaikwad I have copied the fill in the the repo , Copied the code into actions.py file ,

I am not sure how to use it. I am very new to this field !!!

Thankz Aashay

post by Aashay1 on Feb 14, 2020

Aashay1Aashay

Feb 2020

Hi Guys,

I am able to solve, How to pass Custom data and set slot with rasa web

#################### you html webchat scrip #####################

div id=“webchat” script src=“ https://storage.googleapis.com/mrbot-cdn/webchat-latest.js”></script // Or you can replace latest with a specific version script WebChat.default.init({ selector: “ #webchat”, initPayload : ‘/get_started{“userID”:“1”}’, customData:{}, // arbitrary custom data. Stay minimal as this will be added to the socket socketUrl: “ http://localhost:5005”, socketPath: “/socket.io/”, title: “Title”, subtitle: “Subtitle”, }) /script

#################### your actions.py ############# from future import absolute_import from future import division from future import unicode_literals

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa.core.events import UserUttered

from rasa_core.trackers import DialogueStateTracker

class GetLeaveBalance(Action):


def name(self):
    return 'get_leave_balance'

def run(self, dispatcher, tracker, domain):

#importing librires to connect with wsdl
    from suds.client import Client
    from suds.sax.element import Element

userID = tracker.get_slot("userID")

print("userID :",userID)

Thank you

post by Aashay1 on Feb 14, 2020

Aashay1Aashay

Feb 2020

Hi Guys,

I am able to solve, How to pass Custom data and set slot with rasa web

#################### you html webchat scrip #####################

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa.core.events import UserUttered

from rasa_core.trackers import DialogueStateTracker

class GetLeaveBalance(Action):


def name(self):
    return 'get_leave_balance'

def run(self, dispatcher, tracker, domain):

#importing librires to connect with wsdl
    from suds.client import Client
    from suds.sax.element import Element

userID = tracker.get_slot("userID")

print("userID :",userID)

Thank you

12 days later

post by Wy0024 on Feb 26, 2020

Wy0024WyC Enthusiast

Feb 2020

Hi @JiteshGaikwad, can you help explain what is the difference between a button and a quick_replies in this Webchat? They both look the same visually and i am a little confused on this.

Can you point me to any reference where i can check on this info?

Thanks

post by JiteshGaikwad on Feb 26, 2020

JiteshGaikwad Rasa Certified Developer

Feb 2020

hey @Wy0024, the buttons which you send from rasa are treated as quick replies in the webchat, attaching some of the reference that might help you:

buttons registered in domain.yml file:


responses:
  utter_greet:
  - text: "Hey! How are you?"
    buttons:
    - title: "great"
      payload: "great"
    - title: "super sad"
      payload: "super sad"
  utter_cheer_up:
  - text: "Here is something to cheer you up:"
    image: "https://i.imgur.com/nGF1K8f.jpg"

button rendered as quick replies and treated as MESSAGES_TYPES in the webchat:

https://github.com/botfront/rasa-webchat/blob/9d6e692ea780e3b5b0ef394a3889e0240979689a/src/constants.js#L22

GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront

Let me know if this helps

post by Wy0024 on Feb 27, 2020

Wy0024WyC Enthusiast

Feb 2020

Thanks @JiteshGaikwad ! This is helpful. Also, I notice there is some additional usage on the webchat Github page here. How do i incorporate these additional usage (sending image file, video etc) into my custom action file?

For the buttons/ quick replies, i specify a certain pattern in domain.yml. But how do i use something as below?


message = {
  "attachment":{
    "type":"template",
    "payload":{
      "template_type":"generic",
      "elements":[\
        {\
          "title":"Title",\
          "buttons":[ {\
            "title":"Link name",\
            "url": "http://link.url"\
          }\
        ]\
      }\
    ]
  }
}
}
emit('bot_uttered', message, room=socket_id)

Thanks

11 days later

post by andrew.tangowork on Mar 10, 2020

andrew.tangoworkAndrew McMasterRasa Certified Developer

Mar 2020

You have to convert the json code they provide into yaml (unless there is another way of doing it I don’t know about). So in your response in domain.yml


utter_some_message:
  - text: hello world
    attachment:
      type: template
      payload:
        template_type: generic
        elements:
        - title: Title here
          buttons:
          - title: Link name here
            url: "http://link.url"

I’ve been using a converter tool to see and check to make sure I have exactly what they require on their docs. Something like this worked for me, can even type in YAML and check to see the JSON matches too. https://www.json2yaml.com/

To further this discussion. I am wondering if anyone has any experience adding custom things like cards or carousels similar to how facebook’s looks? My impression is that you’d have to add a custom react component. I’m just curious as to what extent. Does it require forking of their base code to make it work or can we just add some react components in the init section of the script?

I did have a quick browse through the code but I am only a little familiar with the react process.

post by skjainmiah on Mar 13, 2020

skjainmiah

Mar 2020

Hi @JiteshGaikwad, It worked fine for me but if I put the script part in other template its not working how to make it work in any template ? thank you.

post by JiteshGaikwad on Mar 13, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @skjainmiah, can you explain a bit, I didn’t quiet get what you are trying to say.

post by skjainmiah on Mar 14, 2020

skjainmiah

1

Mar 2020

I’m really sorry I wasn’t feeling well so I didn’t see your message. The script part taken from GitHub is working fine.

// Or you can replace latest with a specific version

But if I put the same code in different chat templates it is not working. I changed java script in the new chat html template but still it’s not working.

post by skjainmiah on Mar 15, 2020

skjainmiah

Mar 2020

I have included script but it wasn’t showing here so I’m attaching link of the code: GitHub - botfront/rasa-webchat: A chat widget for Rasa and Botfront from here I have taken script and created a html page and put in it. Its working fine till here. what my question is if I place same webchat script in other html chatting templates It wasn’t working what is the reason.

post by lluchini on Mar 18, 2020

lluchiniLeonardo Luchini Enthusiast

Mar 2020

Hello,

I’m trying to plug RASA on my page, but the widget doesn’t appear and the console keeps showing CORS error.

Below I put how I tried to put all to work.

HTML page:


<html>
<body>
    <div id="webchat"></div>
    <script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
    <script>
        WebChat.default.init({
            selector: "#webchat",
            initPayload: "/get_started",
            customData: { "language": "pt" }, // arbitrary custom data. Stay minimal as this will be added to the socket
            socketUrl: "http://localhost:5005",
            socketPath: "/socket.io/",
            title: "Global Antares",
            subtitle: "Antares",
            connectOn: "open",
            hideWhenNotConnected : "false"
        })
    </script>
</body>
</html>

RASA start command line:

rasa run -m models --enable-api --cors '*' --debug

Every time that widget tries to connect apears:

2020-03-18 11:11:18 DEBUG rasa.core.channels.socketio - User 196e28d40f8f4bf28903b66c7c693420 connected to socketIO endpoint. 2020-03-18 11:1 1:36 DEBUG rasa.core.channels.socketio - User ab11abcf07364e34866edede15987bed disconnected from socketIO endpoint.

And the console on browser shows:

teste.html:1 Access to XMLHttpRequest at ‘ http://localhost:5005/socket.io/?EIO=3&transport=polling&t=N3j-F6b’ from origin ‘null’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Log from RASA initialization:

2020-03-18 09:41:41 DEBUG rasa.core.utils - Available web server routes: /conversations/<conversation_id>/messages POST add_message /conversations/<conversation_id>/tracker/events POST append_events /webhooks/rasa GET custom_webhook_RasaChatInput.health /webhooks/rasa/webhook POST custom_webhook_RasaChatInput.receive /webhooks/rest GET custom_webhook_RestInput.health /webhooks/rest/webhook POST custom_webhook_RestInput.receive /model/test/intents POST evaluate_intents /model/test/stories POST evaluate_stories /conversations/<conversation_id>/execute POST execute_action /domain GET get_domain /socket.io GET handle_request / GET hello /model PUT load_model /model/parse POST parse /conversations/<conversation_id>/predict POST predict /conversations/<conversation_id>/tracker/events PUT replace_events /conversations/<conversation_id>/story GET retrieve_story /conversations/<conversation_id>/tracker GET retrieve_tracker /webhooks/socketio GET socketio_webhook.health /status GET status /model/predict POST tracker_predict /model/train POST train /conversations/<conversation_id>/trigger_intent POST trigger_intent /model DELETE unload_model /version GET version

2020-03-18 09:41:41 INFO root - Starting Rasa server on http://localhost:5005 2020-03-18 09:41:41 DEBUG rasa.core.utils - Using the default number of Sanic workers (1). 2020-03-18 09:41:41 INFO root - Enabling coroutine debugging. Loop id 1621305365384. 2020-03-18 09:41:41 DEBUG rasa.model - Extracted model to ‘C:\Users\lluchini\AppData\Local\Temp\tmpar5dl75o’. 2020-03-18 09:41:42 INFO rasa.nlu.components - Added ‘SpacyNLP’ to component cache. Key ‘SpacyNLP-pt’. 2020-03-18 09:41:42 DEBUG rasa.utils.tensorflow.models - Loading the model … 2020-03-18 09:41:42.770020: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library ‘nvcuda.dll’; dlerror: nvcuda.dll not found 2020-03-18 09:41:42.775639: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303) 2020-03-18 09:41:42.781225: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: apdata676 2020-03-18 09:41:42.787204: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: apdata676 2020-03-18 09:41:42.790519: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-03-18 09:41:43 DEBUG rasa.utils.tensorflow.models - Finished loading the model. 2020-03-18 09:41:43 DEBUG rasa.utils.tensorflow.models - Building tensorflow prediction graph… 2020-03-18 09:41:43.669010: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Cancelled: Operation was cancelled 2020-03-18 09:41:47 DEBUG rasa.utils.tensorflow.models - Finished building tensorflow prediction graph. 2020-03-18 09:41:47 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model. Maybe the path ‘C:\Users\lluchini\AppData\Local\Temp\tmpar5dl75o\nlu’ doesn’t exist? 2020-03-18 09:41:47 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore. 2020-03-18 09:41:47 DEBUG rasa.core.lock_store - Connected to lock store ‘InMemoryLockStore’. 2020-03-18 09:41:47 DEBUG rasa.model - Extracted model to ‘C:\Users\lluchini\AppData\Local\Temp\tmp0up4ifrc’. 2020-03-18 09:41:47 DEBUG pykwalify.compat - Using yaml library: c:\venv\lib\site-packages\ruamel\yaml_ init_.py 2020-03-18 09:41:47 DEBUG rasa.utils.tensorflow.models - Loading the model … 2020-03-18 09:41:48 DEBUG rasa.utils.tensorflow.models - Finished loading the model. 2020-03-18 09:41:48 DEBUG rasa.utils.tensorflow.models - Building tensorflow prediction graph… 2020-03-18 09:41:48.085525: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Cancelled: Operation was cancelled 2020-03-18 09:41:48 DEBUG rasa.utils.tensorflow.models - Finished building tensorflow prediction graph. 2020-03-18 09:41:48 DEBUG rasa.core.nlg.generator - Instantiated NLG to ‘TemplatedNaturalLanguageGenerator’.

post by JiteshGaikwad on Mar 19, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @lluchini, I see you haven’t registered your bot with socket.io channel due to which you are facing the above issue, check this out it may help you:

Your Own Website

post by lluchini on Mar 19, 2020

lluchiniLeonardo Luchini Enthusiast

Mar 2020

Hello @JiteshGaikwad, if you’re talking about the credentials.yml it was already set like below.


# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/

rest:
#  # you don't need to provide anything here - this channel doesn't
#  # require any credentials

rasa:
  url: "http://localhost:5002/api"

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

And at the log from previously post the socket.io is listed as below.

/socket.io GET handle_request

/webhooks/socketio GET socketio_webhook.health

post by JiteshGaikwad on Mar 19, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @lluchini, sorry my bad I missed out that

post by lluchini on Mar 19, 2020

lluchiniLeonardo Luchini Enthusiast

Mar 2020

@JiteshGaikwad no problem at all! Any help is welcome!!!

post by JiteshGaikwad on Mar 19, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @lluchini, why don’t you try running the above command as below:

rasa run -m models --enable-api --cors “*” --debug

Just making it cors as double quote.

post by lluchini on Mar 19, 2020

lluchiniLeonardo Luchini Enthusiast

Mar 2020

Maaaaan, I LOVE YOU!!! It was the quotes!!!

Thank you so much!!! I owe you a big one!!!

post by JiteshGaikwad on Mar 19, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @lluchini, thanks Man, I am glad that it worked out well and your problem is solved . Thanks for trying it out​:blush:

post by rishier827 on Mar 19, 2020

rishier827Rishie Ramasinghe

Mar 2020

@JiteshGaikwad can you give example about


`initPayload: "/get_started"`
can i use existing template on this or action?

post by JiteshGaikwad on Mar 19, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

you can use that

post by andrew.tangowork on Mar 19, 2020

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2020

Is the double quotes necessary in all circumstances? Were running this line in docker.

"exec rasa x --no-prompt --production (Other stuff here...) --enable-api --debug --cors '*'"

post by ansel2000 on Mar 22, 2020

ansel2000Ansel Francis D'souza

Mar 2020

I have tried your tutorial and it works. However, when I enter any message it reads the message but there is no reply that is sent from the bot…any suggestions on how to fix it?

2020-03-22 15:47:31 DEBUG rasa.core.processor - Received user message ‘hey’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9997854828834534}’ and entities ‘[]’ 2020-03-22 15:47:31 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 7 events. 2020-03-22 15:47:31 DEBUG rasa.core.lock_store - Deleted lock for conversation ‘b267a27e10bf41a2bf222a0b3cca1806’.

post by muthukumars on Mar 27, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

the issue still perils. whether I use single quote or double quote. please see below (rasa-venv) m.srinivasan@ATTACHCREDITTONE Rasa-Init-Yes-Train-InitialModel % rasa run -m ./models/20200323-132806.tar.gz --enable-api --cors “*” --debug

any idea?

post by JiteshGaikwad on Mar 28, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

hey @muthukumars, can you show the screenshot of your error’s trace log?

post by muthukumars on Mar 28, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

\ image3336×1692 1000 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/0c8db7ed0d29dfa7a28d47f59f96fba459aaa47a.png "image")

post by JiteshGaikwad on Mar 28, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

hey @muthukumars, have you registered the socket.io channel in your credentials.yml file ?

post by muthukumars on Mar 28, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

You mean, I have to do this in config.yml

socketio: user_message_evt: user_uttered bot_message_evt: bot_uttered session_persistence: true

this instruction was not given while setting up. I am not accessing Rasa from api. I am just bringing up the rasa and it is error like this

thank you for your help.

post by JiteshGaikwad on Mar 28, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

@muthukumars, you need to register it with socket.io channel, if you want to use the RASA Webchat

post by JiteshGaikwad on Mar 28, 2020

JiteshGaikwad Rasa Certified Developer

muthukumars](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2020

@muthukumars, it’s given here:

post by muthukumars on Mar 28, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh

thank you. but I am not access the rasa serve for now. I am just bringing up and the error shows up. I understand that this socket.io is needed if I need to be accessing from slack or web or something of that sort. anyway, I have included socket.io in the credentials.yml and the error still is appearing. I changed in credentials.yml (not in config.yml. sorry for the typo in my previous posting)

\ image1608×1606 393 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/6a8be07f29a3fb12a609860972096a04feb83b1e.png "image")

post by muthukumars on Mar 28, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

My further findings.

When I do Rasa Interactive, and add some greet and save it. then rasa train, it is saving the model as below

2020-03-28 09:43:34 INFO rasa.nlu.selectors.response_selector - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents. 2020-03-28 09:43:34 INFO rasa.nlu.model - Finished training component. 2020-03-28 09:43:35 INFO rasa.nlu.model - Successfully saved model into ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmpltnqweqz/nlu’ NLU model training completed. Your Rasa model is trained and saved at ‘/Users/m.srinivasan/muthukumar/rasa/projects/Rasa-Init-Yes-Train-InitialModel/models/20200328-094335.tar.gz’. (rasa-venv) m.srinivasan@ATTACHCREDITTONE Rasa-Init-Yes-Train-InitialModel %

However, when I start the Rasa using “Rasa run”, it is not using the same /var/folders. in fact, I have new model saved. so I am assuming that it is new model with my new trained data and Rasa will use latest Model file in the model folder. however, when we start the rasa server, it is no loading the model into var/folders. there must be some setup that I would have missed.

post by muthukumars on Mar 28, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

I have further removed all the entire virtual environment. rebuilt a new virtual environment. I still see this error

2020-03-28 18:19:53 DEBUG rasa.utils.tensorflow.models - Loading the model … 2020-03-28 18:19:54 DEBUG rasa.utils.tensorflow.models - Finished loading the model. 2020-03-28 18:19:54 DEBUG rasa.utils.tensorflow.models - Building tensorflow prediction graph… 2020-03-28 18:19:58 DEBUG rasa.utils.tensorflow.models - Finished building tensorflow prediction graph. 2020-03-28 18:19:58 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model. Maybe the path ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmp2a6duyy0/nlu’ doesn’t exist? 2020-03-28 18:19:58 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore.

Not sure whether this is anything serious. I see this only when I do -vv (verbose)

post by JiteshGaikwad on Mar 29, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Hey @muthukumars, can you tell where’s the error, what error actually are you facing since I can’t see any error in the logs.

post by muthukumars on Mar 29, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Please see the fifth line and is as below

""DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model. Maybe the path ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmp2a6duyy0/nlu’ doesn’t exist? 2020-03-28 “”

post by JiteshGaikwad on Mar 29, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

hey @muthukumars, I was able to reproduce the same error, so below are my findings:

\ diet955×431 19.8 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/d/d3554be937b6f24f5d410b0f7dde6b111ed6da21.png "diet")

So what I am trying to say is the temp folder of the trained model gets deleted automatically before the DIET classifier is about to load due to which it doesn’t find the trained model path properly and it throws the error.

post by muthukumars on Mar 29, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh

thank you for testing it

Yes. agreed. Question is : will this affect any while access or training the model? Is the above error benign and acceptable ?

post by JiteshGaikwad on Mar 29, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

This won’t affect the training of the model but it will affect while trying to access the model as it won’t predict the intent and entity using DIET classifier.

post by muthukumars on Mar 29, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh

Is this a bug ?. How do we fix this ?. Are there any work around ?

thank you Muthukumar

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

hey @muthukumars, sorry for the late reply . Actually I was trying to find workaround but then I found out something which I would like to share:

\ image936×49 4.42 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/057a926cb2f5a98d07022ba6779494e68265fa63.png "image")

So as now of I didn’t found a fix for this but I see though it’s throwing the error for DIET classifier but still DIET classifier is being used for intent & entity classification.

post by muthukumars on Mar 30, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh…

I have separate thread going on with Stephen for this. Please check this as well Rasa.nlu.classifiers.diet_classifier

this error is pretty consistent.

Please let me know

post by muthukumars on Mar 30, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Additional Information:

When I do “rasa train”, I can see as below

2020-03-30 00:14:31 INFO rasa.nlu.model - Finished training component. 2020-03-30 00:14:31 INFO rasa.nlu.model - Starting to train component ResponseSelector 2020-03-30 00:14:31 INFO rasa.nlu.selectors.response_selector - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents. 2020-03-30 00:14:31 INFO rasa.nlu.model - Finished training component. 2020-03-30 00:14:32 INFO rasa.nlu.model - Successfully saved model into ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmpvqka562r/nlu’ NLU model training completed. Your Rasa model is trained and saved at ‘/Users/m.srinivasan/muthukumar/rasa/Rasa-Virtual-Env/models/20200330-001432.tar.gz’. (Rasa-Virtual-Env) m.srinivasan@ATTACHCREDITTONE Rasa-Virtual-Env %

However, when I do rasa run -vv , it is not using the extracted saved NLU in temp folder and is erring out .

2020-03-30 00:14:48 INFO root - Enabling coroutine debugging. Loop id 140591057928216. 2020-03-30 00:14:49 DEBUG rasa.model - Extracted model to ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmp0453afuu’. 2020-03-30 00:14:49 DEBUG rasa.utils.tensorflow.models - Loading the model … 2020-03-30 00:14:50 DEBUG rasa.utils.tensorflow.models - Finished loading the model. 2020-03-30 00:14:50 DEBUG rasa.utils.tensorflow.models - Building tensorflow prediction graph… 2020-03-30 00:14:54 DEBUG rasa.utils.tensorflow.models - Finished building tensorflow prediction graph. 2020-03-30 00:14:54 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model. Maybe the path ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmp0453afuu/nlu’ doesn’t exist? 2020-03-30 00:14:54 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore. 2020-03-30 00:14:54 DEBUG rasa.core.lock_store - Connected to lock store ‘InMemoryLockStore’. 2020-03-30 00:14:54 DEBUG rasa.model - Extracted model to ‘/var/folders/rm/1jyknqjs6n172n8w_njg4lrh0000gp/T/tmpnh7ll9r3’. 2020-03-30 00:14:54 DEBUG pykwalify.compat - Using yaml library: /Users/m.srinivasan/.pyenv/versions/3.7.2/lib/python3.7/site-packages/ruamel/yaml/ init .py

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2020

That’s what I explained here.

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Are you facing any issues in intent prediction?

post by muthukumars on Mar 30, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

I have not yet gone to intent prediction level sir. I am trying to bring up Rasa and get a clean. setup.

post by muthukumars on Mar 30, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh

am I missing any setup over here ?. probably, there must be some ENV variable to be set for Rasa to read from the trained model place rather than from regular temp space.

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

muthukumars](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2020

You won’t get to know whether it’s working fine or not unless you have tested it sir

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

muthukumars](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2020

I am using windows system so I didn’t do any environment path variable for the temp space.

post by muthukumars on Mar 30, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Got it. I will check and get back to you. I am new to Rasa. will try to see . but if you have any findings, then let me know

post by JiteshGaikwad on Mar 30, 2020

JiteshGaikwad Rasa Certified Developer

Mar 2020

Sure sir

post by muthukumars on Mar 31, 2020

muthukumarsMuthukumar Srinivasan

Mar 2020

Jitesh

I have built a separate virtual image under Vmware fusion. built a ubuntu and gone through this fully. too many things I have to fix. finally for this.but still our issue still perists. logged a bug with Rasa, see

post by lluchini on Apr 8, 2020

lluchiniLeonardo Luchini Enthusiast

1

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Apr 2020

Heloooooo again @JiteshGaikwad!

I’m trying to use your modifications, I was able to run them, even debug the socketChannel.py you made. The customData arrive there with no problem but isn’t sent to the ‘action_session_start’ event on the action server (as metadata).

File: socketChannel.py - Line: await on_new_message(message)

I’m pretty new to RASA and Python (1 week working which each), I’m trying to find why the customData isn’t sent to ‘action_session_start’ (as metadata), but my chances aren’t very good based on my current level of expertise at RASA and Python.

Can you help me?

I even had to change your method extract_metadata_from_tracker because of the events dictionary is empty and added some logs and the return is always empty:

tracker.current_state() {‘sender_id’: ‘79630f5a353f499fbec162302a30fb12’, ‘slots’: {}, ‘latest_message’: {‘intent’: {}, ‘entities’: [
], ‘text’: None, ‘message_id’: None, ‘metadata’: {}}, ‘latest_event_time’: None, ‘paused’: False, ‘events’: , 'latest_input_channel ': None, ‘active_form’: {}, ‘latest_action_name’: None}

tracker.current_state()[“events”]

2020-04-08 10:40:21.050844 MetaData:

File: actions.py


def extract_metadata_from_tracker(tracker: Tracker):
    events = tracker.current_state()['events']
    print('tracker.current_state()', tracker.current_state())
    print('tracker.current_state()["events"]', tracker.current_state()['events'])
    user_events = []
    for e in events:
        print(e)
        if e['event'] == 'user':
            user_events.append(e)

if len(user_events) > 0:
        return user_events[-1]['metadata']
    return ''

class ActionSessionStart(Action):
    def name(self) -> Text:
        return 'action_session_start'

async def run(self,
            dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict]:

metadata = extract_metadata_from_tracker(tracker)
        print(datetime.now(), 'MetaData: ', metadata)

UPDATE:

I found that the new session always send a blank tracker, so now I’m looking for other ways to pass the customData to ‘action_session_start’

post by Govindarajan on Apr 9, 2020

GovindarajanGovindarajan Ponnusamy

Apr 2020

I have clarification how to run the rasa server on rasa.ai.com (provided static IP and domain name) instead of localhost:5005, my environment is windows and offline environment (there is no access to internet)

post by lluchini on Apr 9, 2020

lluchiniLeonardo Luchini Enthusiast

lluchini](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Apr 2020

>Previously linked reply<

@JiteshGaikwad

I was able to pass the custom data to the action server, I had to modify your socketChannel.py (I’ll try to update the Github) and the processor.py from RASA.

My doubt here is how to make the changes o processor permanent? Just commit and push to RASA repo?

post by JiteshGaikwad on Apr 9, 2020

JiteshGaikwad Rasa Certified Developer

Apr 2020

hey @lluchini, sorry I was busy with something else so didn’t got time to reply you

Glad that you were able to solve it

you can make a pull request, is that what you are trying to say?

post by lluchini on Apr 9, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

@JiteshGaikwad

No prob bro, no need to apologize for, everyone does what they can! I hope someday to be good at RASA/Python to help as much you do.

Yes, I never used Github (I use git), I just need to create a pull request for yours/RASA repo with the change? like on Bitbucket from Atlassian?

And I would like to know if you can just check what I did, and be sure it won’t break anything else on RASA, can you?

post by JiteshGaikwad on Apr 9, 2020

JiteshGaikwad Rasa Certified Developer

Apr 2020

Thanks and Ya sure definitely you will

I too recently started learning about the PR, no problem you can raise the issue in the GitHub repo and tell me the changes there, I will integrate those changes, does that works for you?

post by lluchini on Apr 9, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

I don’t know if is this what you meant, but I forked RASA on my Github and pushed a branch with the adjusts, the link is below.

Github - lluchini: metada-on-session-start-action

post by JiteshGaikwad on Apr 9, 2020

JiteshGaikwad Rasa Certified Developer

Apr 2020

Hey @lluchini, sorry but that’s too complicated for me😅

post by lluchini on Apr 9, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

Your socketChannel that’s too complicated for me…

No problem, I’ll submit the pull request, let’s see what happen…

post by lluchini on Apr 9, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

Just everybody knows, it already had an issue opened for my problem Issues #5574.

I linked the open issue with my pull request…

8 days later

post by Kejender on Apr 18, 2020

Kejender

Apr 2020

Hi,

I’m replying here because my issue seems similar.

I have worked before with the early rasa_nlu and I have one computer (Ubuntu 18.04) with working Rasa 1.3.1 installation. Now I wanted to install new Rasa to my new server, create a new bot and connect it to Webchat. This works fine in that old computer, Webchat also.

I have the latest Rasa version in Ubuntu 18.04 (Python 3.6) server. First I tried to install it to venv but it kept failing. Maybe I got it wrong somehow. But it is now installed in the server. ‘Rasa init’ worked fine.

When I run ‘rasa run –enable-api’ –cors “*” –debug’, Rasa server starts’. The same error “Failed to load model” as was discussed earlier. However the model gets extracted later.

In my web server Webchat tries to GET http://localhost:5005/socket.io/… but there is ERR_CONNECTION_REFUSED.

If I curl localhost:5005, I get “Hello from RASA”.

Credentials.yml (socketio) should be configured fine, as I have this working in the other computer.

Any suggestions what to try next?

post by lluchini on Apr 20, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

Hello @Kejender,

can you start rasa with debug option post the logs from rasa here so we can check with more details what’s happening?

post by Kejender on Apr 21, 2020

Kejender

Apr 2020

Ok here it is:


2020-04-21 07:45:03,802 [DEBUG]  Available web server routes:
/conversations/<conversation_id>/messages          POST                           add_message
/conversations/<conversation_id>/tracker/events    POST                           append_events
/webhooks/rasa                                     GET                            custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook                             POST                           custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET                            custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST                           custom_webhook_RestInput.receive
/model/test/intents                                POST                           evaluate_intents
/model/test/stories                                POST                           evaluate_stories
/conversations/<conversation_id>/execute           POST                           execute_action
/domain                                            GET                            get_domain
/socket.io                                         POST                           handle_request
/                                                  GET                            hello
/model                                             PUT                            load_model
/model/parse                                       POST                           parse
/conversations/<conversation_id>/predict           POST                           predict
/conversations/<conversation_id>/tracker/events    PUT                            replace_events
/conversations/<conversation_id>/story             GET                            retrieve_story
/conversations/<conversation_id>/tracker           GET                            retrieve_tracker
/webhooks/socketio                                 GET                            socketio_webhook.health
/status                                            GET                            status
/model/predict                                     POST                           tracker_predict
/model/train                                       POST                           train
/conversations/<conversation_id>/trigger_intent    POST                           trigger_intent
/model                                             DELETE                         unload_model
/version                                           GET                            version
2020-04-21 07:45:03,804 [INFO ]  Starting Rasa server on http://localhost:5005
2020-04-21 07:45:03,804 [DEBUG]  Using the default number of Sanic workers (1).
2020-04-21 07:45:03,806 [INFO ]  Enabling coroutine debugging. Loop id 94055192.
2020-04-21 07:45:04,154 [DEBUG]  Extracted model to '/tmp/tmparlo_dm9'.
2020-04-21 07:45:04,486 [DEBUG]  Loading the model ...
2020-04-21 07:45:05,578 [DEBUG]  Finished loading the model.
2020-04-21 07:45:05,579 [DEBUG]  Building tensorflow prediction graph...
2020-04-21 07:45:10,674 [DEBUG]  Finished building tensorflow prediction graph.
2020-04-21 07:45:10,680 [DEBUG]  Failed to load model for 'ResponseSelector'. Maybe you did not provide enough training data and no model was trained or the path '/tmp/tmparlo_dm9/nlu' doesn't exist?
2020-04-21 07:45:10,691 [DEBUG]  Connected to InMemoryTrackerStore.
2020-04-21 07:45:10,691 [DEBUG]  Connected to lock store 'InMemoryLockStore'.
2020-04-21 07:45:11,070 [DEBUG]  Extracted model to '/tmp/tmp8_f862mu'.
2020-04-21 07:45:11,074 [DEBUG]  Using yaml library: /usr/local/lib/python3.6/dist-packages/ruamel/yaml/__init__.py
2020-04-21 07:45:11,098 [DEBUG]  Loading the model ...
2020-04-21 07:45:11,364 [DEBUG]  Finished loading the model.
2020-04-21 07:45:11,367 [DEBUG]  Building tensorflow prediction graph...
2020-04-21 07:45:12,278 [DEBUG]  Finished building tensorflow prediction graph.
2020-04-21 07:45:12,283 [DEBUG]  Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.

post by Kejender on Apr 22, 2020

Kejender

Apr 2020

I think I know what the problem is. I’m serving the Webchat app with Apache. It is probably not allowing access to Rasa server. I’m trying to find out how to configure it.

Any alternative server suggestions are welcome! Also if you find anything wrong with the Rasa server logs, please reply…

post by Kejender on Apr 22, 2020

Kejender

Apr 2020

I guess Apache is not the problem: I tested the app with my laptop’s Apache and it worked. There should not be any special configurations there.

post by lluchini on Apr 22, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

Hello @Kejender,

The only line with fail on load is the one below, so I’ll plot the answer on it.

It says that is the model for the component ResponseSelector so I dug a little and found this link on documentation.

Link: faqs-response-selector

Reading the documentation I started to wonder that you configured your config.yml to use the ResponseSelector component but didn’t feed the responses.md file.

Can you check the items above and if it’s not any of them reply with all your configs files?

Cya!

post by Kejender on Apr 23, 2020

Kejender

Apr 2020

Hi, thanks. I removed the ResponseSelector and that error is not coming any longer. This is the initial “moodbot”, created with rasa init. The problem still persists. I still suspect it is related to Apache. I have been checking the .conf files in both servers but they seem similar.

post by lluchini on Apr 23, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

@Kejender,

1o. You’re welcome!

2o. Don’t you have a registry of the attempts anywhere? (rasa, apache, OS logs, firewall, proxy and etc.)

Any additional information can help us to help you…

post by Kejender on Apr 23, 2020

Kejender

Apr 2020

I may have a solution coming up, let’s see tomorrow…

post by lluchini on Apr 23, 2020

lluchiniLeonardo Luchini Enthusiast

Apr 2020

@Kejender

Great!!!

Please share with us if it works!

post by Kejender on May 1, 2020

Kejender

May 2020

Hi! Now it is working. I’m afraid I had some misconceptions about networking. I’m still not sure if I fixed it right, feel free to comment…my bot is in my internal network so it should be safe.

First I had to open the port 5005 in my server. Then in WebChat’s configuration, replaced “localhost” with server’s public ip.

post by lluchini on May 3, 2020

lluchiniLeonardo Luchini Enthusiast

May 2020

Hello @Kejender,

glad it worked out!

Please mark your reply as solution.

Cya!

1 month later

post by tusharm78 on Jun 7, 2020

tusharm78

Jun 2020

Hey buddy…thanks for such an informative tutorial…could you please help me in putting the persistent menu in the header for the webchat widget that is there in botfront or other tutorials…i’ve added the webchat code in my dummy website and there it is a REACT code, so how to bring the persistent menu in header with the options of Clear, Restart, and Close. help wud be much appreciated. thnx

post by lkrishnaprasad on Jun 9, 2020

lkrishnaprasad

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jun 2020

@JiteshGaikwad i followed this instructions but i got blank values

11 days later

post by JiteshGaikwad on Jun 20, 2020

JiteshGaikwad Rasa Certified Developer

Jun 2020

@lkrishnaprasad can you show error logs or screenshot?

post by lkrishnaprasad on Jun 21, 2020

lkrishnaprasad

Jun 2020

This problem is resolved. Thanks. i had missed some steps you had given. Now its okay.

18 days later

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

Aashay1](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

Hey @Aashay1. I’m stuck in the same situation. I need to send the userid from my website session data to chatbot and set in my custom action and pass on to the api. How do i do that?

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

lkrishnaprasad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

Were you able to retrieve data from your website to bot using customData and print it?

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

@JiteshGaikwad I need help in sending the data in my website session i.e., userId to my api via custom actions using customData.

post by Aashay1 on Jul 9, 2020

Aashay1Aashay

shanrock](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

// Or you can replace latest with a specific version

WebChat.default.init({ selector: "#webchat", initPayload : '/get_started{"userID":"163","user_name":"Aashay"}' , customData:{"userID":"163","user_name":"Aashay"}, // arbitrary custom data. Stay minimal as this will be added to the socket socketUrl: "http://localhost:5005", socketPath: "/socket.io/", title: "Beehive Bot", subtitle: "I'am still under development", params :{ storage : "session" } })

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

2

Jul 2020

Hey do you have a email or something? This work needs more contact than just comments.

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

Aashay1](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

Why you defined UserID twice? Once in payload and once in customData? And also like is there a way where i can pass session data in my website to customdata

post by lkrishnaprasad on Jul 9, 2020

lkrishnaprasad

shanrock](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

Yes

post by shanrock on Jul 9, 2020

shanrockShanmukh Gudivada

Jul 2020

Can you please be more elaborate?

post by shanrock on Jul 14, 2020

shanrockShanmukh Gudivada

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Jul 2020

Hey. Im unable to pull emp_no from my PHP application to rasa using customData.

20 days later

post by faiza_conte on Aug 3, 2020

faiza_contefaiza abdella

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Aug 2020

how to use ‘action_restart’ …after i refrash the web the past conversation of the chat still exists…why is that?

23 days later

post by nik202 on Aug 26, 2020

nik202 Enthusiast

Aug 2020

Hello @JiteshGaikwad can we use your custom widget GitHub - JiteshGaikwad/Chatbot-Widget: ChatBot widget easy to connect to RASA bot through REST channel rather then webchat? which shows in the video. If so how we can make <script> tag similar like this as you copied from the rasa-webchat GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront :


<div id="webchat"></div>
<script src="https://cdn.jsdelivr.net/npm/rasa-webchat/lib/index.min.js"></script>
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/welcome",
    customData: {"language": "en"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5005",
    socketPath: "/socket.io/",
    title: "xyz",
    subtitle: "bot",
    params: {"storage": "session"} // can be set to "local"  or "session". details in storage section.
  })
</script>

post by JiteshGaikwad on Aug 26, 2020

JiteshGaikwad Rasa Certified Developer

Aug 2020

No

post by Priyu on Aug 27, 2020

PriyuPriyanka Chaudhari

Aashay1](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Aug 2020

Can you please share your github link for better understanding?

post by nik202 on Aug 27, 2020

nik202 Enthusiast

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Aug 2020

@JiteshGaikwad Any suggestion how to deal this? Your idea and suggestion always help. Many thanks in advance.

post by Priyu on Aug 27, 2020

PriyuPriyanka Chaudhari

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Aug 2020

It works. Thank You!!

post by InnoOmnia on Sep 2, 2020

InnoOmnia

Sep 2020

Video is not available any more

1 month later

post by red on Oct 9, 2020

redab

Oct 2020

Can you give access to the video about Rasa webchat integration

2 months later

post by kurtsenol on Nov 23, 2020

kurtsenolsenol

JiteshGaikwad](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Nov 2020

I follow all the steps but metadata returns None!

17 days later

post by kiranbeethoju on Dec 11, 2020

kiranbeethojuRasa Certified Developer

andrew.tangowork](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Dec 2020

You can display a carousel with buttons using facebook generic carousel code actions.py when you are using Mr.Robots chatbot widget js for front-end.

10 days later

post by Zaamine on Dec 21, 2020

ZaamineAmine Zaamoun

Dec 2020

Hello @JiteshGaikwad, do you know how to trigger a particular event when a user pushes a button ?

I will give you a concrete exemple of what I’m trying to achieve : The chatbot utters two buttons (using the payload syntax from rasa) “Log In” and “Register”

When the user pushes one of the two buttons, the “create an account form” or the “log in form” will be opened in the window using javascript.

I know that this can be achieved using a link in the buttons but the issue is that my “log in form” is opened directly in the web browser of the user using javascript dynamically so I cannot use link for that.

The user also logs in to his account using an ajax call so he can directly be informed if his password or username is wrong without even reloading the page)

I don’t know if it’s clear enough but any help would be really appreciated, many thanks

post by forwitai on Dec 28, 2020

forwitaiEnthusiast

Dec 2020

Can someone please tell me where can I find the conversations users have with my bot through webchat ? I can’t find them on Rasa X.

Thanks a lot.

3 months later

post by Horizon733 on Mar 15, 2021

Horizon733Dishant GandhiRasa Superhero

Mar 2021

I created a quick tutorial on webchat integration with Rasa chatbot if you have any questions you can comment there or reply here,

Here’s the link:

Rasa chatbot website integration | Quick tutorial

post by Horizon733 on Mar 15, 2021

Horizon733Dishant GandhiRasa Superhero

forwitai](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Mar 2021

Is it working, which version you are using currently?

18 days later

post by ketang on Apr 2, 2021

ketangKetan

Apr 2021

@JiteshGaikwad I want to implement auto suggestion feature when user types in query in webchat. Can you help me giving idea how can I implement that on UI?

17 days later

post by Harshika on Apr 19, 2021

HarshikaPareek

Horizon733](https://forum.rasa.com/t/rasa-webchat-integration/19930 "Load parent post")

Apr 2021

@Horizon733 Helo, this is very helpful to me. I am able to work with this. However I stuck at one place where I am unable to open the Chatbot UI (with the error "Connected and disconnected SocketIO), I haven’t changed anything so far in my index.html, config and cred files.

Cred.yml

index.html

\ image921×767 35 KB](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/e/e265947857a6e3490cf94c703ce9dffdb3db8abd.png "image")

can you help me where exactly could be a problem ?

post by Horizon733 on Apr 19, 2021

Horizon733Dishant GandhiRasa Superhero

Apr 2021

Hi, since when you are trying this. Because since yesterday botfront latest version is not working. I just changed the url in e.src="…/rasa-webchat@1.0.0/…" Make sure to replace … With the respective sections in url

post by Harshika on Apr 19, 2021

HarshikaPareek

Apr 2021

wow, that’s grand. Worked for me. Thank you very much for your quick response and help.

Load more posts below

Loading complete

We collect and process your personal information for the following purposes: Visitor Statistics, Browsing Behavior. Learn more...

OKDecline