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?
sorry for the wrong translation, I mean formalities
Your interpretation is correct of what I want to do. It is what occurs to me since different formalities have the same or similar intentions, this makes the prediction incorrect.
If you know the âwhatâ and âwhenâ to concatenate beforehand, then you can easily do that at the connector before sending it to rasa for processing. What channel are you using?
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:
I followed the steps you indicated, I canât get it to work concatenate the text Prueba as an example but it doesnât work, I copy the images of the files that I have modified
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?