Powered by Algolia

Script concepts

The Alan Voice AI Platform provides a framework for fast and easy development and deployment of voice experiences on any application. To do this, you need to create voice scripts using JavaScript in the Alan Studio.

Alan augments the standard JavaScript with lots of predefined functions and other functionality needed to create visual voice experiences. To get started with voice scripts, see the following sections:

To get information about all functions and objects that you can use in voice scripts, see the API reference.

Multiple scripts in the project

User can add as many scripts to the project as he needs. If there are several scripts they are loaded in order of their placement in the script panel. Upper scripts are loaded first. We introduced special global object project which has project scope and accessible from any script of the project. It makes any variable defined in the object project to be available in other scripts that are below. This can be helpful if you want to split complex script in parts and separate config and data structure from util functions and project logic. It lets you make project more clean and easy to support.

If we have two scripts, for example, script1 followed by script2 and in script1 we define project.config = {initValue: 1} then you can use project.config in script2 as already existing and defined variable.

project.config = {initValue: 1};

console.log("Init value is " + project.config.initValue);