Running another Rasa core bot inside a running bot

Hello,

I have a question, I am trying to verify if it is possible to run an independent bot inside an already running Rasa bot. What I am trying to do is call the second NLU model and dialogue model inside the first bot’s custom actions. Now I can verify that it is possible to call an independent NLU model in the custom actions and use it as a separate intent classification model, but now I am also trying to call the dialogue model and basically redirect flow from one bot to another bot with the help of custom action. Is that even possible to do?

The error I am running in to is that both the bots run on the same port, so is there a way for me to change the port through python code and not a cmdline command?

Here is an example:

class Emotion(Action):
	def name(self):
		return 'emotion'
		
	def run(self, dispatcher, tracker, domain):
		input = tracker.latest_message["text"]
		buttons = [{'title': 'yes', 'payload': '/affirm_yes{"Affirm": "Yes"}'}, {'title': 'no', 'payload': '/affirm_no{"Affirm": "No"}'}]
		print(input)
		yes_no = tracker.get_slot('Affirm')
		print("Before:",yes_no)
        #CALL NLU MODEL TO RUN AN INTENT CLASSIFIER(This works)
		interpreter = RasaNLUInterpreter('./models_full_em/nlu/default/current')
		out = (interpreter.parse(input))
        #TRY TO CALL THE DIALOGUE MODEL SOMEHOW? I RUN IT THROUGH THE run_nlu()
		agent = run_nlu()
        #Following code......
				
		return 

And here is my run_nlu() function to call the bot

def run_nlu(serve_forever=True):
    interpreter = RasaNLUInterpreter('./models/nlu/default/current')
    print(interpreter.parse(u"Hello I am Mark"))
    action_endpoint = EndpointConfig(url="http://localhost:5055/webhook")
    agent = Agent.load('./models/dialogue', interpreter=interpreter,action_endpoint=action_endpoint)
    rasa_core.run.serve_application(agent ,channel='cmdline')

    return agent

It doesn’t make much sense to do this, but I am trying to hack a way to build a nested bot system so I can have a more intent classification system at each level of the nested system.

Thank you!

I already commented this on another thread – I can kind of see the use case for running multiple different NLU models, but I’m still wondering why different Core models?