This image shows a python file with exactly the same code(without rasa part). The python file runs fine and returns the above expected output. But during the execution of custom action of rasa, the response is empty(). It returns this error:
I am not able to understand the problem here.