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

Interrupting Harry mid conversation without losing focus.
 
 

I am building a chat bot that works with external data and would like to know the best way to query or receive new data without interrupting the conversation with Harry.
Right now I run the chat server through an open socket to C#. Any time I want to get or set new data to/from my external database, I have Harry send out a simple request <current time>. The C# program looks for any <> brackets and will give Harry that data back ie. <time 10:52>. At which point Harry stores this new data as a variable or fact. This works fine for simple cases, but if I wanted to do something like an alarm, where my C# program would manage the alarm, interrupt chat bot <alarm 10:58>, store the new data, maybe Harry would say something like “Your alarm went off”, I want him to be able to jump back into the previous topic and conversation we were just having. Any solutions or work around that anyone has would be very helpful!

 

 
  [ # 1 ]

Nominally, CS is a server that takes in an output and gives back an output.


For finer control one normally embeds chatscript within some other program.
That program calls chatscript with user input and sends output back to the user when CS returns.
If you have an interrupt, that program can hold the interrupt message if CS is currently processing an input, and pass the message in on the next cycle when CS returns. Also that program can regularly call CS with a dummy message just to allow CS to have control regularly so that CS can initiate conversations or spawn messages.

Your C# program sounds like it performs that role, if it knows that CS is already busy on a prior input.
As for inserting “your alarm went off” or such into the conversation, if you send in “out-of-band” data like your alarm (though the CS convention is to use [ ] and not < >—not fatal but CS knows not to try to parse [] data.)
you can memorize the topic at hand, and set it to resume on the next volley if you want. Normally you don’t have to remember the gambit if there was one, because of exhaustion rules, but you can even memorize the exact rule last issued,etc.  Depends on what control you need.

 

 
  [ # 2 ]

Thank you Bruce for the quick reply.

Is there or will there ever be functionality for getting the current time for chatscript?

Thank you!

 

 
  [ # 3 ]

there are a variety of current time in chatscript - find the documentation on %variables (system variables)

 

 
  login or register to react