rasa-demo icon indicating copy to clipboard operation
rasa-demo copied to clipboard

Sync call in actions

Open rudigiesler opened this issue 5 years ago • 2 comments

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?

rudigiesler avatar Jun 17 '20 08:06 rudigiesler

Thanks for the issue, @akelad will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

sara-tagger avatar Jun 17 '20 12:06 sara-tagger

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!

erohmensing avatar Jun 23 '20 11:06 erohmensing