DashaScript programming language | Dasha AI
- Domain specific language
- Based on TypeScript
- Designed for conversations
DashaScript is a Domain Specific Language designed to let you create human-like conversational experiences using voice as the interface. At its core, DashaScript consists of states representing AI actions and
conditions representing conversation events (user actions).
A DashaScript application is referred to as a script. The script is a part of dashaapp folder which gets executed in the DashaCloud via API. The script determines the behavior of the Dasha app at runtime.
To get syntax analysis and highlighting, please install the Dasha Studio Extension in Microsoft Visual Studio Code and create a file with the
.dsl extension. You can also follow the Quick Start Guide.
A chunk of code which comprises a distinct phase in the DashaScript program execution. There are two types of states. A
nodeis a state which is reached via a transition from a specified state. A
digressionis a state which can be reached from any state through conditional definition. Most states contain an interaction between AI and user; yet can avoid interaction altogether and instead be used to perform a calculation or to call an external function that progresses the execution of the program.
A sort of state which can only be reached by a direct transition from another state. The exception is the start
nodewith which all DashaScript programs begin.
Specifies to which
nodethe program will go next and on which condition. Used in
nodesbut can only ever specify a
nodeas target destination.
- Digression A type of state which can be called up at any point in the DashaScript program execution. Digressions are executed when a specified condition is met. Most of the time the condition is that a specific intent(s) and/or named entity(ies) is/are identified.
A set of variables shared among states in a DashaScript file. These variables are preceded by a
- Input context variables variables passed to the DashaScript file as arguments. In the current implementation, passed from the Node.js app you use to launch your Dasha app. Can also be used in other ways, e.g.: in a Zapier Dasha integration, you specify how you receive input variables.
- Output context variables Variables returned by the Dasha app when it finishes its execution. In the current implementation, passed from Dasha app to the Node.js app. Can also be used in other ways, e.g.: in a Zapier Dasha integration, you specify how you want to use the generated output variables.
- Internal context variables Storage variables available for use in the execution of your Dasha app.
- External functions The ability to execute a Node.js function in the body of your .js file right from your DashaScript file. Is used to pass/retrieve data from external services via API or to perform data operations and/or calculations. Used to pass variables in/out of your Dasha app during the course of the app’s runtime (not in the beginning/end like input/output.
A self-sufficient set of context, states and transitions. The DashaScript file in its entirety is a block. You can also have blocks which are used as functions within your DashaScript file to perform tasks. You would use a
blockas any other function in any other programming language.