I am trying to include database information in the system response. For example, I have a database of lists of restaurants with its name, address, address, area, post code. I am trying to fetch information from database according to the user’s input message.
user input: Hello sys response: Hello! welcome to our services user input: Can you look for restaurants which serves european food? sys response: I have list of restaurants for your choices [rest_A, rest_B, rest_C]
I am trying to use tracker package (from rasa_sdk import Action, Tracker) to get the required information from user’s input.
if any (tracker.get_latest_entity_values("Food")): food = tracker.current_slot_values()
Though, the input has entity value ‘european’ in the user’s input, it does not fetch the corresponding value. I have tried to use get_slot() but it throws attribute error, if any (tracker.get_latest_entity_values(“Food”)): value = tracker.get_latest_entity_values(“Food”) food = tracker.get_slot()
But, it throws Attribute Error
Could I get help to get the entity value from the user’s input? Any information would be helpful