Using only rasa core

From interactive learning, I learned that the rasa core takes intent as input and returns the action result. But how do I use only the core separate from the nlu. I don’t find any HTTP API for that.

Hi @Hakim. Why do you want to use Core without NLU? The way you would do it is inject an intent into a conversation

@tyd sorry for the delay. I am actually building separate API for nlu and core. So, I will fetch the intent from the nlu and inject it to the core as you suggested. Also, I am having trouble connecting the bot with slack. here is my bot.py file

logfile = 'dialogue_model.log'
loop = asyncio.get_event_loop()
async def run_core(core_model_path, nlu_model_path, action_endpoint_url, slack_token):
    logging.basicConfig(filename=logfile, level=logging.DEBUG)
    nlu_interpreter = RasaNLUInterpreter(nlu_model_path)
    action_endpoint = EndpointConfig(url=action_endpoint_url)
    agent = Agent.load(core_model_path, interpreter=nlu_interpreter, action_endpoint=action_endpoint)
    input_channel = SlackInput(slack_token)
    await agent.handle_channels([input_channel], 5004)

    print("Your bot is ready to talk! Type your messages here or send 'stop'")
    while True:
        a = input()
        if a == 'stop':
            break
        responses = agent.handle_text(a)
        for response in responses:
            print(response["text"])
    return agent


if __name__ == '__main__':
    action_endpoint = EndpointConfig(url="http://localhost:5055/webhook")
    #slackConfig = utils.read_yaml_file('credentials.yml')
    #train_core('domain.yml', './models/dialogue', './data/stories.md', 'policy.yml')
    loop.run_until_complete(run_core('./models/trial', './models/trial/nlu', action_endpoint, slack_token))

getting this error RuntimeError: coroutine 'Agent.handle_text' was never awaited

@Hakim The recommended way to connect to Slack is here. I am guessing you are not going to want to use the officially supported method, so maybe looking at the Slack connector code here will help?

thanks, @tyd. It would be great if you could help me with one more issue. I was trying to use use the trigger intent through the endpoint- http://localhost:5005/conversations/{conversation_id}/trigger_intent

My payload was like this:

{
    "name": "ask_products",
    "entities": {"products": "recommender_engine"}
}

For some reason, the product slot is not being assigned to the value “recommender_engine” and I am getting results for the default slot value “general”. this is how I defined my slot.

slots:
  products:
    type: text
    initial_value: "general"

But when I try the model through rasa shell, saying “tell me about the recommender engine”, it is properly giving me the result for slot value “recommender_engine”.

I checked the
GET http://localhost:5005/conversations/{conversation_id}/trigger_intent endpoint and the slot value is “general”, not the value specified in the entities. Am I using the endpoint correctly?