RASA / RocketChat integration using webhook and RasaApp

Hello everyone,

Description:

I’m currently trying to integrate RASA with RocketChat, both hosted on a private VM accessible only through a VPN (private network). I have followed the instructions provided by the Apps.Rasa repository and the RASA connectors documentation.

Rasa Marketplace App Logs (with RocketChat:

Instance: 4fd6abd1-c4ef-47e9-991f-c1e797775e5b
debug: 2023-06-26T00:48:23.852Z Caller: anonymous OR constructor
[
  "executePostMessageSent is being called..."
]
debug: 2023-06-26T00:48:23.857Z Caller: anonymous OR constructor
[
  "'executePostMessageSent' was successfully called! The result is:",
  null
]

Rasa Status:

I am using the following command to run Rasa: rasa run -p 5005 --cors ‘*’ --credentials credentials.yml --connector rocketchat. I can access the status via http://192.168.102.109:5005/. The response I receive is: “Hello from Rasa: 3.6.0”.

RocketChat Webhook Status:

I can access the webhook status via http://http://192.168.102.109:5005/webhooks/rocketchat/. The response I receive is: {"status":"ok"}.

RocketChat Webhook Test:

To test the webhook, I am using the following curl command: curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello"}'. The response I receive is: http://<IP>:5005/webhooks/rest/webhook. The response from the webhook is: [{"recipient_id":"default","text":"Hey! How are you?"}].

Docker: RocketChat Details:

Rocket.Chat Version: 6.2.5
NodeJS Version: 14.21.3 - x64
MongoDB Version: 5.0.18
MongoDB Engine: wiredTiger
Platform: linux
Process Port: 3000
Site URL: http://192.168.102.109:3000 
ReplicaSet OpLog: Enabled
Commit Hash: 8f9668897c
Commit Branch: HEAD

RASA Details:

Rasa Version      :         3.5.8
Minimum Compatible Version: 3.5.0
Rasa SDK Version  :         3.5.1
Python Version    :         3.9.16

Rasa debug mode logs using rasa run -p 5005 --cors "*" --credentials credentials.yml --connector rocketchat --debug

/                                                  GET                            rasa_core_no_api.hello
/webhooks/rocketchat                               GET                            rasa_core_no_api.rocketchat_webhook.health
/webhooks/rocketchat/webhook                       POST                           rasa_core_no_api.rocketchat_webhook.webhook
2023-06-26 01:01:30 INFO     root  - Starting Rasa server on http://0.0.0.0:5005
2023-06-26 01:01:30 DEBUG    rasa.core.utils  - Using the default number of Sanic workers (1).
2023-06-26 01:01:32 DEBUG    urllib3.connectionpool  - Starting new HTTPS connection (1): api.segment.io:443
2023-06-26 01:01:33 DEBUG    urllib3.connectionpool  - https://api.segment.io:443 "POST /v1/track HTTP/1.1" 200 21
..
...
2023-06-26 01:01:33 DEBUG    rasa.core.tracker_store  - Connected to InMemoryTrackerStore.
2023-06-26 01:02:06 DEBUG    rasa.utils.tensorflow.models  - Loading the model from /tmp/tmpt1jjmlb9/train_TEDPolicy3/ted_policy.tf_model with finetune_mode=False...
2023-06-26 01:02:21 DEBUG    rasa.utils.tensorflow.models  - Finished loading the model.
2023-06-26 01:02:21 DEBUG    rasa.engine.graph  - Node 'rule_only_data_provider' loading 'RuleOnlyDataProvider.load' and kwargs: '{}'.
2023-06-26 01:02:21 DEBUG    rasa.engine.storage.local_model_storage  - Resource 'train_RulePolicy1' was requested for reading.
2023-06-26 01:02:21 DEBUG    rasa.engine.graph  - Node 'select_prediction' loading 'DefaultPolicyPredictionEnsemble.load' and kwargs: '{}'.
2023-06-26 01:02:21 INFO     root  - Rasa server is up and running.
2023-06-26 01:02:21 INFO     root  - Enabling coroutine debugging. Loop id 94704849999392.

@dudanogueira