Override user input in Interactive learning module


I am trying to automate the user message input while running interactive learning. Idea is to create a script which will fetch the user messages with confidence less than some threshold value from the tracker-store (MongoDB in my case). Then pass those messages in the interactive learning process.

I’m currently looking for the way to override the _enter_user_message method in interactive.py with creating any patch in the rasa core itself.

Any help will be appreciated.

Thanks, :sparkles: :cake:

Mhm, I think for a proof of concept, you could just overwrite that function - monkeypatching in your functionality, e.g. something along these lines should work:

def my_input(sender_id, endpoint):
  my_message = "hey there"
  send_message(endpoint, sender_id, my_message)

import rasa_core.training.interactive
rasa_core.training.interactive._enter_user_message = my_input

Once you have an idea where this is going we can think about how we can make this easier / integrate this better.

1 Like