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..

How to resuse/restart a rejoinder in a conversation
 
 

Check this example:

#! Get Help
u: GETHELP ( * help )
         
  ^keep() ^repeat()
  What help do you need?

  a: ( _* ) $$query = _0
      Its easy to $$query

      b: ( ~emothanks ) Glad to be of help.

      b: ( * )
        <<<< Want to reuse the rejoinder or transfer the context to as though i am back to processing the a: rejoinder.  What do I do here? >>>>

1) The requirement is (for e.g.) the user requests for help with the input “I need help”
2) The bot responds with “What help do you need”
3) The user for e.g responds with “Swim” and the bot responds “Its easy to swim”
4) Now there is a rejoinder ~emothanks.  If the user responds Thanks, the bot will respond with “Glad to be of help”. 
5)  But if the user responds with another request for help for e.g “Run”, I want the processing to continue as though we are at the first rejoinder a: and respond “Its easy to run”.

What do I need to do to get the bot to handle the second query via a rejoinder?

NOTE 1: If I don’t have the b: ( * ) rejoinder it just says “I don’t know what to say”

NOTE2 : I did experiment with ^retry() and ^setrejoinder() but was not working. Maybe i was making a mistake.

Thanks

 

 
  [ # 1 ]

Figured out from the Exotica samples doc:

    a: REJOIN( _* ) $$query = _0
      b: ( _* ) $$query = _0
        Its easy to $$query
        ^setRejoinder(REJOIN)

This worked.

 

 
  [ # 2 ]

The problem with using setRejoinder is that it means you are repeating code in your example. The alternative is a bit simpler:
b: (_*) ^refine(GETHELP)

This causes the b branch to jump to gethelp and start performing the continuations.

 

 
  [ # 3 ]

Bruce

I tried what you mention above.  However the desired output is not obtained. See output pasted below

The code:


      b: ( _* ) $query ‘_0
        ^refine(GETHELP)

GETHELP: I was a making a custom function call and hence had to set $query here else it was exiting the program.

———-

TESTBOT:  I don’t know what to say.
admin: > :why
~control.0.0 u:  ( ) $$currenttopic = %topic ^^if 00m( %response 0 ) 00I{ ^nofail ( TOPIC ^rejoinder ( )... 
TESTBOT: 
admin: >

 

 
  login or register to react