CSML updates
CSML updates
www.csml.dev

Debugging Apps in Studio

 

Improvement

 

 

Sometimes, code doesn't work the way we intend to. In those cases, it's always helpful to print the value of a parameter or variable, using a simple console.log in javascript (or the equivalent in all other supported languages).

image.png

In the app testing interface, you can now access your app execution logs right after executing it. Simply click on the Logs tab after running the app:

image.png

IP Allow List

 

New

 

 

If you know what IP your Webapp channel is going to be requested from and need to prevent other IPs to be able to access it, you should definitely use our new feature: IP Allow List.

You can find this new setting under your Webapp's advanced configuration panel. Leave it empty for no restriction, or add individual IPs to prevent any other IP to access the chatbot.

image.png

Webapp UI Customization

 

Improvement

 

 

You can now customize the UI of the webapp channel! With this update, CSML chatbots can now completely match your branding by changing the colors and images.

image.png

This is probably one of the most requested features of all time. Not much more to say about it: check out the documentation!

Bot-Wide Environment Variables

 

New

 

 

You can now easily configure bot-wide environment variables!

When you need to access some static values across all your users and all your flows, you should use Bot Environment Variables.

Bot Environment Variables are injected in all your conversations under the _env global variable and are accessible everywhere, without ever being injected in the current user's memory so you can always keep them up to date for all of your users. They are also encrypted for enhanced security.

This is a perfect use case for API keys or secrets, as well as global configuration options!

image.png

New release: v1.5.0 🎉

 

New

 

 

CSML v1.5.0 was released today! Check the release notes for all the details about this new version.

There are many important features in this version, but I would like to highlight just a few of them that seem the most important.

Crypto Utils

Most systems nowadays require some sort of specific authentication or encoding to communicate securely. In this release, we introduced support for Base64 and Hex encoding/decoding data, creating and validating JWTs, as well as hashing and HMAC functions.

👉 Link to the documentation

Variable Step and Flow Names

Dynamically navigating to other steps and flows was also quite hard and cumbersome to achieve until today. It usually required a long list of if (x) goto y in your code.

Now, you can use the new $ syntax used for referencing variables in flow and step names instead: goto $stepname@$flowname. This helps make code much more concise and reusable!

👉 Link to the documentation

Bot Environment Variables

Efficiently and securely storing and accessing bot-wide variables (such as API keys, default configuration values, etc.) was quite difficult to do until now in CSML, since it usually required either writing these variables in clear text in many places in your bot, or replicating them in each user's memory.

With the new _env global, you can access bot-wide environment variables everywhere in your bot, without ever needing to remember them or replicating the value written in clear text anywhere in the bot.

For instance, if the bot communicates with a 3rd-party API, you can store this value under MY_API_KEY and use it in the bot with _env.MY_API_KEY.

Introducing Bot Snapshots

 

New

 

 

It is a good practice to never work directly on your production code, in order to avoid impacting your end users when updating your code. This is why we just introduced Bot Snapshots, which let you tag specific versions of your bot while in development, and deploy those snapshots on specific channels. You can think of snapshots as git tags or github releases.

You can create a new Snapshot by clicking on Take Snapshot at the bottom of your flow editor:

image.png

When using a snapshot in a channel, you can now continue making changes on your bot without impacting your users on that channel.

image.png

Also, you can revert your code to any snapshot. This makes it safe to try developing ambitious things as you can come back to an earlier version of your code at any time.

image.png

By default, all channels run on the latest snapshot (which is your latest build). You can select a snapshot in the channel's configuration panel, and you can update a snapshot to a new version by simply tagging the new version with the same name as an existing snapshot, which it will replace (similarly to git tags).

New Bot Sharing Experience

 

New

 

 

In the latest release of CSML Studio, we changed the way you can share bots with other users. You can now share any individual bot with any user, rather than all of your bots with a group of users who will also share their bots with you in return.

This is especially useful if you are working on bots that you need to share with different sets of users. For instance, if one team is working on a bot and another team is working on a different bot, you can now work on both bots without creating 2 separate accounts or giving access to both bots to both teams.

