CSML updates
CSML updates
www.csml.dev

CSML v1.10.0

 

New

  

The new 1.10.0 release of CSML is packed with powerful features to make you even more productive when creating your chatbots.

Modules

The most important feature of this release is the new modules system. You can now create a module and import it across multiple bots! You can use any public module that we publish, or your own modules that you can open-source for others to use, or keep private for your own usage.

Modules makes it easier to write more concise code and reuse snippets across multiple projects. It also makes it easier to maintain code by letting you update your code in a single place instead of duplicating code across all your chatbots. It's perfect for logging or analytics libraries, generic utilities, etc.

We have created a sample repository containing a few useful modules that you can start using today in your chatbot.

CSML Studio lets you easily declare modules that you can then import in your chatbot very easily. Give it a try!

image.png

👉 read more here

Flow Constants

You can now define immutable values that will be available across the entire flow using the new const keyword.

This is especially useful for cases where you need to define common context or configuration for a flow that will apply in any step of that flow, regardless of any memory or user-defined scenario. const values are immutable: once defined, you can not change or reassign them!

const MY_VAR = 42

start:
  say "What is the answer? {{MY_VAR}}!"

👉 read more here

Secure inputs

The new hold_secure behaves just like any regular hold, except any user input that follows it immediately will automatically be secure, meaning that it can not be saved in memory and can not be displayed.

You should refrain from using it to ask users for their password but it can be interesting to use as a way to share short-lived secrets or simply to prevent misuse of data that should simply not be stored in clear text in server logs or memory such as PII (Personal Indentifiable Information).

Additionally, CSML Studio provides a password input form that will automatically behave as a secure input method, using exactly the same mechanism (which is also available via the CSML Engine API):

  say Input(
    title="Tell me a secret!",
    description="I won't tell anyone...",
    type="password",
    submit_label="Shhhh"
  )

image.png

👉 read more here

Other improvements

Among other new features, bugfixes and improvements, I wanted to

Support for non-JSON content-types in HTTP responses

Previously, CSML was unable to parse the body of HTTP responses in other formats than JSON. You can now safely query any xml or simple text-based API with CSML and retrieve the response accordingly!

The .get_info() method when invoked on the response object also lets you access the metadatan including the full response headers.

{ } syntax for functions

You can now use the more common { ... } syntax to delimit function scope, in addition to the previous :-only syntax.

fn myFunction() {
  ...
}

new object, array and string methods

And many, many more small improvements and features. Make sure you check the release notes for the latest release!

CSML v1.9.0 is out!

 

New

  

We have just released CSML v1.9.0! Although this release mostly comes with internal improvements, there are a number of new features that we would like to highlight here.

New Parser

In this release we have entirely redesigned the language parser, which comes with massive performance improvements (up to x100 parsing speed in very large files). The syntax remains the same, but CSML developers working on large chatbots will definitely love it!

New String and Array methods

We have added a few useful helpers to the String and Array types:

  • String.trim(), String.trim_start() and String.trim_end() will help with removing whitespace at the beginning or end of any string
  • Array.init(n) generates a new array of length n
  • Array.append(items) adds an array of items at the end of an array
  • Array.reverse() reverses an array

You can read more about String and Array methods on the CSML docs.

New timezones support

The Time() helper function can now also convert time between UTC and various timezones!

do UTC = Time()
do paris = UTC.to_timezone("Europe/Paris")

New ARM / Mac M1 builds

ARM-based architectures are trending, and we made the necessary improvements to natively support those! All our builds are now compatible with ARM machines, even with Docker. If you are using one of our pre-built binaries (available on the Github release page), make sure to select the right version for your architecture!

New log command

For those running CSML on their own machine rather than on CSML Studio, you may be interested in the new log verb that allows you (in conjunction with the CSML_LOG_LEVEL environment variable) to print debug data to the logging output file of your setup.

The new syntax goes as follows:

log [level] "message"

Allowed levels are trace, debug, info, warn, error. By default, CSML_LOG_LEVEL is set on error level, but you can also disable it by setting it to an empty string like so CSML_LOG_LEVEL=.

(This feature is not available to CSML Studio users, as the server logs are not publicly accessible)

Webapp Text Autocomplete

 

New

  

The autocomplete feature helps your chatbot provide a list of up to 5 items that are contextualized to what the user is currently typing. Think of it as quickly hitting one of the first Google search results!

image.png

Autocomplete can be configured in your webapp's settings panel. It can also be disabled/reenabled programmatically in your CSML script with the following syntax:

say Autocomplete(false) // disable autocomplete
say Autocomplete(true) // enabled autocomplete

To configure Autocomplete, you need to have a backend endpoint that will handle the requests and respond accordingly. Read more in the CSML Studio docs!

CSML v1.8.0 is out!

 

New

  

We have just released CSML v1.8.0! This new version is PACKED with super useful features that we are extremely happy to finally share with you today. Let's do a quick roundup of all the new stuff!

while loops

This one is certainly one of the most requested features of all times, and for good reasons. You can now use standard while loops to iterate over any type of data (and not just arrays as was previously possible using foreach):

do i = 0
while (i < 3) {
  say "i = {{i}}"
  do i = i + 1
}

string.replace() helpers

Another very useful feature that makes it trivial to replace part of a string with something else, which was previously quite hard to achieve in pure CSML, the .replace() family of string methods (which include replace, replace_all and replace_regex) are also part of this release.

