Skip to main content

JAICP updates in January 2023

New

  • Transformer classifier.
  • JavaScript actions.

Improved

  • String interpolations in YAML dictionaries.

Docs

  • Updated Chat API article.

Transformer classifier

Beta

In our January JAICP update, we present a new classifier algorithm. The Transformer classifier is based on a large language model. It compares phrase vectors, operating on the meaning of whole phrases rather than separate words.

Transformer can be useful if you don’t have a lot of data to train the bot. The model has been pre-trained on a significant amount of texts, which is why it performs well on small datasets.

Contact your account manager or send us a message at support@just-ai.com to try the free beta.

JavaScript actions

JAICP DSL has special action tags, which allow a state to execute a separate script: for example, request a confirmation or process a Telegram payment. Additionally, these tags can implement a complex action which doesn’t involve context handling (such as an HTTP request).

In such cases, you can now use JavaScript actions, which are better suited for them. These tags are implemented as regular function calls rather than transitions to an embedded script.

Updated Chat API article

We’ve added a description of new methods. You can use them to view the message statuses that the bot sent in the Chat API channel:

String interpolations in YAML dictionaries

JAICP DSL has always had support for template strings after reaction and action tags. For instance, you can write the following:

state: Start
q!: $regex</start>
if: $client.name
a: Hello again, {{$client.name}}!
else:
a: Hello there!

The {{}} brackets can contain any valid JavaScript expression, such as a variable reference. It will be resolved and interpolated into the string during bot runtime.

Some users prefer to store bot answers in a separate YAML dictionary. However, if you previously tried to use them to store template strings, their embedded JavaScript expressions would not be resolved:

require: answers.yaml
var = answers

theme: /

state: Start
q!: $regex</start>
if: $client.name
# The bot would reply, “Hello again, {​{$client.name}}!” literally
a: {{answers.returningClient}}
else:
a: {{answers.newClient}}

We have addressed this issue, and now string interpolations in YAML dictionaries are properly resolved as well.