# Rasa stack using utter\_response

**URL:** <https://forum.rasa.com/t/rasa-stack-using-utter-response/5108>\
**Category:** Rasa Open Source\
**Created:** [February 12, 2019, 9:58am UTC](https://forum.rasa.com/t/rasa-stack-using-utter-response/5108 "2019-02-12T09:58:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Likhitha](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Likhitha](https://forum.rasa.com/u/Likhitha)\
**Post date:** [February 12, 2019, 9:58am UTC](https://forum.rasa.com/t/rasa-stack-using-utter-response/5108/1 "2019-02-12T09:58:29Z")

</div>

Below code is custom action file

from **future** import absolute\_import from **future** import division from **future** import unicode\_literals from rasa\_core\_sdk import Action from rasa\_core\_sdk.events import SlotSet from rasa\_core.actions import Action from rasa\_core.events import SlotSet import typing from typing import Text, List, Dict, Any class ActionCheckColleges(Action): def name(self): # type: () -\> Text return “action\_check\_restaurants”

def run(self, dispatcher, tracker, domain): # type: (Dispatcher, DialogueStateTracker, Domain) -\> List[Event] colleges\_loc = tracker.get\_slot(‘location’) college\_dict = { “list\_hyd” : “JNTUH”, “list\_vzg” : [‘GITAM’,‘RVR’] } response = “Hyderabad” #colleges\_loc = tracker.latest\_message.text()

# if(colleges\_loc == ‘Hyderabad’):

```
# for i in list_hyd:

```

dispatcher.utter\_response(college\_dict[“list\_hyd”]) #return [SlotSet(“location”, colleges\_loc)]

# response = " {}".format(list\_hyd)

\*\*\*\*\*\*\*\* I want to return list of values of a key to the user For eg: I want to return “list\_vzg” values.But I got error like below: ERROR:rasa\_core.processor:Encountered an exception while running action ‘action\_check\_restaurants’. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code. ERROR:rasa\_core.processor:‘str’ object has no attribute ‘get’ Traceback (most recent call last): File “C:\Program Files\Python36\lib\site-packages\rasa\_core\processor.py”, line 302, in \_run\_action events = action.run(dispatcher, tracker, self.domain) File “C:\weatherbot\actions.py”, line 24, in run dispatcher.utter\_response(college\_dict[“list\_hyd”]) File “C:\Program Files\Python36\lib\site-packages\rasa\_core\dispatcher.py”, line 54, in utter\_response if message.get(“elements”): AttributeError: ‘str’ object has no attribute ‘get’

Please resolve the above issue

---

<div class="post-metadata">

**Author:** ![duckingbread](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@duckingbread](https://forum.rasa.com/u/duckingbread)\
**Post date:** [July 9, 2019, 5:57am UTC](https://forum.rasa.com/t/rasa-stack-using-utter-response/5108/2 "2019-07-09T05:57:25Z")

</div>

I am also facing a similar issue… if someone could look into this it would be helpful.@akelad … can you help in this?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [July 9, 2019, 11:58am UTC](https://forum.rasa.com/t/rasa-stack-using-utter-response/5108/3 "2019-07-09T11:58:59Z")

</div>

@duckingbread can you clarify your problem? I’m sure the code has changed
