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

CS input analysis
 
 

I have two topics that look at the input and use this to set variable, $emotion
They look like this
U:( anger) $anger += 1

And
U:([repeat huh]) repeat sentence function

And so on
How can I make sure they are processed before CS tries to invoke a pending rejoinder?

$cs_prepass?

 

 
  [ # 1 ]

I see that you have two options:
1) Modify your control script to use the related topic/rules before it calls noFail(TOPIC ^rejoinder() )

you can do this by using ^respond( ~your topic) before the rejoinder call. Just be sure that your don’t add anything to the output text going to the user or else you will have to additional work to prevent CS from stopping processing. It is perfectly fine to set all the variables and facts you want.


2) Register this topic as a pre-processor topic using $cs_control_pre in your bot definition.

Look where you see $cs_control_main=xxxx and this is where you will put the $cs_control_pre. Just be sure to have your topic defined beforehand. My preprocessor is defined as a system() topic. I’m not sure if that is a requirement or not. Again, I don’t think you want to output any text to the user.

Hope this helps.


Stephen G.

 

 
  [ # 2 ]

I was just reviewing the system variables manual and realized that there is another pre processing opportunity.

$cs_prepass (run in responder mode but not called if you use ^analyze()

name of a topic to run in responder mode on main volleys, which runs before $cs_control_main and after all of the above and pos-parsing is done. Used to amend preparation data coming from the engine. You can use it to add your own spin on input processing before going to your main control. I use it to, for example, label commands as questions, standardize sentence construction (like if you see me what will you think to assume you see me. What will you think?)

 

 
  [ # 3 ]

Thank you!  I tried to use $cs_prepass , before the main process topic and it seems to be working now.
Thank you!

 

 
  [ # 4 ]

After I test this, I am going to try and check in a change to include a repeat module into github.
If your avatar is speaking, sometimes the end user might need something repeated. This use case happens a lot in a normal real life conversation.  But if we repeat it back inpre processing,  I believe we lose our original topic and and responders or rejoinders.

Trying to work out an example that repeats what was said before by the avatar and puts CS back into the previous mode.
Has anyone done something like this already?
Will ^retry work with this use case ?

For example:

CS:  Do you have any brothers or sisters?
Person: what did you ask me?
CS: Oh, I said, do you have any brothers or sisters?
Person: yes, I have a sister.

If CS did not have to repeat the sentence, we would be looking for an answer to that original question.
But since we repeated it from another topic, this context is lost.

That is the use case I am trying to solve.
Cheers

 

 
  [ # 5 ]

what I do is in postprocessing make a copy of the current output rejoinder and what the bot said. Then if I get a repeat request, I can spout the message and reset the pending rejoinder

 

 
  [ # 6 ]

That is logical.  Trying to think of an elegant way to reset the pending rejoinder to the previous.

Maybe

In prepocessing
Trap the request to repeat the last response
Repeat the last response that was saved previously and ^setRejoinder($lastrejoinder)

In post processing
Save off %inputrejoinder and the last response to the $ variables?

Is there a better way to do this?

I can add a generic example to github for others, if you think that would help others.

 

 
  [ # 7 ]

certainly in postprocessing you save onto $ vars the 2 you named.
trapping the request can be ANYwhere. In my code its in the control script and I save preprocessing to do other kinds of tasks, but thats entirely up to you

 

 
  login or register to react