I installed Rasa 1.9.6, generated the default project as described in the Rasa Basics tutorial. I confirmed this works in the shell.
I also have a bot on Telegram, and have confirmed the bot works using a separate library.
I ran Rasa with my bot details in credentials.yml
using ngrok to tunnel webhook requests to localhost.
Everything seems to work, from the debug output I can see the webhook is set up.
2020-04-22 12:17:10 DEBUG telegram.bot - Entering: set_webhook
2020-04-22 12:17:10 DEBUG telegram.vendor.ptb_urllib3.urllib3.connectionpool - Starting new HTTPS connection (1): api.telegram.org
2020-04-22 12:17:12 DEBUG telegram.vendor.ptb_urllib3.urllib3.connectionpool - https://api.telegram.org:443 "POST /bot<mytoken>/setWebhook HTTP/1.1" 200 57
2020-04-22 12:17:12 DEBUG telegram.bot - True
2020-04-22 12:17:12 DEBUG telegram.bot - Exiting: set_webhook
All good so far, but I don’t see any response in Telegram. Each time I send the bot a message in Telegram I can see Rasa performs a GET to /bot<myid>/getMe
e.g.
2020-04-22 12:17:26 DEBUG telegram.bot - Entering: get_me
2020-04-22 12:17:26 DEBUG telegram.vendor.ptb_urllib3.urllib3.connectionpool - https://api.telegram.org:443 "GET /bot<mycredentials>/getMe HTTP/1.1" 200 196
2020-04-22 12:17:26 DEBUG telegram.bot - {'id': 1150041222, 'first_name': 'InChatBot', 'is_bot': True, 'username': 'InChatDesignBot'}
2020-04-22 12:17:26 DEBUG telegram.bot - Exiting: get_me
2020-04-22 12:17:26 DEBUG rasa.core.channels.telegram - Invalid access token, check it matches Telegram
2020-04-22 12:21:20 DEBUG telegram.bot - Entering: get_me
2020-04-22 12:21:20 DEBUG telegram.vendor.ptb_urllib3.urllib3.connectionpool - https://api.telegram.org:443 "GET /bot<mycredentials>/getMe HTTP/1.1" 200 196
2020-04-22 12:21:20 DEBUG telegram.bot - {'id': 1150041222, 'first_name': 'InChatBot', 'is_bot': True, 'username': 'InChatDesignBot'}
2020-04-22 12:21:20 DEBUG telegram.bot - Exiting: get_me
2020-04-22 12:21:20 DEBUG rasa.core.channels.telegram - Invalid access token, check it matches Telegram
In logs above it looks like the getMe requests works fine, but then there’s the line saying rasa.core.channels.telegram - Invalid access token, check it matches Telegram
- ???
Another thing I notice is that when I inspect the POST requests to the Rasa webook endpoint on ngrok it says the response is 200 OK
but then the response content is failed
- ???
Can someone point me in the right direction?
Edit: Something that might be relevant is a warning I get when I first run rasa 2020-04-22 12:17:12.614709: E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)
Edit 2: Another thing I hadn’t notice in logs until now is the following:
2020-04-22 14:50:00 DEBUG rasa.nlu.classifiers.diet_classifier - Failed to load model for 'ResponseSelector'. Maybe you did not provide enough training data and no model was trained or the path '/tmp/tmputhg6qvt/nlu' doesn't exist?
I tried running rasa with the API enabled: rasa run -vv --enable-api
. It returns a response when I send requests via curl:
$ curl -d '{ "text": "Hello", "message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a" }' -H "Content-Type: application/json" -X POST http://localhost:5005/model/parse
{"intent":{"name":"greet","confidence":0.9954654574},"entities":[],"intent_ranking":[{"name":"greet","confidence":0.9954654574},{"name":"bot_challenge","confidence":0.0036696936},{"name":"mood_great","confidence":0.0003250062},{"name":"goodbye","confidence":0.0002903836},{"name":"mood_unhappy","confidence":0.0001085473},{"name":"affirm","confidence":0.0001025955},{"name":"deny","confidence":0.0000382178}],"response_selector":{"default":{"response":{"name":null,"confidence":0.0},"ranking":[],"full_retrieval_intent":null}},"text":"Hello"}