AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Redirect command vs redirect tag

I’ve been having fun experimenting with RiveScript, using the python interpreter. But one of my triggers wasn’t acting as I expected, and I boiled it down to this example:

! var mood good

Hi there!

how are you
I'm in a <bot mood> mood.

+ get grumpy
- <bot mood=bad>Now I'
m grouchy.

get happy
- <bot mood=good>I feel much better.

hey there
* <bot mood> == bad => Hay is for horses.

* <bot mood> == bad => Hay is for horses.

The “hey there” trigger changes its response based on the bot’s mood but the “hey” trigger doesn’t. I looked at the RiveScript white paper and couldn’t find any mention of what the expected behavior in this case is. I can’t think of a good reason why it should work this way, but if there is one, it would be helpful if the interpreter would print a warning along the lines of “I found both a conditional and a redirect command, ignoring the conditional”.


  [ # 1 ]

Adding a warning at parse time sounds like a good idea to me.

The @redirect command is designed for simple use cases (aliasing one reply to another) and its presence overrides everything else in the reply. For example in the JavaScript version’s source code, if a reply has a “hard redirect” it’s processed immediately, even before checking conditionals or any other replies:

I made a bug ticket to remind myself to add the warning.


  login or register to react