# Interactive learning - interactive.py

**URL:** <https://forum.rasa.com/t/interactive-learning-interactive-py/1605>\
**Category:** Rasa Open Source\
**Created:** [October 3, 2018, 1:02pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605 "2018-10-03T13:02:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sam](https://forum.rasa.com/u/Sam)\
**Post date:** [October 3, 2018, 1:02pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/1 "2018-10-03T13:02:58Z")

</div>

I’m trying to connect the interactive learning to http rest. meanwhile I’ve come across the file ‘interactive.py’, found in the master version If I run the following command:

> from rasa\_core.training import interactive

> agent = Agent.load(path=agent\_path, interpreter=interpreter, action\_endpoint=endpoint) interactive.run\_interactive\_learning(agent=agent, serve\_forever=True)

I get the following error:

> usage: app.py [-h] -d CORE [-u NLU] [-p PORT] [–auth\_token AUTH\_TOKEN] [–cors [CORS [CORS …]]] [-o LOG\_FILE] [–credentials CREDENTIALS] [–endpoints ENDPOINTS] [-c CONNECTOR] [–enable\_api] [–jwt\_secret JWT\_SECRET] [–jwt\_method JWT\_METHOD] [-v] [-vv] [–quiet] app.py: error: the following arguments are required: -d/–core

If i run the same command from a python console - not a python file- i get the following:

> prompt\_toolkit.terminal.win32\_output.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?

Am i doing anything wrong?

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [October 4, 2018, 11:19am UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/2 "2018-10-04T11:19:18Z")

</div>

that error tells you what you need to do: `error: the following arguments are required: -d/–core`

As for the python console, that’s a windows related error, i guess you need to run it from `cmd.exe`

---

<div class="post-metadata">

**Author:** ![Sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sam](https://forum.rasa.com/u/Sam)\
**Post date:** [October 4, 2018, 2:27pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/3 "2018-10-04T14:27:39Z")

</div>

I do understand the source of the errors. Anyway, the problem is that I am trying to connect slack with the bot through interactive learning - I looked at the interactive.py code and all the endpoints that i need to communicate with the bot for interactive learning are there. But what i need now is a communication between slack and these endpoints. For example, user sends message -\> perform appropriate endpoint request endpoint receives a response -\> display appropriate text based on the response received How can this be done? any simple guidelines?

---

<div class="post-metadata">

**Author:** ![smn-snkl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/smn-snkl/32/902_2.png) [@smn-snkl](https://forum.rasa.com/u/smn-snkl)\
**Post date:** [October 4, 2018, 3:04pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/4 "2018-10-04T15:04:41Z")

</div>

I’m not sure if I understand correctly, but I’m assuming you just want to use interactive training through Slack instead of the command line, is that correct?

If that’s the case, I think the issue is that when you call the interactive.run\_interactive\_learning, the agent has no registered channels. There’s no native way of doing this I believe, so you’d need to modify / implement your own solution. What you’d need to do is create your own interactive\_training file and write your own ‘\_serve\_application’ function that modifies that line: `_start_interactive_learning_io(endpoint,http_server.stop,finetune=finetune)`

Instead, you’d probably need something like this line found in the start\_server function in the run.py: `rasa_core.channels.channel.register(input_channels,app,initial_agent.handle_message,route="/webhooks/")`

Not sure if this would work out-of-the-box though. There might be other issues popping up as you’d try this approach.

---

<div class="post-metadata">

**Author:** ![Sam](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Sam](https://forum.rasa.com/u/Sam)\
**Post date:** [October 4, 2018, 3:16pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/5 "2018-10-04T15:16:07Z")

</div>

Thanks, that’s exactly what i need, to use slack instead of command line! i’ll try the approach you mentioned, but if you look at lines where the function prompt is called e.g. line 233

> answers = prompt(questions)

As far as i can tell, this function outputs text to the command line but instead I’ll need to output the answers back to slack

Is there a simple way of doing so assuming i manage to register a slack channel with the call u provided

Thanks!

---

<div class="post-metadata">

**Author:** ![smn-snkl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/smn-snkl/32/902_2.png) [@smn-snkl](https://forum.rasa.com/u/smn-snkl)\
**Post date:** [October 4, 2018, 3:42pm UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/6 "2018-10-04T15:42:36Z")

</div>

You’re right, that’s what I thought. Would have been too easy. I guess in that case you’d need to completely rewrite the interactive training yourself and send messages through the channels instead of command line. But that’s quite an effort. Especially because some features like selecting the correct intent using up and down arrow keys won’t be possible on Slack. So you’d need to rewrite a lot of these cases as well.

---

<div class="post-metadata">

**Author:** ![Daaman\_mehta](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@Daaman\_mehta](https://forum.rasa.com/u/Daaman_mehta)\
**Post date:** [March 25, 2019, 8:59am UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/7 "2019-03-25T08:59:51Z")

</div>

@Sam can you able to send messages through the channels instead of command line? This is also what i want.Want little help on this topic

---

<div class="post-metadata">

**Author:** ![Edukondalu](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/edukondalu/32/11843_2.png) [@Edukondalu](https://forum.rasa.com/u/Edukondalu)\
**Post date:** [March 3, 2020, 1:28am UTC](https://forum.rasa.com/t/interactive-learning-interactive-py/1605/8 "2020-03-03T01:28:11Z")

</div>

Hi,

Have you tried to implement interactive learning through channel
