After the new update, I tried to access a string value stored in my Entity, using get_latest_entity_values function on the tracker. I also tried to write it exactly how its written in Rasa’s Official tutorial for “Custom Actions”: Conversational AI with Rasa: Custom Actions - YouTube
However, it starts giving me " KeyError: ‘entity_units’ ".
Is this error only for me, or are other people also facing this? To solve my problem, I instead used get slot functions, and they worked perfectly. Have entities become outdated or something?
Rasa Version : 2.8.3
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.1
Rasa X Version : None
Python Version : 3.8.0
2. I fixed the “KeyError:”, since it was a Python problem. But then I stumbled into another problem. This is how the entity stores its value in the slot:
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.events import SlotSet
from rasa_sdk.executor import CollectingDispatcher
class ActionTest1(Action):
def name(self) -> Text:
return "action_receive_entity"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
Units = str(tracker.get_latest_entity_values("units"))
return [SlotSet("units", Units)]