I am building a chatbot in Node.js and have been using aiml-high. I am trying to access the predicates of the AIML so that I can store them in variables which I will use later on. I know that in Python there is a way to get the predicates like so:
name = kernel.getPredicate("name", sessionId)
So, here is my question in more detail. Below is a category from my AIML file.
<category>
<pattern>DO YOU SPEAK <set name="language">*</set></pattern>
<condition name="language">
<li value="english">Yes. I do speak <get name="language"/>.</li>
<li value="English">Yes. I do speak <get name="language"/>.</li>
<li>Sorry. I don't speak <get name="language"/>. Maybe one day I will learn though.</li>
</condition>
</category>
If the user says "Do you speak French", the language, which in this case is "French", is stored here:
<set name="language:>*</set>
Now, the language is remembered and can respond accordingly.
<li>Sorry. I don't speak <get name="language"/>. Maybe one day I will learn though.</li>
...replacing the <get name="language"/>
with the language that the user had input. I would like to access that language predicate in my JavaScript so I can use it later. So, I was wondering if anyone has built a chatbot in Node.js and would have insight as to how I would save these predicates.