# Sql with rasa and interpreter

**URL:** <https://forum.rasa.com/t/sql-with-rasa-and-interpreter/13213>\
**Category:** Rasa Open Source\
**Created:** [July 20, 2019, 11:02am UTC](https://forum.rasa.com/t/sql-with-rasa-and-interpreter/13213 "2019-07-20T11:02:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)\
**Post date:** [July 20, 2019, 11:02am UTC](https://forum.rasa.com/t/sql-with-rasa-and-interpreter/13213/1 "2019-07-20T11:02:57Z")

</div>

i would to define function de respond on dataset hotels but I do not know how can i find the interpreter.this the code how can solve that issue and thanks in advice

```
    def respond(message):
# Extract the entities
entities = interpreter.parse(message)["entities"]
# Initialize an empty params dictionary
params = {}
# Fill the dictionary with entities
for ent in entities:
    params[ent["entity"]] = str(ent["value"])

# Find hotels that match the dictionary
results = find_hotels(params)
# Get the names of the hotels and index of the response
names = [r[0] for r in results]
n = min(len(results),3)
# Select the nth element of the responses array
  return responses[n].format(*names)

# Test the respond() function
print(respond("I want an expensive hotel in the south of town"))
```

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [July 21, 2019, 8:22am UTC](https://forum.rasa.com/t/sql-with-rasa-and-interpreter/13213/2 "2019-07-21T08:22:59Z")

</div>

what do you mean by find interpreter? I think your behaviour is something you should be handling in [Custom Actions](https://rasa.com/docs/rasa/core/actions/#id2)

---

<div class="post-metadata">

**Author:** ![hajoura](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hajoura](https://forum.rasa.com/u/hajoura)\
**Post date:** [July 21, 2019, 4:46pm UTC](https://forum.rasa.com/t/sql-with-rasa-and-interpreter/13213/3 "2019-07-21T16:46:58Z")

</div>

thank you
