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

can I use star in a condition tag?
 
 

Can I do the following?  I am getting errors on Pandorabot:

<condition>
<
li name "<star/>-laststep-done" value "done">
....
</
condition
 

 
  [ # 1 ]

I am not sure you can have * or <star> in the name of the predicate you are testing.  You can have a * in the value.

Try this instead:

<category><pattern>test1 *</pattern>
    <
template>
        <
think><set name="status"><srai>XRETURNSTATUS <star/></srai></set></think>
        <
condition name="status">
            <
li value="done">Awesomewe are done.</li>
            <
li value="error">OopsWe have an error.</li>
            <
li>Nope not done yet.</li>
        </
condition>
    </
template>
</
category>

<
category><pattern>XRETURNSTATUS dash laststep dash done</pattern>>
    <
template>done</template>
</
category>

<
category><pattern>XRETURNSTATUS dash laststep dash error</pattern>>
    <
template>error</template>
</
category>

<
category><pattern>XRETURNSTATUS *</pattern>>
    <
template>not done</template>
</
category

NOTE: - dashes are converted to the word “dash” by the normal substitution file in the Pandorabots playground so -laststep-done becomes “dash laststep dash done” in the pattern.

Sample Output:

Human: test1 open-firststep-done
sienna4: Nope not done yet. 

Human: test1 close-laststep-error
sienna4: Oops. We have an error. 

Human: test1 close-laststep-done
sienna4: Awesome, we are done. 

 

 

 
  [ # 2 ]

Thanks for the example.  I *think* I understand how to move forward, but this gave a great example of how to think of a similar solution.  I hadn’t thought of putting a <srai> in the value for a set name.

 

 
  login or register to react