I have a bot which makes a request on an api that is implemented with fastapi(but it is not asynchronous). I want the bot not to be blocked when I call it from action server, as it takes more than 30 seconds the response to come. I have implemented the following code in actions.py but does not work. When I test it in rasa shell, the console is blocked until the response come back. What am I missing
class ActionTest(Action):
def name(self) -> Text:
return "action_test"
async def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
async with aiohttp.ClientSession() as session:
async with session.get("non async api url") as resp:
response = await resp.json()
dispatcher.utter_message(text=response["abstract"])
return []