Event loop is getting locked while sending large database query result as json_message in custom action

Hi everyone,

I am sending the large json from database query result as the json_message in dispatcher.utter_message() in custom action.

But I am getting this type of warning in “rasa run -m models --enable-api --cors ‘*’ --debug”:

venv\lib\site-packages\aiohttp\payload.py:228: ResourceWarning: Sending a large body directly with raw bytes might lock the event loop. you should probably pass an io.BytesIO object instead.

how to resolve this issue and stop the event loop from locking so that the custom actions run asynchronously.