AI Zone Admin Forum Add your forum

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

Redirect command vs redirect tag
 
 

Hi,
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

hello
Hello!
Howdy!
Hi there!
Hi!

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.
{@hello}

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

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: https://github.com/aichaos/rivescript-js/blob/a3c39ee2866cefa6ecebe683db8366a2e77656d3/src/brain.coffee#L245-L254

I made a bug ticket to remind myself to add the warning. https://github.com/aichaos/rivescript-js/issues/58

 

 
  login or register to react