Hi everyone,
I’m trying to follow this example https://rasa.com/docs/rasa/reaching-out-to-user#external-events I was able to send a POST request to trigger an intent and therefore an action but I’m not receiving the message from the action server.
https://github.com/joaomsimoes/rasa_hl the github repo.
The POST request.
curl -H "Content-Type: application/json" -X POST \
-d '{"name": "EXTERNAL_notification"}' \
"http://localhost:5005/conversations/2079662765/trigger_intent"
The bot received the POST request and triggered the right intent and action, but the action server is not sending the message back to the bot. On the NotificationToUser class, I did write a print() message to debug and every time I send the post request I can see the printed message in the console. Meaning that everything is working until this point (?). But I don’t receive the message in Telegram. I also created two other actions that are actually working with no problems.
The logs from the POST request
{
"tracker": {
"sender_id": "2079662765",
"slots": {
"session_started_metadata": null
},
"latest_message": {
"intent": {
"name": "EXTERNAL_notification"
},
"entities": [],
"text": "EXTERNAL: EXTERNAL_notification",
"message_id": null,
"metadata": {
"is_external": true
}
},
"latest_event_time": 1671602339.587904,
"followup_action": null,
"paused": false,
"events": [
{
"event": "action",
"timestamp": 1671602322.3021328,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_session_start",
"policy": null,
"confidence": 1.0,
"action_text": null,
"hide_rule_turn": false
},
{
"event": "session_started",
"timestamp": 1671602322.3021328,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
}
},
{
"event": "action",
"timestamp": 1671602322.3021328,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_listen",
"policy": null,
"confidence": null,
"action_text": null,
"hide_rule_turn": false
},
{
"event": "user",
"timestamp": 1671602322.3173356,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"text": "id",
"parse_data": {
"intent": {
"name": "get_id",
"confidence": 0.8244315981864929
},
"entities": [],
"text": "id",
"message_id": "22960d09556d4e25bc7d0b38b1b98e63",
"metadata": {},
"text_tokens": [
[
0,
2
]
],
"intent_ranking": [
{
"name": "get_id",
"confidence": 0.8244315981864929
},
{
"name": "affirm",
"confidence": 0.149237722158432
},
{
"name": "goodbye",
"confidence": 0.025942504405975342
},
{
"name": "deny",
"confidence": 0.0003484852204564959
},
{
"name": "knowledge_question",
"confidence": 3.974913852289319e-5
}
],
"response_selector": {
"all_retrieval_intents": [],
"default": {
"response": {
"responses": null,
"confidence": 0.0,
"intent_response_key": null,
"utter_action": "utter_None"
},
"ranking": []
}
}
},
"input_channel": "telegram",
"message_id": "22960d09556d4e25bc7d0b38b1b98e63"
},
{
"event": "user_featurization",
"timestamp": 1671602324.4174042,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"use_text_for_featurization": false
},
{
"event": "action",
"timestamp": 1671602324.4174042,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_get_id",
"policy": "RulePolicy",
"confidence": 1.0,
"action_text": null,
"hide_rule_turn": true
},
{
"event": "bot",
"timestamp": 1671602324.4174042,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"text": "The ID of this conversation is '2079662765'.",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
}
},
{
"event": "action",
"timestamp": 1671602324.5494268,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_listen",
"policy": "RulePolicy",
"confidence": 1.0,
"action_text": null,
"hide_rule_turn": true
},
{
"event": "user",
"timestamp": 1671602337.4851956,
"metadata": {
"is_external": true,
"model_id": "c8972d269a274335ba6436410b075686"
},
"text": "EXTERNAL: EXTERNAL_notification",
"parse_data": {
"intent": {
"name": "EXTERNAL_notification"
},
"entities": [],
"text": "EXTERNAL: EXTERNAL_notification",
"message_id": null,
"metadata": {
"is_external": true
}
},
"input_channel": "telegram",
"message_id": null
},
{
"event": "user_featurization",
"timestamp": 1671602339.5838938,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"use_text_for_featurization": false
},
{
"event": "action",
"timestamp": 1671602339.5838938,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_notification_to_user",
"policy": "RulePolicy",
"confidence": 1.0,
"action_text": null,
"hide_rule_turn": true
},
{
"event": "bot",
"timestamp": 1671602339.5838938,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"text": "This is a test!!",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
}
},
{
"event": "action",
"timestamp": 1671602339.587904,
"metadata": {
"model_id": "c8972d269a274335ba6436410b075686"
},
"name": "action_listen",
"policy": "RulePolicy",
"confidence": 1.0,
"action_text": null,
"hide_rule_turn": true
}
],
"latest_input_channel": "telegram",
"active_loop": {},
"latest_action": {
"action_name": "action_listen"
},
"latest_action_name": "action_listen"
},
"messages": [
{
"recipient_id": "2079662765",
"text": "This is a test!!"
}
]
}
I’m using the bot in Telegram.
Rasa Version : 3.4.0
Minimum Compatible Version: 3.0.0
Rasa SDK Version : 3.4.0
Python Version : 3.10.6
Operating System : Windows-10-10.0.22000-SP0
Thank you in advance!