Unable to save stories using interactive learning

I’m using rasa interactive learning from the command line. After I’ve created new stories, I’m having trouble saving the stories to the stories.md file. When I hit ‘Export and Quit’, I get the option to save to data/stories.md. However, when I hit enter, I get the following error:

Unhandled exception in event loop: File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py”, line 154, in _run_task t() File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/eventloop/context.py”, line 115, in new_func return func(*a, **kw) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/application/application.py”, line 562, in read_from_input self.key_processor.process_keys() File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/key_binding/key_processor.py”, line 273, in process_keys self._process_coroutine.send(key_press) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/key_binding/key_processor.py”, line 180, in _process self._call_handler(matches[-1], key_sequence=buffer[:]) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/key_binding/key_processor.py”, line 323, in _call_handler handler.call(event) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/key_binding/key_bindings.py”, line 78, in call return self.handler(event) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/shortcuts/prompt.py”, line 588, in _ self.default_buffer.validate_and_handle() File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/buffer.py”, line 1612, in validate_and_handle valid = self.validate(set_cursor=True) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/buffer.py”, line 1160, in validate self.validator.validate(self.document) File “//anaconda/envs/tapoly/lib/python3.6/site-packages/prompt_toolkit/validation.py”, line 183, in validate return validator.validate(document)

Exception validate() takes 1 positional argument but 2 were given Press ENTER to continue…

I’ve tried saving it to a different (new) file but the error keeps popping up. Any help would be appreciated.


Continuing the discussion from Unable to save stories using interactive learning:

I am having the same issue with rasa version 1.1.6, and the following steps are resulting the error. Steps:

  1. $ rasa interactive

  2. Your input -> Hi

  3. Ctrl + C

  4. ? Do you want to stop? (Use arrow keys)

    » Continue

     Undo Last
     Start Fresh
     Export & Quit
  5. Used arrow key to select Export & Quit

I have attached the screenshot, and once I select Export & Quit, I simply cannot get out of the loop. So, I have to close the terminal and start again. Furthermore, it won’t save the stories developed via interactive mode.

I checked with Rasa 1.1.4, and Rasa 1.1.4 does not result this issue.

I had the same issue and made this change in the code of the file <python3_instalation>/rasa/utils/io.py line 296:

def validate(self,document: Document) -> None:

adding the parameter self in the definition of validate method.

I don’t know if that change will have side effects but for now I can use interactive training mode and save the files.

Thanks a tonne! That worked for me.