Rasa agent to check if slot is opened

I am predicting the response using handle_message and then intent and confidence using parse_message_using_nlu_interpreter and then if confidence is less than certain threshold i reject the rasa response.

Now for a user query it opens the slot to fill the email, now if user provides the email, it generates the response correctly that not a valid email as custom action has been executed, but as I am checking the confidence with parse_message_using_nlu_interpreter it predicts the query intent with very low intent and then based on confidence, response is rejected.

handle_message method calls the action url implicitly

response = await executor.run(actionCall)

in this response there is events property that has the info that slot is opened, but this info will be lost in the response of handle_message

Can i get this info using agent? or Is there any way to check if the slot is opened before checking the intent and confidence?

@koaning, I have checked the docs as well, did not get any way, can you please help!!!

Hi @ermarkar

I’m interested in what your use-case is here? Is there a specific reason you are calling methods on the Agent directly rather than using an input channel?

We are using Rasa as python library, for loading of different models based on some criteria, so after loading and creating the agent object of class Agent I use handle_message to get the predicted intent/response, so if confidence is lower than the threshold we use other AI models to process the same query.

So if slot was open for email, and user provides the valid email then handle_message will return the correct response as the story goes, but parse_message_using_nlu_interpreter method will parse the email and try to return the intent and confidence on the same query, so email is considered as user query, which has no training, so it will return the low confidence, so query will go to the other AI model.

So is there any way i can check that if the user answer is for slot then skip checking the confidence. or is there any other way to do this?

The easiest way to see what slots are set is to do something like:

tracker = agent.tracker_store.retrieve(sender_id)
slots = tracker.slots

it will show the list of all slots, in chat flow there can be simple queries and get text answers, but for some queries we open slots like if we need user email.

how can i check that bot is expecting the value of a slot or simply it is listening for queries

@SamS, can you please answer this?

Hey @ermarkar, when you say “we open slots”, do you mean that the bot is inside a form and requests a specific piece of information from the user to fill a specific slot? In that case, the requested piece can be identified by looking at the value of the requested_slot slot.

thanks @SamS , from tracker

requestedSlot = tracker.slots['requested_slot']

and this worked.

can you solve this realted question How to delete or undo the last chat or slot event from tracker

1 Like