Chatbots Magazine Become a Writer Intro to Chatbots

INTENT: At what time is [ENTITY] available?


(massimo.canonico) #1

Hi,
I’m using api.ai and it is quite good fro me, but
my bot must be able to answer to very similar questions with different “subject”. For example, it must be able to reply to:

  • At what time is MAYOR available?
  • What is the reception time of the TECHNICAL STAFF?
  • When does the REGISTRY OFFICE is open?

As you can see, I have very similar question. So, right now, I have create different ENTITIES and different INTENTS, but from my point of view, I should create just one ENTITY (let’s say SERVICE) and one INTENT.

The intent should work with a simple switch:

  • if SERVICE == Mayor then reply with the schedule time of the mayor
  • if SERVICE == Registry office then reply with the open hours of this office
    and so on…

Am I right? Where can I put this switch in api.ai?

Thanks,
Massimo


(lildev) #2

If you want to use a single intent and toggle the response based on the entity value, you will have to use the Fulfillment webhook https://docs.api.ai/docs/webhook Then you have tons of flexibility on how to respond based on the entity value.

Or else you will have to use separate intents so that you can customize based on the intent.