Google chat (Hangouts) trigger intent externally with hanoguts channel

Hi,

I’m trying to trigger an intent externally over HTTP request to Google chat but it doesn’t seem to work. I tried it with socketio channel over a chat widget and it worked normally but with hangouts channel nothing is happening. (Although the bot is connected to the google chat and answers queries normally, I’m just having a problem with external triggers)

Here is the curl request being used:

curl -H “Content-Type: application/json” -X POST
-d ‘{“name”: “intent_16”}’
https://d66a-95-91-212-189.ngrok.io/conversations/tCXmEYgdl1rV19wrAAAB/trigger_intent?output_channel=hangouts&token=*********”

I tried also with output_channel=latest but didn’t work. Any idea what I can try next or any help would be great. Thanks!

@lo2aayy Could you please specify which rasa version you’re using; also could you share any logs you get when you try to trigger an intent with curl? What is the response code you get?

I’m using Rasa 2.8.7

The response code is 200, and the correct response is actually written in the response log, just not in hangouts chat itself.

and the log looks like following:

{"tracker":{"sender_id":"Louay Abdelgawad (DEV)","slots":{"session_started_metadata":{"room":null}},"latest_message":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"latest_event_time":1646315653.858621,"followup_action":null,"paused":false,"events":[{"event":"session_started","timestamp":1646315333.674176,"metadata":{"room":null}},{"event":"slot","timestamp":1646315333.67419,"name":"session_started_metadata","value":{"room":null}},{"event":"slot","timestamp":1646315333.6741946,"name":"session_started_metadata","value":{"room":null}},{"event":"slot","timestamp":1646315333.6741986,"name":"session_started_metadata","value":{"room":null}},{"event":"slot","timestamp":1646315333.674202,"name":"session_started_metadata","value":{"room":null}},{"event":"slot","timestamp":1646315333.6742053,"name":"session_started_metadata","value":{"room":null}},{"event":"slot","timestamp":1646315333.6742089,"name":"session_started_metadata","value":{"room":null}},{"event":"action","timestamp":1646315333.674212,"name":"action_listen","policy":null,"confidence":null,"action_text":null,"hide_rule_turn":false},{"event":"user","timestamp":1646315333.7210796,"metadata":{"room":null},"text":"netchat","parse_data":{"intent":{"id":7517502173507815587,"name":"1686","confidence":0.9889973402023315},"entities":[],"text":"netchat","message_id":"b024d45994b944818069d8bd45cc54ae","metadata":{"room":null},"intent_ranking":[{"id":7517502173507815587,"name":"1686","confidence":0.9889973402023315},{"id":7863403675739732242,"name":"1690","confidence":0.004761730320751667},{"id":8147326128114466475,"name":"1689","confidence":0.0035699508152902126},{"id":-5190749784184421112,"name":"3","confidence":0.0009845986496657133},{"id":2146135755032964761,"name":"1688","confidence":0.0005283741629682481},{"id":-7683935882799476084,"name":"1712","confidence":0.0005161151639185846},{"id":1439679419925695995,"name":"1586","confidence":0.00035375627339817584},{"id":6573045293157943272,"name":"1692","confidence":0.00020377109467517585},{"id":1382744554936712917,"name":"4","confidence":5.037866503698751e-5},{"id":3024232771377847567,"name":"1699","confidence":3.401880167075433e-5}]},"input_channel":"hangouts","message_id":"b024d45994b944818069d8bd45cc54ae"},{"event":"user_featurization","timestamp":1646315333.7244065,"use_text_for_featurization":false},{"event":"action","timestamp":1646315333.724421,"name":"utter_1686","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315333.7245028,"metadata":{"utter_action":"utter_1686"},"text":"Netchat is a private Google Currents community where you can start to grow your network and benefit from the exchange with other Senior Associates from PwC Europe.","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315333.7268393,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315350.2852685,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315350.2878249,"use_text_for_featurization":false},{"event":"action","timestamp":1646315350.28784,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315350.2879274,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315350.2897553,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315461.5736718,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315461.5767717,"use_text_for_featurization":false},{"event":"action","timestamp":1646315461.5767882,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315461.5768726,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315461.5788627,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315612.0221124,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315612.0249622,"use_text_for_featurization":false},{"event":"action","timestamp":1646315612.0249774,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315612.0250576,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315612.0270135,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315633.2295637,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315633.2326603,"use_text_for_featurization":false},{"event":"action","timestamp":1646315633.232675,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315633.2327569,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315633.234858,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315647.074779,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315647.0784323,"use_text_for_featurization":false},{"event":"action","timestamp":1646315647.0784528,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315647.0785484,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315647.0809693,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"user","timestamp":1646315653.85269,"metadata":{"is_external":true},"text":"EXTERNAL: 1699","parse_data":{"intent":{"name":"1699"},"entities":[],"text":"EXTERNAL: 1699","message_id":null,"metadata":{"is_external":true}},"input_channel":"hangouts","message_id":null},{"event":"user_featurization","timestamp":1646315653.856156,"use_text_for_featurization":false},{"event":"action","timestamp":1646315653.8561718,"name":"utter_1699","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true},{"event":"bot","timestamp":1646315653.8562512,"metadata":{"utter_action":"utter_1699"},"text":"Hi, how can I help you?","data":{"elements":null,"quick_replies":null,"buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}],"attachment":null,"image":null,"custom":null}},{"event":"action","timestamp":1646315653.858621,"name":"action_listen","policy":"policy_3_RulePolicy","confidence":1.0,"action_text":null,"hide_rule_turn":true}],"latest_input_channel":"hangouts","active_loop":{},"latest_action":{"action_name":"action_listen"},"latest_action_name":"action_listen"},"messages":[{"recipient_id":"Louay Abdelgawad (DEV)","text":"Hi, how can I help you?","buttons":[{"title":"not helpful","payload":"That did not help"},{"title":"helpful","payload":"Thanks, that was helpful"}]}]}

@lo2aayy If I’m reading the docs correctly, in the output_channel section, it seems Google Hangouts channel is not listed in the permitted values of the output_channel query parameter. Which explains why you can’t see in the hangouts chat, although the response code is 200.

Many thanks Anca. Would you be able to give us the reasoning behind this? What would be your advice or your colleagues advice if we wanted to set this up regardless?

I’m not entirely sure if there is a technical limitation from Google Hangouts or something that was deprioritised during API build. You could submit a feature request in Github and contribute with an implementation proposal that you can then go ahead and submit a PR for?