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

srai and that
 
 

I have a very specific problem I cannot wrap my head around. Imagine something like this:

<category><pattern>HELLO</pattern>
<
template><random>
<
li>HiWhat is your Name?</li>
<
li>HeyMay I ask you to give me your Name?</li>
<
li>Hello and welcomeHow shall I call you?</li>
</
random></template>
</
category>

<
category><pattern>*</pattern>
<
that>WHAT IS YOUR NAME</that>
<
template>Hello, <set name="name"><star/></set>. Thanks for letting me know.</template>
</
category

Now, I would like to not have to write the same code for all the questions in the first category. Is there some way to use srai to redirect to another category with a different that (or if you will, alter the that in the process of calling a srai)?

 

 
  [ # 1 ]

I’m just a beginner but maybe something like this would work?

<category><pattern>HELLO</pattern>
<
template><random>
<
think><set name="topic">setname</set></think>
<
li>HiWhat is your Name?</li>
<
li>HeyMay I ask you to give me your Name?</li>
<
li>Hello and welcomeHow shall I call you?</li>
</
random></template>
</
category>

<
topic name="setname"
<
category
<
pattern>*</pattern>
<
template>
<
think><set name="topic"></set></think>
Hello, <set name="username"> <star/> </set>! Thanks for letting me know.
</
template>
</
category>
</
topic
 

 
  [ # 2 ]

Thanks for your suggestion, Magnus. I guess, that is a way of doing it…

 

 
  login or register to react