PerfectFit-project / virtual-coach-issues

Central issues-only repository for tracking all issues for the PerfectFit Virtual Coach System.
2 stars 1 forks source link

Cannot handle multiple users when using custom channel #382

Closed wbaccinelli closed 1 year ago

wbaccinelli commented 1 year ago

The externally triggered dialogs are currently setup in such a way that the response is send, through Rasa's custom_channels, to the niceday_api. After testing with multiple accounts at the same time, we saw that this flow cannot process multiple requests in parallel. Moreover, the niceday_api is very slow. This results in very very long response time and, sometimes, in the failure of the requests.

Moving the handling of the response messages to celery, going through the already existing scheduler, is the preferred solution. Looking deeper and painfully into the custom channels implementation, I realized that there is no way (with external triggers) to collect all the responses produced by Rasa at once after the trigger, but every utterance has to be processed immediately. So, it is not possible to use delays between messages.

A solution is to get the Rasa response directly in the scheduler (which is also triggering the intent) and let it handle the response directly. This is much more efficient and assures a higher level of control over the process.

While implementing this, another problem occurred. The message service implemented in the niceday_api is buggy (see this issue). So the effective solution of this issue depends on this as well.