Intent as slot

Can i mention my intents e.g. BalanceEnquiry, MiniStatement, FundTransfer, etc. as slots? if i can, then how can i use those intents as slots?

for example, i ask to bot that show my balance, so bot should pick BalanceEnquiry as slot, and I again ask can you show last 5 transcations, so message should print like you are in BalanceEnquiry intent can i switch to MiniStatement intent

thank you.

@lokeshharad Welcome to the Rasa community!

Are you using a custom action? If yes, you can retrieve the last intent via

state = tracker.current_state()
last_intent = state["latest_message"]["intent"]["name"]

You can return a SlotSet event at the end of the custom action to set the intent name as a slot.

It is not possible to automatically set the intent as a slot.

Does that help?

1 Like