rasa-demo
rasa-demo copied to clipboard
Sync call in actions
I noticed in the actions that we're using requests to do a synchronous HTTP call: https://github.com/RasaHQ/rasa-demo/blob/master/actions/actions.py#L772 , instead of using httpx to make an asynchronous HTTP call.
From what I can tell, the Rasa SDK is an asynchronous Sanic web service, so we don't want to be doing synchronous HTTP calls in it.
Is this the case? Or have I not looked deeply enough into the SDK code, and we're actually calling the action in a thread?
Thanks for the issue, @akelad will get back to you about it soon!
You may find help in the docs and the forum, too 🤗
Hey @rudigiesler -- you make a good point! It would probably make more sense for us to make asyncronous requests, similar to what is used in the rasa library: https://github.com/RasaHQ/rasa/blob/6e23dd3b5dca719014386dc31adf0ff1cb7197f7/rasa/utils/endpoints.py#L122
We haven't even made our run methods async yet since the SDK was ported to sanic -- it'd be a cool contribution to the project!