Rasa: Auto Reload actions on editing

Created on 21 Jul 2019  路  13Comments  路  Source: RasaHQ/rasa

Auto reloading actions server on edit:
Currently, every time I edit the actions file I have to stop the rasa actions server and restart it. It is kind of overkill since you already built your model and just tweaking with actions.

Overview of the Solution:
Sanic server comes with a DEBUG mode. We can incorporate it into rasa run actions command as an option to enable reloading server.

Definition of Done:
What needs to be there to consider this feature as done?

  • [ ] Tests are added
  • [ ] Feature is documented
  • [ ] rasa run actions --debug
area type

All 13 comments

I can work on this if we think this feature is important.

Thanks for the suggestion! what does the implementation for that look like? cc @wochinge

@bhavaniravi just my 2 cents, I think as we have --debug already mostly for increased logs, I wouldn't like this implementation to go under that flag, as it would be surprise new changed functionality. I'd prefer a new descriptive flag, for example --hot-reload or something like that. not sure what @wochinge thinks though

I am not hooked to what it's called. I think this feature would help developing actions much easier

I agree with @erohmensing . We shouldn't do this with --debug. How about using --auto-reload or --hot-reload and then setting auto_reload=True ( https://sanic.readthedocs.io/en/latest/sanic/debug_mode.html#manually-setting-auto-reload).

@bhavaniravi Did you try out whether this actually works when you change the actions.py?

I checked out rasa_sdk codebase and executor is written in such a way that the function references are held in a dict and called accordingly, which means the edit on those references will not reload the Flask or WsgiServer used.

that's what I thought 馃槥 Thanks for checking it out!

I am not sure iti s relevant how the functions are stored as long as the modules are loaded.

The only thing we should need to do is "reload" the function in debug mode

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@tmbo so it is possible then? In that case @bhavaniravi are you still interested in implementing this functionality?

yes, sanic already has this build in, so we should reuse it's hot reload functionality. not sure if we run into issues though, e.g. https://github.com/huge-success/sanic/issues/1248

Was this page helpful?
0 / 5 - 0 ratings