// .replace() will only replace the first occurrence
// of the first term with the second term
say "My dog Bark is nice, but my other dog Groot is mean".replace("dog", "cat") 
// => "My cat Bark is nice, but my other dog Groot is mean"

// .replace_all() will replace all occurrences
say "My dog Bark is nice, but my other dog Groot is mean".replace_all("dog", "cat") 
// => "My cat Bark is nice, but my other cat Groot is mean"

// .replace_regex() uses regular expressions 
say "My dog Bark is nice, but my other dog Groot is mean".replace_regex("[a-gA-G]", "%")
// => "My %o% %%rk is ni%%, %ut my oth%r %o% %root is m%%n"

Compound assignment operators

Yes, that's the name of the operator that lets you perform an operation at the same time that it assigns the result. For example:

do i = 1
do i += 5
say "i = {{i}}" // i = 6

Concatenate strings with the + sign

One of the feedbacks we sometimes had was that it is not always easy to concatenate strings together. It has always been possible using string interpolation, but the syntax is not too easy:

do firstname = "John"
do food = "cheese"
say "{{firstname}} likes {{food}}"

You can now use the + sign to do the same thing:

say firstname + " likes " + food

Add and subtract time from a Time() value

Obviously, one of the most common needs when manipulating times is to add or subtract time, for example when comparing two dates. The .add() and .sub() methods do exactly that:

do t1 = Time() // now
do t2 = t1.add(3600) // in 1 hour
do t3 = t1.sub(86400) // 1 day ago

Get local flow context in conversation

The _metadata global variable now has a new read-only inner property _context, which contains information about the user's current whereabouts in the flow. This object contains 2 new properties current_flow and current_step, and 2 optional properties previous_flow and previous_step that are only set when the user comes from a different step or flow (i.e after a goto).

start:
  say "{{_metadata._context}}" // will only print `current_*` properties
  goto step1

step1:
  say "{{_metadata._context}}" // will print all 4 properties
  goto end

Check if a variable has been set with Exists("var")

Last one for today: we have introduced a new built-in function to check if a variable currently exists in the bot's memory. This is useful for checking not only if the value is a null/false/empty value, but if it exists at all!

remember myVar = "somevalue"
do Exists("myVar") // true
remember myVar = null
do Exists("myVar") // true
forget myVar
do Exists("myVar") // false

The team has been busy making a lot of other improvements and features that may also interest you, so make sure to check the release notes, and please visit our Slack if you have any questions!

Instagram Channel is Available to All Instagram Businesses

 

Improvement

 

 

The limitations for installing a Chatbot on Instagram have been lifted by Facebook. Now, any Instagram Business Account can setup a CSML Chatbot to automate their Direct Messages, regardless of subscriber count!

Head over to the Instagram Channel documentation and setup your Instagram Chatbot with CSML Studio!

New database integrations: MySQL, PostgreSQL and MongoDB

 

New

 

 

One of the most common requests we got recently was: how can I save or access data in my own database? Until now, this problem involved building a custom API in front of the database, which is a complex and expensive workaround, requiring a lot of boilerplate code, and hosting as well security considerations.

mysql.png

To solve this issue, we are releasing connectors with some of the most used open-source databases: MySQL, PostgreSQL and MongoDB.

postgresql.png

You can install the corresponding apps for free in CSML Studio, which let you save data from your bot into your database, or retrieve your own data for use in the bot, without any added complexity.

mongodb.png

Find out more on how to integrate with your database of choice:

New Telegram Channel and Integration

 

New

 

 

You can now easily build chatbots for Telegram with the new Telegram channel on CSML Studio!

Telegram is one of the most popular messaging apps, mostly known and respected for its security. Chatbots are a very powerful part of the Telegram experience, with very wide integration capabilities! As well as a new Channel, we are also launching a new Telegram CSML App that lets you integrate with all Telegram APIs directly from your CSML code.

New Instagram Channel

 

New

 

 

We are very proud to announce that CSML Studio is one of the very first chatbot platforms to let you deploy chatbots for Instagram! 🎉

post csml insta.png

CSML Studio offers full compatibility for Instagram accounts with at least 1,000, up to 100,000 followers, as part of Facebook's rollout of the Instagram APIs. You can now use CSML Studio to automate responses to customer chat requests and stories!

The Instagram channel is available today on CSML Studio for chatbots on the Pro plan and above. New chatbots get a 1-month free, unlimited Trial of the Pro plan, including access to the Instagram channel!

New Twilio SMS Channel

 

New

 

 

You can now use CSML Studio to automatically respond to SMS messages with the new Twilio SMS integration! This channel will process incoming messages and forward them to your bot, letting you easily automate any type of SMS conversation.

571-05bc55efcd240344651a1067812591ce5c3c9bea.png

Get started with a SMS chatbot using this installation guide.

CSML Chatbot Templates Library

 

New

 

 

The new CSML Templates Library has arrived!

image.png

Now, when creating a new chatbot, you will have the option to start from an existing chatbot template that will boost your development efforts, by covering many of the most popular chatbot use cases around lead generation, quizzes and surveys, customer satisfaction, e-commerce…

New templates are added regularly, and CSML Partners can also submit their own templates to the library in order to gain visibility among CSML users.