Hello everyone, I am trying to make my bot work for multiple procedures. When the bot starts, I assign the name of the procedure to a slot and an entity with the purpose of helping me to predict the intention of the correct procedure.
Ask how to do it in the following post and I had no answer so I assume that it can not.
The only thing that occurs to me not to endorse the project with the rasa platform is to have multiple bots, is this possible? What would be the best way to do it so that its maintenance is not complicated?
And how could I direct which bot to use according to the procedure?
Could you please explain what exactly do you mean by “procedures”?
Also, I tried skimming through the posts that you have linked. What I understand from it is that, you want to concatenate a string with the incoming text messages before sending it to rasa for processing. Is this understanding correct?
Hi, The channel that I am using is webchat, I know what I send because I complete a slot when I start the chat, when the user writes his question in some way he should concatenate that text so that the prediction works well
Webchat uses socketio channel. This is the code of the connector. You can modify this line (data["message"]) to concatenate whatever you want before sending it to rasa (await on_new_message(message)) in a custom connector.
I will try to do what you suggest, I am not very expert yet.
I know that this solution is not very elegant because for each user message the name of the procedure will be concatenated.
I would have liked that the prediction of the intention had taken into account the value of the slot and / or the entity, but unfortunately it does not and I had to find this solution that is not elegant
You mean like not visible to the sender? If you concatenate the user message at the connector, it’ll not be visible to the sender.
The intent is predicted based on the trained model and the model is trained based on the NLU data. So if your data has those strings that you want to concatenate, then it’ll certainly help during prediction.
The file is your socketio channel. It should be located here: <your_virtual_environment_path>/rasa/core/channels/socketio.py
Also, you should not modify this file directly. Instead you should copy all the contents of this file in a separate file (for example say custom_channel.py). Now do your modifications in this custom_channel.py file and save it in the same directory in which your credentials.yml file is.
Now you can specify your file in credentials.yml so that rasa would use this file instead of the original one. You can specify it by putting something like this in your credentials.yml:
Well @fmelossi, I couldn’t think of a reason why this is not working, it should have at least concatenated the original message with “Prueba”.
I need to dig deeper to know what’s happening.
Could you please try commenting out all the other channels except the custom channel from credentials.yml and then run the bot in debug mode without API enabled? We are doing this to ensure that we can communicate with the bot via the custom channel only. Also please upload the custom channel file here (if possible).
You can also message me if required. I’m really curious to know why this is not working.
I couldn’t get a chance to debug your custom channel but since it is working correctly so let’s skip that .
It is not showing in webchat because we are concatenating it after the user has sent a message through the webchat. Isn’t that what you initially wanted?
Now, we need a tracker object in our custom connector so that we could extract the value of a slot. The simplest way (that I could think) of doing that is to make a call to the HTTP API of rasa and parse the JSON object for that particular slot. I haven’t tested it myself though.
Run your server with APIs enabled. You can then send a GET request to this API from inside your custom connector and parse the response to extract the value of the required slot. You can now use this value to concatenate with your messages.
Help me understand one thing, if we could capture the value of customData, then would you still require the value of the slot? or do you just want to capture the value of the customData so that you could concatenate it with the original message?