Rasa: Include additional API endpoints

Created on 14 Jun 2017  路  15Comments  路  Source: RasaHQ/rasa

We currently have a request Rasa UI to include the ability to:

1.) Reload (stop and restart) the Rasa Instance from an API (stopping seems reasonable)
2.) Change a configuration option through an API (and if needed reload the instance) (POST/PUT /config), one or multiple parameters.

I would agree that both of the functions would be helpful. With these 2 API's we would be able to fully manage a Rasa Instance from Rasa UI making it more "end user friendly" and enable rapid prototyping.

type

Most helpful comment

Ok so here is what we should do:

  • split the configuration into two things:

    1. server configuration containing config of the rasa instance (e.g. port, log dir,...)

    2. model configuration for a model that needs to be trained (e.g. num threads, data file, ...)

  • allow to pass model configuration during training, this includes the http endpoint

@paschmann does that make sense? I think most of the parameters you'd likely change are part of the model configuration (e.g. pipeline)

All 15 comments

To clarify Point 1: - this does not necessarily mean the instance would need to stopped/restarted on the server in interactive mode, but rather "reinitialized".

@paschmann Sounds cool. Let me try to understand the underlying cause you need these changes for, because maybe there is a less disruptive way to achieve what you are trying to do then to restart the server ;) .

Whats the need for the restart?
What values are you looking to change in the configuration?

Hi @tmbo -

The need to restart the server would be to change the config parameters dynamically from the Rasa UI and subsequently need to access the servers terminal. Although, as you said, if there is a way to achieve this without restarting - perfect.

The "Dynamic" config changes below would be helpful:

  • server_model_dirs (once we create a new model from UI, we can select it)
  • pipeline (change the pipeline and rerun training and test results)

Thanks!

Hi @tmbo, is there any way to use newly created model without restarting the server? or I have been doing it wrong.

@paschmann @NagarajGond see the docs here https://rasa-nlu.readthedocs.io/en/latest/http.html when you call the /parse end point you can specify a model name and if it isn't loaded it will be. /parse?q=hello&model=my_model

To my knowledge you can't change the pipeline without restarting the server. Need @tmbo for that one.

Ok so here is what we should do:

  • split the configuration into two things:

    1. server configuration containing config of the rasa instance (e.g. port, log dir,...)

    2. model configuration for a model that needs to be trained (e.g. num threads, data file, ...)

  • allow to pass model configuration during training, this includes the http endpoint

@paschmann does that make sense? I think most of the parameters you'd likely change are part of the model configuration (e.g. pipeline)

I would like to ask for a rasa reload feature.
Our application is dynamically creating and deleting models.
Currently the model deletion is done by remove the folder on the file system.
The model is removed from the available list in the status but it seems to remain cached in memory.
A reload will help by cleaning rasa and asking it to reload all models.

The problem really happens because it is impossible to to delete a model programmatically (which is a topic for another feature request).

Another related problem is that training the model with the same name as the one that was deleted also doesn't take affect until a rasa restart.
We are restart docker right now after every change to rasa. It helps but it cumbersome.

@tmbo - I agree this would be helpful and solve the problem at hand, I do have a small concern that we are making the server configuration more complicated though by adding a second config file.

@wrathagom - Thanks, I believe you still need to specify a model list in your config file (in the server_model_dirs object) before you can reference it. @tmbo - please correct if I am wrong.

@paschmann you're not wrong, but I don't get why that is a problem. You specify one folder ./models and all trained models are saved to that directory and loaded from that directory. So any model in that folder can be loaded and used to parse against with the /parse?q=hello&model=my_model syntax.

To @bigman73's point the biggest problem is that you can't unload/delete it form the API.

Hi @wrathagom - thanks for the additional feedback, I now understand your suggestion. After doing some testing I was unaware you could reference the model via its folder path, which will, as you mentioned load it. Thank you :)

@paschmann is there anything else that needs to be done here?

Hi Team,
We are using rasa_core version of 0.10.4. In this version, if we want to restart a conversation, how can we handle this using http api.

Currently we have written stories (example below)

## Story_help_gnh
* button_option{"option_type":"gifts and hospitality"}
 - utter_help_gnh
> gifts_and_hospitality

## Story_gnh_ethics_counsellor
> gifts_and_hospitality
* ethics_counsellor
 - utter_gnh_ethics_counsellor
 - action_restart  

I am making parse call and continue calls through http api and getting action_restart as next_action in continue call. Is there any endpoint or parameter to include to restart conversation. How can we handle the scenario through APIs. Please help.

I don't think this is possible in 0.10 - there have been lots of changes in 0.11 and 0.12 to improve the framework, so best is to invest some time and update.

I'll lock this issue, but feel free to open a separate issue for your problem so we can discuss it further there.

Was this page helpful?
0 / 5 - 0 ratings