Using slot values later in conversation

Hi, I want to use the stored slot value further in conversation so, how can I do this?

any example, resource or explanation would be appreciated.


If a slot is set with the user’s name, then you could define a response like this:

- text: Nice to meet you, {slot_name}.
1 Like

Hello @ritik872000

You can either use variables in response templates as @alexyuwen has suggested, or you can use a custom action. For example with the Python SDK:

from typing import Text, Dict, Any, List
from rasa_sdk import Action
from import SlotSet

class ActionCheckRestaurants(Action):
   def name(self) -> Text:
      return "action_check_restaurants"

   def run(self,
           dispatcher: CollectingDispatcher,
           tracker: Tracker,
           domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

      cuisine = tracker.get_slot("cuisine")
      dispatcher.utter_message(text=f"The value of 'cuisine ' is '{cuisine}'")

      return []

With custom actions you can also do any kind of processing that you might want to do with the data that you’ve stored in slots.

I have implemented till here still thank you very much for explaining in brief:)

Thanks @alexyuwen I got what I was looking for :slight_smile: