From AI Wiki
The Iam Framework and the Iam Library provide a variety of ways for an Iam to respond with meaningful conversation to what is being said to it. Each of these methods have their advantages and disadvantages, depending on the intended use and role of the Iam. There's more or less black-box support for chat-bots using AIML or CHAT-L. The ChatProcessor was intended to do what CHAT-L did but more tightly tied to the control of the avatar in a 3D virtual world.
Over time it's becoming more and more clear that a large number of applications of Iams require a different type of response-handling than the general conversational types provided by AIML and CHAT-L. So rather than seeing the ChatProcessor as a built-in CHAT-L replacement, it's better seeing it as a tool that borrows heavily from CHAT-L, especially it's pattern syntax, some from AIML and adds a few constructs that give it more control over the avatar. This is a piece of the IamFramework that is constantly evolving and it's quite possible that over time it will move further and further away from the original CHAT-L.
Main differences from CHAT-L
- function: is used to define which function in the behavior should be called when a chat-rule matches.
- srai: this is a feature borrowed from AIML and allows a rule to be referred to another rule.
- include: allows the inclusion of other CHAT-L files, enabling easy reuse of some patterns, rules or definitions
- set: allows defining arbitrary variables and setting them to a string, phrase or wild-card text.
- precondition: can be used to test if a variable (or more than one) filled by the 'set' command is equal to a certain value.
Another important distinction between the ChatProcessor and AIML or the CHAT-L sandbox is that the result is a call into an Iam's behavior. This could be any behavior, but the standard implementation is CHATLBehavior in the IamLibrary.jar. By default the 'reply' method of the behavior is called, passing the chat-rule object that matched the input, and the parameters (if any) to the matched rule. But through the 'function' attribute, different rules can call different functions of the behavior. Through these functions it's possible to have complete control over the avatar, depending on what rule matched the input.