To invite a user or revoke someone's access to a bot, visit your bot's Settings > Team > Manage team.

image.png

In an upcoming release, we will also introduce roles, with differentiated access rights to each bot. Stay tuned!

Prepare for upcoming NLP behaviour change

 

Change

 

 

As a part of our current efforts to better integrate Natural Language Processing into CSML Studio chatbots, we are planning a change impacting bots connected with a NLU service provider (such as Dialogflow, Amazon Lex, IBM Watson…).

What is changing

Currently, if a chatbot user says something that is found to be an intent in your configured provider, the original text CSML event is transformed into a payload type of event, with a payload of IntentName (where IntentName is the actual name of the intent that was found by the NLU service). event.text will also contain the original text event as expressed by the user.

After this update, events matching an intent will have their payload formatted as intent:IntentName, where IntentName is once again the name of the intent that was found by the NLU service.

Why are we changing this behaviour

CSML developers have been complaining since the original release of the NLP feature that using the intent names was confusing in some cases where they could be mistaken for a regular text.

By prefixing found intent names with intent:, we believe that using NLU in CSML chatbots will be far easier. It will also allow us to color code intents in various places of the interface, which will eventually help with identifying them more quickly.

image.png

Finally, it is also part of a much bigger upcoming update that will allow you to directly train your NLU service, no matter what provider you are using, directly from CSML Studio.

How to find out if your bot is impacted

To check whether your bot is impacted by this change, visit the AI Rules > NLU Configuration panel. If your bot is running in Strict Mode, you are not impacted.

How to prepare for this change

To make sure that your bot continues working as expected, you should update your bot as follows.

  • If you are matching found intents with CSML flows in the AI Rules panel, every time you are using an intent in the left column, you should also add the new format in the list of triggers. For example, if you are matching IntentName with flow MyCoolFlow, you should also match intent:IntentName with the same flow. Then, save and build your bot.

  • If you are using the intent detection feature inside your flows (not as flow triggers but for example to help analyze what your users are responding to a question), you should adapt your code accordingly. There are many ways you can do that, but basically every time you have code such as:

if (event == "IntentName") { ... }

You can change it to:

if (event == "IntentName" || event == "intent:IntentName") { ... }

After the change goes live, you can then simply remove all the old mappings using the intent name directly and only keep the intent:IntentName syntax.

When does this change come into effect?

This change will be released gradually during the weekend of February 27-28th, 2021. To prevent any issue with your bot after this date, you should update your bots as described above before February 26th.

I don't know what to do, please help!

If you are unsure how to update your bot, please send an email to contact@csml.dev or reach out on Slack and we will guide you through the process.

New NLP and AI configuration tester

 

Improvement

 

 

You can now directly test your NLP (Natural Language Processing) configuration inside CSML Studio and quickly see how your bot will react to user inputs.

Inside the new and improved AI & NLU section, you can now configure your favorite NLP service and configure rules for intent or sentence detection by the chatbot, and immediately test your settings in the right-side Tester panel.

With this new panel, you can try various user text inputs and see how the chatbot would react:

  • Is the NLU provider properly configured?
  • Has an intent been detected by your NLU provider?
  • Does this input trigger any specific flow in your bot?
  • What does the CSML event look like?


This improvement has been designed to speed up development times for developers who use Natural Language Understanding in their chatbot. We plan a few more features in the NLU space over the next few months, so stay tuned!

New debug keyword

 

New

 

 

You can now use the new debug action verb in all your bots to help with development. This keyword will output a message that is only visible in the test webapp (it is never shown in production channels) and will output a simplified version of deep objects to make sure that its structure is always shown, even if the data is very large.

do mylargeobj = { 
  "val": 1,
  "something": {"toto": "tutu" },
  "other": "hello",
  "onemore": [1, 2, 3]
}
debug mylargeobj

image.png

Moreover, in contrary to the say keyword, debug can also be used inside native CSML functions to print temporary variables and further help chatbot developers.

fn is_triple_even(num):
  do triple = num * 3
  debug triple
  return (triple % 2)