I am trying to make a bot through wit.ai. It is detecting the entity, but it is not calling the function which should be executed on detecting that entity.
For example, if you go to the link here on Witty Fiddle : https://wit-ai.github.io/witty-fiddle/?id=2a2aafd3e2656e7e74949331b85a6667
And say, hi
. Bot detects its entity greeting
and executes function replyToHi()
. Then if user says Thank you
, it will detect its entity as thankyou
but instead of executing replyToThankyou()
, it will just display Hi, how are you
, without executing any function.
Whereas, when I call Tell me about good comedy movies
, and it discovers intent as search_query
and calls "findMovieBasedOnSearchItems()". And after that if I say thankyou
, then it executes replyToThankyou()
function.
What I am observing is that if it detects the another entity
after the first one, it does not call bot executes
functions, whereas after it detects some intent
and then some entity
, then it calls bot execute functions.
Please let me is there some bug in wit.ai
or am I doing something wrong? Thank you.
Only trait entities influence function prediction. Instead of using keyword/free-text entities in your stories you should rather set them as trait entity. Also you can set some restrictions in Actions tab to prevent undesirable function callings.