How Entities Roles and Groups , i dont get the values tracked,,

hey community ,

so i wanted to use Entities Roles and Groups and am asking on how can i get the value from the slot in actions ? do i mention just the name or the role i want to extract ?

i tried

> tracker.get_latest_entity_values(entity_type="name1", entity_role="object1")

but i get this error

values["valuename2"]=tracker.get_latest_entity_values(entity_type="name1", entity_role="object1")
TypeError: get_latest_entity_values() got an unexpected keyword argument 'entity_role'

after upgrading it worked but i dont had the value of the slot detected instead i get

<generator object Tracker.get_latest_entity_values… at 0x7f66cbfd46d0>

any help or suggestions i will be gratefull @Juste @Tanja

Hi @Youssef-0


next (tracker.get_latest_entity_values(entity_type="name1", entity_role="object1"))

## intent:entitychallenge

- I am from [UK]{"entity":"Country", "role":"currentlocation"} and want to go to [USA]{"entity":"Country", "role":"destination"}

- I am from [USA]{"entity":"Country", "role":"currentlocation"} and want to go to [UK]{"entity":"Country", "role":"destination"}

1 Like

thank you so much @MuraliChandran14 ! i worked but when i try to get it into variable like

a= next (tracker.get_latest_entity_values(entity_type="name1", entity_role="object1"))

then print a i get an error

 `Preformatted text` await
RuntimeError: coroutine raised StopIteration

the next command cant take a default parameter if error and no item is present so i checked it by

a=next (tracker.get_latest_entity_values(entity_type=“name1”, entity_role=“object1”), "None)

am getting the None

am not sure if syntax is true


It seems that you do not have entity="name1" and role="object1" in your

You need to pass entity and role that must be already existing in your

The sample I posted contains entity country, role (currentlocation)and (destination). Which I later extracted the value on the custom action and printed it out.

If you do not have declared the entity and role in your It will throw you an error.

hmm @MuraliChandran14

do you mean that i dont have training expls or smtg else ,

for my nlu i have expls like this type here

- can you list me the [date]{"entity": "attributes", "value": "dates"} of events [hosted]{"entity": "relation", "value": "host"} by [Laguana]{"entity": "name1", "role": "object1"}

I tried your example. It worked.

can you check if you declared your entities in your domain.yml and what rasa version are you using?.

hey @MuraliChandran14 thank you soo muuch for your time

everything was good but since i tried so much to make it work so i used interactive learining at somepoint and when i do the export the stories kept holding the slots i filled and everything so everytime i tried next the stories were driving the conversation to somewhere else --"

thank you again for your time !

I Hope it helped @Youssef-0 :slight_smile: